public interface Processor
Modifier and Type | Method and Description |
---|---|
String |
getFamily() |
String |
getIdentifier()
Identifier, eg.
|
float |
getLoad()
Deprecated.
Replaced in 1.3 by
getSystemCpuLoadBetweenTicks() |
String |
getModel() |
String |
getName()
Name, eg.
|
double |
getProcessorCpuLoadBetweenTicks()
Returns the "recent cpu usage" for this processor by counting ticks for
this processor from
getProcessorCpuLoadTicks() between
successive calls of this method, with a minimum interval slightly less
than 1 second. |
long[] |
getProcessorCpuLoadTicks()
Get this Processor's CPU Load tick counters.
|
int |
getProcessorNumber()
Gets the processor number of this object, passed as an arg in the
constructor.
|
String |
getStepping() |
double |
getSystemCpuLoad()
Returns the "recent cpu usage" for the whole system from
com.sun.management.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.
|
double |
getSystemLoadAverage()
Returns the system load average for the last minute from
OperatingSystemMXBean.getSystemLoadAverage()
. |
String |
getVendor()
Processor vendor.
|
long |
getVendorFreq()
Vendor frequency (in Hz).
|
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).
|
int getProcessorNumber()
String 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 set@Deprecated float getLoad()
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.double 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()
double getSystemCpuLoad()
com.sun.management.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 Processor
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()
OperatingSystemMXBean.getSystemLoadAverage()
. The system load average is the sum of the number of runnable entities
queued to the 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.
If the load average is not available, a negative value is returned.
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
platforms (e.g., Windows) where it is expensive to implement this method.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()
Copyright © 2010-2015 com.github.dblock. All Rights Reserved.