Package org.ow2.clif.probe.util
Class SolarisProbe
- java.lang.Object
-
- org.ow2.clif.probe.util.SolarisProbe
-
- All Implemented Interfaces:
java.lang.Runnable
public class SolarisProbe extends java.lang.Object implements java.lang.RunnableProbe for Solaris, designed to produce a variety of system usage measures as a single, background activity, and shared by CLIF probes of several kinds, namely cpu and memory as of current version. This probe is based on the following command lines to get measures:- "swap -s" to get the total amount of swap configured for the system
- "prtconf" to get the total RAM installed in the system
- "vmstat 1" to get RAM and swap usage every second.
- Author:
- Bruno Dillenseger
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description long[]getData()Gets the latest measures from the resource usage polling process.static SolarisProbegetSingleton()Gets the SolarisProbe singleton, creating a new one when the client counter is zero.voidrun()Resource usage polling activity.voidstop()Decreases the number of clients for this SolarisProbe, and stops the resource usage polling process when the client counter becomes zero.
-
-
-
Method Detail
-
getSingleton
public static SolarisProbe getSingleton() throws java.lang.Exception
Gets the SolarisProbe singleton, creating a new one when the client counter is zero.- Returns:
- the SolarisProbe singleton
- Throws:
java.lang.Exception- the singleton could not be created.- See Also:
clientCount,SolarisProbe()
-
getData
public long[] getData()
Gets the latest measures from the resource usage polling process.- Returns:
- an array of long with the following values (in this order):
- total memory kB
- free memory kB
- total swap kB
- free swap kB
- user cpu %
- sys cpu %
-
stop
public void stop() throws java.lang.InterruptedExceptionDecreases the number of clients for this SolarisProbe, and stops the resource usage polling process when the client counter becomes zero.- Throws:
java.lang.InterruptedException
-
run
public void run()
Resource usage polling activity. Reads the output of command "vmstat 1" until boolean "stopped" becomes true.- Specified by:
runin interfacejava.lang.Runnable- See Also:
getSingleton(),stop()
-
-