|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Monitor
This is the interface that needs to be
implemented for any platform that JavaSysMon
supports. If you write your own implementation,
you can test it by injecting it into
JavaSysMon.setMonitor(com.jezhumble.javasysmon.Monitor)
Method Summary | |
---|---|
long |
cpuFrequencyInHz()
Get the CPU frequency in Hz |
CpuTimes |
cpuTimes()
Gets a snapshot which contains the total amount of time the CPU has spent in user mode, kernel mode, and idle. |
int |
currentPid()
Gets the pid of the process that is calling this method (assuming it is running in the same process). |
void |
killProcess(int pid)
Attempts to kill the process identified by the integer id supplied. |
int |
numCpus()
Get the number of CPU cores. |
java.lang.String |
osName()
Get the operating system name. |
MemoryStats |
physical()
Gets the physical memory installed, and the amount free. |
ProcessInfo[] |
processTable()
Get the current process table. |
MemoryStats |
swap()
Gets the amount of swap available to the operating system, and the amount that is free. |
long |
uptimeInSeconds()
How long the system has been up in seconds. |
Method Detail |
---|
java.lang.String osName()
int numCpus()
long cpuFrequencyInHz()
long uptimeInSeconds()
CpuTimes cpuTimes()
CpuTimes.getCpuUsage(com.jezhumble.javasysmon.CpuTimes)
MemoryStats physical()
MemoryStats swap()
int currentPid()
ProcessInfo[] processTable()
void killProcess(int pid)
pid
- The id of the process to kill
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |