Package org.ow2.clif.probe.memory.linux
Class GenericProbe
- java.lang.Object
-
- org.ow2.clif.probe.memory.linux.GenericProbe
-
public class GenericProbe extends java.lang.ObjectLinux generic memory probe intended to be more impervious to /proc file format changes. Reads data from /proc/meminfo, supposed to be formatted as a list of "attribute: value [unit]" lines.- Author:
- Bruno Dillenseger
-
-
Constructor Summary
Constructors Constructor Description GenericProbe(java.lang.String[] fields)Creates a new memory probe that will return only the mentioned attributes' values, in the very same order.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long[]getData()Reads the system data source file for memory usage, and returns the values of attributes of interest.
-
-
-
Constructor Detail
-
GenericProbe
public GenericProbe(java.lang.String[] fields) throws java.lang.ExceptionCreates a new memory probe that will return only the mentioned attributes' values, in the very same order.- Parameters:
fields- names of attributes of interest.- Throws:
java.lang.Exception- an attribute name does not exist- See Also:
getData()
-
-
Method Detail
-
getData
public long[] getData() throws java.io.IOExceptionReads the system data source file for memory usage, and returns the values of attributes of interest.- Returns:
- values of memory attributes of interest, as specified at probe creation (in the same order).
- Throws:
java.io.IOException- for some reason, the system data source file could not be read, or more probably the file format is not compatible with this probe.- See Also:
GenericProbe(String[])
-
-