PerformanceMonitor.instanceCount Method
Returns the instance count, which is the number of processes in the current snapshot.
Syntax
public int instanceCount()
Run On
Called
Return Value
Type: int
The number of processes in the current snapshot.
Remarks
Use the takeSnapshot method to take a snapshot of the currently running processes.
Examples
static void pvPerformanceMonitorTest(args a)
{
int i, j;
PerformanceMonitorInstance instance;
PerformanceMonitorCounter counter1, counter2;
PerformanceMonitor pm = new PerformanceMonitor();
// Take a current snapshot of the system.
pm.takeSnapshot ();
// Traverse all the running processes.
for (i= 1; i <= pm.instanceCount(); i++)
{
instance = pm.instance(i);
counter1 = instance.getCounter("ID Process");
counter2 = instance.getCounter("Working Set");
print instance.name(), " ",
counter1.intData(), " ",
counter2.intData();
}
pause;
}