Package com.gigaspaces.internal.os
Interface ProcessCpuSampler
- All Known Implementing Classes:
JavaProcessCpuSampler,OshiProcessCpuSampler
public interface ProcessCpuSampler
- Since:
- 15.5.1
- Author:
- Niv Ingberg
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault doublegetCpuLoadCumulative(long totalCpuTime, long upTime) Gets CPU utilization of this process as a fraction of 100%.longGets the number of milliseconds the process has executed in kernel or user mode.
-
Field Details
-
NA
static final long NAIndicates sample is not available.- See Also:
-
cores
static final int coresCPU utilization is expressed as a fraction of 100% (dividing by the number of CPU cores), even though some vendors scale to N*100% if multiple CPUs (N CPUs) exist.
The default behavior is to divide the CPU utilization by the number of cores. To show the raw utilization reported by the underline CPU probe set the following System propertycom.gs.process.cpu.utilization.divideByCoreswith false.
-
-
Method Details
-
sampleTotalCpuTime
long sampleTotalCpuTime()Gets the number of milliseconds the process has executed in kernel or user mode. -
getCpuLoadCumulative
default double getCpuLoadCumulative(long totalCpuTime, long upTime) Gets CPU utilization of this process as a fraction of 100%.This calculation sums CPU ticks across all processors and may exceed 100% for multi-threaded processes. This is consistent with the cumulative CPU presented by the "top" command on Linux/Unix machines. This value is divided by the
coresto return a fraction of 100%.- Returns:
- The proportion of up time that the process was executing in kernel or user mode.
-