Class LoadAverage
java.lang.Object
oshi.driver.common.windows.perfmon.LoadAverage
Utility to calculate a load average equivalent metric on Windows. Starts a daemon thread to collect the necessary
counters and averages in 5-second intervals. Subclasses provide the platform-specific perfmon queries.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble[]queryLoadAverage(int nelem) Queries the load average values.Query the non-idle ticks from performance counters.protected abstract longQuery the processor queue length from performance counters.voidStarts the load average daemon thread.voidStops the load average daemon thread.
-
Constructor Details
-
LoadAverage
protected LoadAverage()Default constructor.
-
-
Method Details
-
queryNonIdleTicks
-
queryQueueLength
protected abstract long queryQueueLength()Query the processor queue length from performance counters.- Returns:
- The processor queue length
-
queryLoadAverage
public double[] queryLoadAverage(int nelem) Queries the load average values.- Parameters:
nelem- number of elements to return (1, 2, or 3)- Returns:
- array of load averages
-
stopDaemon
public void stopDaemon()Stops the load average daemon thread. -
startDaemon
public void startDaemon()Starts the load average daemon thread.
-