public interface CentralProcessor extends OshiJsonObject
| Modifier and Type | Method and Description |
|---|---|
String |
getFamily() |
String |
getIdentifier()
Identifier, eg.
|
int |
getLogicalProcessorCount()
Get the number of logical CPUs available for processing.
|
String |
getModel() |
String |
getName()
Name, eg.
|
int |
getPhysicalProcessorCount()
Get the number of physical CPUs/cores available for processing.
|
OSProcess |
getProcess(int pid)
Gets information on a currently running process
|
int |
getProcessCount()
Get the number of processes currently running
|
OSProcess[] |
getProcesses()
Gets currently running processes
|
int |
getProcessId()
Gets the current process ID
|
double[] |
getProcessorCpuLoadBetweenTicks()
Returns the "recent cpu usage" for all logical processors by counting
ticks for the processors from
getProcessorCpuLoadTicks() between
successive calls of this method, with a minimum interval slightly less
than 1 second. |
long[][] |
getProcessorCpuLoadTicks()
Get Processor CPU Load tick counters.
|
String |
getStepping() |
double |
getSystemCpuLoad()
Returns the "recent cpu usage" for the whole system from
OperatingSystemMXBean.getSystemCpuLoad() if a
user is running the Oracle JVM. |
double |
getSystemCpuLoadBetweenTicks()
Returns the "recent cpu usage" for the whole system by counting ticks
from
getSystemCpuLoadTicks() between successive calls of this
method, with a minimum interval slightly less than 1 second. |
long[] |
getSystemCpuLoadTicks()
Get System-wide CPU Load tick counters.
|
long |
getSystemIOWaitTicks()
Get System IOWait tick counters (if available on that Operating System).
|
long[] |
getSystemIrqTicks()
Get System IRQ tick counters (if available on that Operating System).
|
double |
getSystemLoadAverage()
Returns the system load average for the last minute.
|
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()
Get the System/CPU Serial Number, if available.
|
long |
getSystemUptime()
Get the System uptime (time since boot).
|
int |
getThreadCount()
Get the number of threads currently running
|
String |
getVendor()
Processor vendor.
|
long |
getVendorFreq()
Vendor frequency (in Hz), eg.
|
boolean |
isCpu64bit()
Is CPU 64bit?
|
void |
setCpu64(boolean cpu64)
Set flag is cpu is 64bit.
|
void |
setFamily(String _family) |
void |
setIdentifier(String identifier)
Set processor identifier.
|
void |
setModel(String _model) |
void |
setName(String name)
Set processor name.
|
void |
setStepping(String _stepping) |
void |
setVendor(String vendor)
Set processor vendor.
|
void |
setVendorFreq(long freq)
Set processor vendor frequency (in Hz).
|
toJSONString getVendor()
void setVendor(String vendor)
vendor - Vendor.String getName()
void setName(String name)
name - Name.long getVendorFreq()
void setVendorFreq(long freq)
freq - Frequency.String getIdentifier()
void setIdentifier(String identifier)
identifier - Identifier.boolean isCpu64bit()
void setCpu64(boolean cpu64)
cpu64 - True if cpu is 64.String getStepping()
void setStepping(String _stepping)
_stepping - the _stepping to setString getModel()
void setModel(String _model)
_model - the _model to setString getFamily()
void setFamily(String _family)
_family - the _family to setdouble getSystemCpuLoadBetweenTicks()
getSystemCpuLoadTicks() between successive calls of this
method, with a minimum interval slightly less than 1 second. If less than
one second has elapsed since the last call of this method, it will return
a calculation based on the tick counts and times of the previous two
calls. If at least a second has elapsed, it will return the average CPU
load for the interval and update the "last called" times. This method is
intended to be used for periodic polling at intervals of 1 second or
longer.long[] getSystemCpuLoadTicks()
getSystemIOWaitTicks(). The system time
includes system time spent servicing Hardware and Software IRQ requests
as reported by getSystemIrqTicks() as well as executing other
virtual hosts (steal) or running a virtual cpu (guest).long getSystemIOWaitTicks()
getSystemCpuLoadTicks() but is provided separately
for more detail.long[] getSystemIrqTicks()
getSystemCpuLoadTicks() but is provided separately for more
detail.double getSystemCpuLoad()
OperatingSystemMXBean.getSystemCpuLoad() if a
user is running the Oracle JVM. This value is a double in the [0.0,1.0]
interval. A value of 0.0 means that all CPUs were idle during the recent
period of time observed, while a value of 1.0 means that all CPUs were
actively running 100% of the time during the recent period being
observed. All values between 0.0 and 1.0 are possible depending of the
activities going on in the system. If the system recent cpu usage is not
available, the method returns a negative value. Calling this method
immediately upon instantiating the CentralProcessor may give
unreliable results. If a user is not running the Oracle JVM, this method
will default to the behavior and return value of
getSystemCpuLoadBetweenTicks().double getSystemLoadAverage()
getSystemLoadAverage(int) with an
argument of 1 and returning the first value, and is retained for
compatibility.double[] getSystemLoadAverage(int nelem)
nelem - Number of elements to return.double[] getProcessorCpuLoadBetweenTicks()
getProcessorCpuLoadTicks() between
successive calls of this method, with a minimum interval slightly less
than 1 second. If less than one second has elapsed since the last call of
this method, it will return a calculation based on the tick counts and
times of the previous two calls. If at least a second has elapsed, it
will return the average CPU load for the interval and update the
"last called" times. This method is intended to be used for periodic
polling (iterating over all processors) at intervals of 1 second or
longer.long[][] getProcessorCpuLoadTicks()
getLogicalProcessorCount() arrays, each containing four
elements representing clock ticks or milliseconds (platform dependent)
spent in User (0), Nice (1), System (2), and Idle (3) states. By
measuring the difference between ticks across a time interval, CPU load
over that interval may be calculated.
The Idle time for this method includes processor time spent idle waiting
for IO as reported by getSystemIOWaitTicks(). The system time
includes processor time spent servicing Hardware IRQ requests as reported
by getSystemIrqTicks() as well as Software IRQ requests
(softirq), executing other virtual hosts (steal) or running a virtual cpu
(guest).long getSystemUptime()
String getSystemSerialNumber()
int getLogicalProcessorCount()
int getPhysicalProcessorCount()
OSProcess[] getProcesses()
OSProcess objects for
currently running processesOSProcess getProcess(int pid)
pid - A process IDOSProcess object for the specified
process id if it is running; null otherwise currently running
processesint getProcessId()
int getProcessCount()
int getThreadCount()
Copyright © 2010–2016 com.github.dblock. All rights reserved.