public class CPUUsage extends Object
| Modifier and Type | Method and Description |
|---|---|
static long |
getCPU()
For convenience
|
double |
getCpuUsageSofar()
Returns the CPU usage for the running process tracked by the instantiation of this instance
|
static CPUUsage |
getDefaultInstance() |
static long |
getProcessCpuTime(int port)
Returns -1 if not possible to do that
|
static void |
main(String[] args)
Just for testing
|
static CPUUsage |
newInstance(int port) |
void |
resetInterval()
Resets the sampling interval, and returns the CPU usage for the running process
since the last call to this method or since the creation of a this CPUUsage instance
if, resetIntevalAndGetCpuUsage was never called before
|
double |
resetIntervalAndGetCpuUsage()
Resets the sampling interval, and returns the CPU usage for the running process
since the last call to this method or since the creation of a this CPUUsage instance
if, resetIntevalAndGetCpuUsage was never called before
|
public static CPUUsage getDefaultInstance() throws InvalidStateException
InvalidStateExceptionpublic static CPUUsage newInstance(int port) throws InvalidStateException
InvalidStateExceptionpublic void resetInterval()
public double resetIntervalAndGetCpuUsage()
public double getCpuUsageSofar()
public static long getProcessCpuTime(int port)
port - parameterpublic static long getCPU()
Copyright 2004-2021 Solace Corporation. All rights reserved.