public class LinuxCentralProcessor extends AbstractCentralProcessor
CentralProcessor.LogicalProcessor, CentralProcessor.TickTypelogicalProcessorCount, physicalPackageCount, physicalProcessorCount| Constructor and Description | 
|---|
LinuxCentralProcessor()
Create a Processor 
 | 
| Modifier and Type | Method and Description | 
|---|---|
long | 
getContextSwitches()
Get the number of context switches which have occurred 
 | 
long[] | 
getCurrentFreq()
Current frequeny (in Hz), of the logical processors on this CPU. 
 | 
long | 
getInterrupts()
Get the number of interrupts which have occurred 
 | 
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. 
 | 
protected CentralProcessor.LogicalProcessor[] | 
initProcessorCounts()
Updates logical and physical processor counts and arrays 
 | 
long | 
queryMaxFreq()
Get processor max frequency. 
 | 
createProcessorID, getFamily, getIdentifier, getLogicalProcessorCount, getLogicalProcessors, getMaxFreq, getModel, getName, getPhysicalPackageCount, getPhysicalProcessorCount, getProcessorCpuLoadBetweenTicks, getProcessorID, getStepping, getSystemCpuLoadBetweenTicks, getVendor, getVendorFreq, isCpu64bit, setCpu64, setFamily, setIdentifier, setModel, setName, setProcessorID, setStepping, setVendor, setVendorFreq, toStringprotected CentralProcessor.LogicalProcessor[] initProcessorCounts()
initProcessorCounts 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.
 Note that while tick counters are in units of milliseconds, they may advance in larger increments along with (platform dependent) clock ticks. For example, by default Windows clock ticks are 1/64 of a second (about 15 or 16 milliseconds) and Linux ticks are distribution and configuration dependent but usually 1/100 of a second (10 milliseconds).
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, SoftIRQ, and Steal ticks should be added to the System value to get the total. System ticks also include time executing other virtual hosts (steal).
public long[] getCurrentFreq()
public long queryMaxFreq()
queryMaxFreq in class AbstractCentralProcessorpublic double[] getSystemLoadAverage(int nelem)
nelem - Number of elements to return.public long[][] getProcessorCpuLoadTicks()
CentralProcessor.getLogicalProcessorCount() arrays, each containing seven elements
 representing milliseconds spent in User (0), Nice (1), System (2), Idle (3),
 IOwait (4), Hardware interrupts (IRQ) (5), Software interrupts/DPC (SoftIRQ)
 (6), or Steal (7) 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.
 Note that while tick counters are in units of milliseconds, they may advance in larger increments along with (platform dependent) clock ticks. For example, by default Windows clock ticks are 1/64 of a second (about 15 or 16 milliseconds) and Linux ticks are distribution and configuration dependent but usually 1/100 of a second (10 milliseconds).
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, SoftIRQ and Steal ticks should be added to the System value to get the total. System ticks also include time executing other virtual hosts (steal).
public long getContextSwitches()
public long getInterrupts()
Copyright © 2010–2019 oshi. All rights reserved.