jsysmon
Class JSysmon

java.lang.Object
  extended byjsysmon.JSysmon

public class JSysmon
extends java.lang.Object

JSysmon main class. Use static methods provided here to retrieve the system's information you need. User/System/Idle times are provided as the system returns them.

Author:
Francois-Xavier Detourniere

Field Summary
static int ALL_CPU
          Constant for Times method to indicate that the method has to return data considering all CPUs
static long DEFAULT_UPDATE_DELAY
          Default update delay between two updates of Monitoring Data
 
Constructor Summary
JSysmon()
           
 
Method Summary
static void addCPUMonitoringListener(CPUMonitoringListener l)
          Register a new CPU Monitoring Listener
static void addMemoryMonitoringListener(MemoryMonitoringListener l)
          Register a new Memory Monitoring Listener
static CPUMonitoringData getLatestSystemData()
          Deprecated. You should register as a listener to avoid concurrent access
static int getNbCpus()
          Returns the number of CPUs in the system
static void removeCPUMonitoringListener(CPUMonitoringListener l)
          Unregister a CPU Monitoring Listener
static void removeMemoryMonitoringListener(MemoryMonitoringListener l)
          Unregister a Memory Monitoring Listener
static void setUpdateDelay(long _updateDelay)
          Change the update delay between tow updates of Monitoring Data.
static void startMonitoring()
          Starts Monitoring
static void stopMonitoring()
          Stops Monitoring
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALL_CPU

public static final int ALL_CPU
Constant for Times method to indicate that the method has to return data considering all CPUs

See Also:
Constant Field Values

DEFAULT_UPDATE_DELAY

public static final long DEFAULT_UPDATE_DELAY
Default update delay between two updates of Monitoring Data

See Also:
Constant Field Values
Constructor Detail

JSysmon

public JSysmon()
Method Detail

setUpdateDelay

public static void setUpdateDelay(long _updateDelay)
Change the update delay between tow updates of Monitoring Data. Putting a two short delay may lead to inconsistent results, the value should not be lesser than 1 second.

Parameters:
_updateDelay - Update Delay in milliseconds

addCPUMonitoringListener

public static void addCPUMonitoringListener(CPUMonitoringListener l)
Register a new CPU Monitoring Listener


removeCPUMonitoringListener

public static void removeCPUMonitoringListener(CPUMonitoringListener l)
Unregister a CPU Monitoring Listener

Parameters:
l - Listener to Unregister

addMemoryMonitoringListener

public static void addMemoryMonitoringListener(MemoryMonitoringListener l)
Register a new Memory Monitoring Listener


removeMemoryMonitoringListener

public static void removeMemoryMonitoringListener(MemoryMonitoringListener l)
Unregister a Memory Monitoring Listener

Parameters:
l - Listener to Unregister

startMonitoring

public static void startMonitoring()
Starts Monitoring


stopMonitoring

public static void stopMonitoring()
Stops Monitoring


getLatestSystemData

public static CPUMonitoringData getLatestSystemData()
Deprecated. You should register as a listener to avoid concurrent access

Returns the latest system monitoring data

Returns:
The latest system monitoring data

getNbCpus

public static int getNbCpus()
Returns the number of CPUs in the system

Returns:
Number of CPUs in the system