public class LinuxCentralProcessor extends AbstractCentralProcessor
CentralProcessor.TickTypelogicalProcessorCount, physicalProcessorCount| Constructor and Description |
|---|
LinuxCentralProcessor()
Create a Processor
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
calculateProcessorCounts()
Updates logical and physical processor counts from /proc/cpuinfo
|
long[][] |
getProcessorCpuLoadTicks()
Get Processor CPU Load tick counters.
|
long[] |
getSystemCpuLoadTicks()
Get System-wide CPU Load tick counters.
|
double[] |
getSystemLoadAverage(int nelem)
Returns the system load average for the number of elements specified, up
to 3, representing 1, 5, and 15 minutes.
|
String |
getSystemSerialNumber()
Deprecated.
|
long |
getSystemUptime()
Get the System uptime (time since boot).
|
createProcessorID, getFamily, getIdentifier, getLogicalProcessorCount, getModel, getName, getPhysicalProcessorCount, getProcessorCpuLoadBetweenTicks, getProcessorID, getStepping, getSystemCpuLoad, getSystemCpuLoadBetweenTicks, getSystemLoadAverage, getVendor, getVendorFreq, initTicks, isCpu64bit, setCpu64, setFamily, setIdentifier, setModel, setName, setProcessorID, setStepping, setVendor, setVendorFreq, toString, updateProcessorTicks, updateSystemTicksprotected void calculateProcessorCounts()
calculateProcessorCounts in class AbstractCentralProcessorpublic long[] getSystemCpuLoadTicks()
CentralProcessor.TickType.getIndex() to retrieve the appropriate
index. By measuring the difference between ticks across a time interval,
CPU load over that interval may be calculated.
Nice and IOWait information is not available on Windows, and IOwait and
IRQ information is not available on macOS, so these ticks will always be
zero.
To calculate overall Idle time using this method, include both Idle and
IOWait ticks. Similarly, IRQ and SoftIRQ ticks should be added to the
System value to get the total. System ticks also include time executing
other virtual hosts (steal).public double[] getSystemLoadAverage(int nelem)
nelem - Number of elements to return.public long[][] getProcessorCpuLoadTicks()
CentralProcessor.getLogicalProcessorCount() arrays, each containing seven
elements representing either clock ticks or milliseconds (platform
dependent) spent in User (0), Nice (1), System (2), Idle (3), IOwait (4),
Hardware interrupts (IRQ) (5), or Software interrupts/DPC (SoftIRQ) (6)
states. Use CentralProcessor.TickType.getIndex() to retrieve the appropriate
index. By measuring the difference between ticks across a time interval,
CPU load over that interval may be calculated.
Nice and IOwait per processor information is not available on Windows,
and IOwait and IRQ information is not available on macOS, so these ticks
will always be zero.
To calculate overall Idle time using this method, include both Idle and
IOWait ticks. Similarly, IRQ and SoftIRQ ticks should be added to the
System value to get the total. System ticks also include time executing
other virtual hosts (steal).public long getSystemUptime()
@Deprecated public String getSystemSerialNumber()
Copyright © 2010–2017 oshi. All rights reserved.