|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.web.response.RRDInfo
A data structure encapsulating information about a single round robin database (RRD).
This class holds all the data from the rrdtool info
command in
a single, object-oriented data structure/JavaBean. To create an instance of
this object, call the static createRRDInfo
method with
the output from an rrdtool info
command.
This data usually looks something like:
filename = "129.1.1.208-localhost.rrd" rrd_version = "0001" step = 300 last_update = 982079322 ds[EXPANSION_COUNTER_1].type = "COUNTER" ds[EXPANSION_COUNTER_1].minimal_heartbeat = 600 ds[EXPANSION_COUNTER_1].min = NaN ds[EXPANSION_COUNTER_1].max = NaN ds[EXPANSION_COUNTER_1].last_ds = "U" ds[EXPANSION_COUNTER_1].value = 0.0000000000e+00 ds[EXPANSION_COUNTER_1].unknown_sec = 222but with many more ds (data source) lines and several rra (round robin archive) lines.
This class stores the general (filename, rrd version, etc) attributes and the data source attributes in an object-oriented way, but the RRA information is stored only in the raw values properties object. This class could very simply be extended, however, to include the RRA information as well.
Nested Class Summary | |
static class |
RRDInfo.DataSource
Internal class to store information about a single RRD data source, which is similar to a column in a relational database. |
Field Summary | |
protected RRDInfo.DataSource[] |
dataSources
The array of data sources (similar to relational database columns). |
protected java.util.Map |
dataSourcesMap
A mapping of data source names to DataSource instances. |
protected java.lang.String |
filename
The filname of the round robin database (RRD). |
protected java.util.Date |
lastUpdate
The last time this RRD file was updated. |
protected java.util.Properties |
rawValues
The lines from the RRD info string as name-value pairs. |
protected java.lang.String |
rrdVersion
The version of rrdtool that created the round robin
database. |
protected int |
step
The elapsed time in seconds that the RRD expects a new update. |
Constructor Summary | |
RRDInfo()
|
Method Summary | |
static RRDInfo |
createRRDInfo(int nodeId,
java.lang.String infoString)
Parses the output from a rrdtool info command to create
the RRDInfo data structure. |
RRDInfo.DataSource |
getDataSource(java.lang.String ds)
|
RRDInfo.DataSource[] |
getDataSources()
|
java.lang.String |
getFilename()
|
java.util.Date |
getLastUpdate()
|
long |
getLastUpdateLong()
Deprecated. Use getLastUpdate().getTime() instead. |
java.lang.String |
getRawValue(java.lang.String property)
|
java.util.Properties |
getRawValues()
|
java.lang.String |
getRRDVersion()
|
int |
getStep()
|
protected static double |
parseDouble(java.lang.String s)
Convenience method that parses a double or returns a NaN (not a number) double value if the string cannot
be parsed to a double. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.String filename
protected java.lang.String rrdVersion
rrdtool
that created the round robin
database.
protected int step
protected java.util.Date lastUpdate
protected java.util.Properties rawValues
protected RRDInfo.DataSource[] dataSources
protected java.util.Map dataSourcesMap
DataSource
instances.
Constructor Detail |
public RRDInfo()
Method Detail |
public java.lang.String getFilename()
public java.lang.String getRRDVersion()
public int getStep()
public long getLastUpdateLong()
public java.util.Date getLastUpdate()
public RRDInfo.DataSource[] getDataSources()
public RRDInfo.DataSource getDataSource(java.lang.String ds)
public java.lang.String getRawValue(java.lang.String property)
public java.util.Properties getRawValues()
public static RRDInfo createRRDInfo(int nodeId, java.lang.String infoString)
rrdtool info
command to create
the RRDInfo
data structure.
RRDInfo
object that encapsulates the data given
in the infoString
parameter. If the
infoString
parameter does not contain a parseable
info string, this method will return null.protected static double parseDouble(java.lang.String s)
NaN
(not a number) double value if the string cannot
be parsed to a double.
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |