EVALUATION
A new method is added in java.lang.management.OperatingSystemMXBean interface:
/**
* Returns the system load average for the last minute.
* The system load average is the sum of the number of runnable entity
* queued to the {@linkplain #getAvailableProcessors available processors}
* and the number of runnable entities running on the available processors
* averaged over a period of time.
* The way in which the load average is calculated is operating system
* specific but is typically a damped time-dependent average.
* <p>
* If the load average was not available, a negative value is returned.
* <p>
* This method is designed to provide a hint about the system load
* and may be queried frequently.
* The load average may be unavailable on some platform where it is
* expensive to implement this method.
*
* @return the system load average; or a negative value if not available.
*
* @since 1.6
*/
public double getSystemLoadAverage();
Both linux and Solaris have an API to obtain load averages. There isn't such metric on Windows. Instead, there is a run queue length performance counter. However, it is expensive to obtain the run queue length performance counter.
Since one requirement of this API has to be cheap, in Sun's implementation, it will return negative value on Windows until a fast implementation can be done in the future.
|