public class PIDStatCollector extends AbstractProcessCollector implements ICounterHierarchy, IProcessCounters
pidstat -p 501 -u -I -r -d -w
[[interval [count]]
Where -p is the pid to monitor, -u is cpu
utilization (-I normalizes to 100% for SMP), -r
gives the process memory statistics, -d gives IO statistics with
kernels 2.6.20 and up; -w gives context switching data; The
interval is in seconds. The count is optional - when missing or zero will
repeat forever if interval was specified.
| Modifier and Type | Class and Description |
|---|---|
protected class |
PIDStatCollector.PIDStatReader
Reads
pidstat output and extracts and updates counter
values. |
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
perProcessIOData
set
true if per-process IO data collection should be
supported based on the KernelVersion. |
protected int |
pid
process to be monitored.
|
activeProcess, logCPU_PercentProcessorTime, CPU_PercentSystemTime, CPU_PercentUserTime, Memory_majorFaultsPerSec, Memory_minorFaultsPerSec, Memory_percentMemorySize, Memory_residentSetSize, Memory_runtimeFreeMemory, Memory_runtimeMaxMemory, Memory_runtimeTotalMemory, Memory_virtualSize, PhysicalDisk_BytesReadPerSec, PhysicalDisk_BytesWrittenPerSecCPU, Info, LogicalDisk, Memory, Memory_GarbageCollectors, Memory_Memory_Pools, PhysicalDisk, ps| Constructor and Description |
|---|
PIDStatCollector(int pid,
int interval,
KernelVersion kernelVersion) |
| Modifier and Type | Method and Description |
|---|---|
List<String> |
getCommand() |
CounterSet |
getCounters()
Return performance counters.
|
AbstractProcessReader |
getProcessReader() |
protected void |
setEnvironment(Map<String,String> env)
Extended to force
pidstat to use a consistent timestamp
format regardless of locale by setting S_TIME_FORMAT="ISO"
in the environment. |
getInterval, start, stopprotected final int pid
protected final boolean perProcessIOData
true if per-process IO data collection should be
supported based on the KernelVersion.public PIDStatCollector(int pid,
int interval,
KernelVersion kernelVersion)
pid - Process to be monitored.interval - Reporting interval in seconds.kernelVersion - The Linux KernelVersion.public List<String> getCommand()
getCommand in class AbstractProcessCollectorpublic CounterSet getCounters()
ICounterSetAccessgetCounters in interface ICounterSetAccessprotected void setEnvironment(Map<String,String> env)
pidstat to use a consistent timestamp
format regardless of locale by setting S_TIME_FORMAT="ISO"
in the environment.setEnvironment in class AbstractProcessCollectorpublic AbstractProcessReader getProcessReader()
getProcessReader in class AbstractProcessCollectorCopyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.