|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jppf.client.utils.GridMonitor
public class GridMonitor
This class monitors each of the nodes and their memory usage during execution.
example use:
JPPFClient client = ...;
// take memory usage snapshots at approximately 1 second intervals
GridMonitor monitor = new GridMonitor(client, 1000L);
monitor.startMonitoring();
JPPFJob job = ...;
List<JPPFTask> results = client.submit(job);
monitor.stopMonitoring();
// store snapshots in the specified directory
// there will be one .csv file per node
monitor.storeData("./GridMonitoring");
monitor.close();
| Nested Class Summary | |
|---|---|
class |
GridMonitor.DataUpdateTask
This task is run at regular intervals by a timer and takes a snapshot of the heap memory usage for each node. |
static class |
GridMonitor.JPPFManagement
Container class that holds references to JMX-related objects for one node. |
static class |
GridMonitor.NodeData
Instances of this class represent a snapshot of the heap memory usage of a node at a given time. |
| Constructor Summary | |
|---|---|
GridMonitor(JPPFClient jppfClient)
Initialize this grid monitor with the specified JPPF client and the default (1 second) snpashot interval. |
|
GridMonitor(JPPFClient jppfClient,
long snapshotInterval)
Initialize this grid monitor with the specified JPPF client and snpashot interval. |
|
GridMonitor(String driverHost,
int managementPort)
Initialize this grid monitor with the specified parameters. |
|
GridMonitor(String driverHost,
int managementPort,
long snapshotInterval)
Initialize this grid monitor with the specified parameters. |
|
| Method Summary | |
|---|---|
void |
close()
Close this monitpr and release the resources it uses. |
GridMonitor.JPPFManagement |
getDriver()
Get the object that holds the JMX connection to the driver. |
String |
getInfo(GridMonitor.JPPFManagement mgt)
Compute a string that provides information about a driver or node, including the PID |
GridMonitor.JPPFManagement[] |
getNodes()
Get the objects that hold the JMX connection to the nodes. |
void |
startMonitoring()
Start this monitor and associated resources. |
void |
stopMonitoring()
Stop monitoring the nodes. |
void |
storeData(String folder)
Store all data snapshots to file. |
void |
testPIDs()
This method demonstrates how the APIs in this class can be used to find the Process ID for the driver and nodes. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GridMonitor(String driverHost,
int managementPort)
throws Exception
driverHost - the host of the driver.managementPort - management port used by the driver.
Exception - if any error occurs.
public GridMonitor(String driverHost,
int managementPort,
long snapshotInterval)
throws Exception
driverHost - the host of the driver.managementPort - management port used by the driver.snapshotInterval - the interval at which memory usage snapshots are taken.
Exception - if any error occurs.
public GridMonitor(JPPFClient jppfClient)
throws Exception
jppfClient - the JPPF client from which to get the JMX connections.
Exception - if any error occurs during initialization.
public GridMonitor(JPPFClient jppfClient,
long snapshotInterval)
throws Exception
jppfClient - the JPPF client from which to get the JMX connections.snapshotInterval - the interval at which memory usage snapshots are taken.
Exception - if any error occurs during initialization.| Method Detail |
|---|
public void startMonitoring()
public void stopMonitoring()
public void close()
throws Exception
Exception - if any error occurs.public void storeData(String folder)
folder - path to the folder where the files are created. This folder is created if needed.public GridMonitor.JPPFManagement getDriver()
JPPFManagement instance for the driver.public GridMonitor.JPPFManagement[] getNodes()
JPPFManagement instances for the nodes.public void testPIDs()
public String getInfo(GridMonitor.JPPFManagement mgt)
mgt - the driver or node to process.
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||