|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsystem.SystemInformation
public abstract class SystemInformation
| Nested Class Summary | |
|---|---|
static class |
SystemInformation.CPUUsageSnapshot
A simple class to represent data snapshots taken by makeCPUUsageSnapshot(). |
static class |
SystemInformation.NegativeCPUTime
|
| Field Summary | |
|---|---|
static int |
MIN_ELAPSED_TIME
Minimum time difference [in milliseconds] enforced for the inputs into getProcessCPUUsage(SystemInformation.CPUUsageSnapshot,SystemInformation.CPUUsageSnapshot). |
| Method Summary | |
|---|---|
static int |
detachProcess()
Closes native-dependent process handle, if necessary. |
static int |
getCPUs()
Returns the number of processors on machine |
static long |
getFreeMem()
Returns current free memory in the system. |
static long |
getMaxMem()
Returns maximum memory available in the system. |
static long |
getMemoryResident()
Returns current process space being resident in memory, in Kbytes. |
static long |
getMemoryUsage()
Returns current space allocated for the process, in Kbytes. |
static double |
getProcessCPUPercentage()
Returns CPU (kernel + user) time used by the current process [in perecents]. |
static long |
getProcessCPUTime()
Returns CPU (kernel + user) time used by the current process [in milliseconds]. |
static double |
getProcessCPUUsage()
Returns CPU usage (fraction of 1.0) so far by the current process. |
static double |
getProcessCPUUsage(SystemInformation.CPUUsageSnapshot start,
SystemInformation.CPUUsageSnapshot end)
Computes CPU usage (fraction of 1.0) between start.m_CPUTime and end.m_CPUTime time points [1.0 corresponds to 100% utilization of all processors]. |
static int |
getProcessID()
Returns the PID of the current process. |
static java.lang.String |
getSysInfo()
Returns system name info like "uname" command output |
static SystemInformation.CPUUsageSnapshot |
makeCPUUsageSnapshot()
Creates a CPU usage data snapshot by associating CPU time used with system time. |
static int |
setPid(int pid)
Sets the system native process PID for which all measurements will be done. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MIN_ELAPSED_TIME
getProcessCPUUsage(SystemInformation.CPUUsageSnapshot,SystemInformation.CPUUsageSnapshot).
The motivation for this restriction is the fact that
System.currentTimeMillis() on some systems has a low resolution (e.g.,
10ms on win32). The current value is 100 ms.
| Method Detail |
|---|
public static SystemInformation.CPUUsageSnapshot makeCPUUsageSnapshot()
throws SystemInformation.NegativeCPUTime
getProcessCPUUsage(SystemInformation.CPUUsageSnapshot,SystemInformation.CPUUsageSnapshot).
SystemInformation.NegativeCPUTime
public static double getProcessCPUUsage(SystemInformation.CPUUsageSnapshot start,
SystemInformation.CPUUsageSnapshot end)
java.lang.IllegalArgumentException - if start and end time points are less than
MIN_ELAPSED_TIME ms apart.
java.lang.IllegalArgumentException - if either argument is null;public static int getProcessID()
public static int getCPUs()
public static long getProcessCPUTime()
public static double getProcessCPUPercentage()
public static long getMaxMem()
public static long getFreeMem()
public static java.lang.String getSysInfo()
public static double getProcessCPUUsage()
public static long getMemoryUsage()
public static long getMemoryResident()
public static int setPid(int pid)
public static int detachProcess()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||