org.jrobin.core

Class ArcDef

public class ArcDef extends Object implements ConsolFuns

Class to represent single archive definition within the RRD. Archive definition consists of the following four elements:

For the complete explanation of all archive definition parameters, see RRDTool's rrdcreate man page

Field Summary
static String[]CONSOL_FUNS
array of valid consolidation function names
Constructor Summary
ArcDef(String consolFun, double xff, int steps, int rows)

Creates new archive definition object.

Method Summary
Stringdump()
Returns string representing archive definition (RRDTool format).
booleanequals(Object obj)
Checks if two archive definitions are equal.
StringgetConsolFun()
Returns consolidation function.
intgetRows()
Returns the number of rows (aggregated values) stored in the archive.
intgetSteps()
Returns the number of primary RRD steps which complete a single archive step.
doublegetXff()
Returns the X-files factor.
static booleanisValidConsolFun(String consolFun)
Checks if function argument represents valid consolidation function name.

Field Detail

CONSOL_FUNS

public static final String[] CONSOL_FUNS
array of valid consolidation function names

Constructor Detail

ArcDef

public ArcDef(String consolFun, double xff, int steps, int rows)

Creates new archive definition object. This object should be passed as argument to addArchive() method of RrdDb object.

For the complete explanation of all archive definition parameters, see RRDTool's rrdcreate man page

Parameters: consolFun Consolidation function. Allowed values are "AVERAGE", "MIN", "MAX" and "LAST" (these string constants are conveniently defined in the ConsolFuns class). xff X-files factor, between 0 and 1. steps Number of archive steps. rows Number of archive rows.

Throws: RrdException Thrown if any parameter has illegal value.

Method Detail

dump

public String dump()
Returns string representing archive definition (RRDTool format).

Returns: String containing all archive definition parameters.

equals

public boolean equals(Object obj)
Checks if two archive definitions are equal. Archive definitions are considered equal if they have the same number of steps and the same consolidation function. It is not possible to create RRD with two equal archive definitions.

Parameters: obj Archive definition to compare with.

Returns: true if archive definitions are equal, false otherwise.

getConsolFun

public String getConsolFun()
Returns consolidation function.

Returns: Consolidation function.

getRows

public int getRows()
Returns the number of rows (aggregated values) stored in the archive.

Returns: Number of rows.

getSteps

public int getSteps()
Returns the number of primary RRD steps which complete a single archive step.

Returns: Number of steps.

getXff

public double getXff()
Returns the X-files factor.

Returns: X-files factor value.

isValidConsolFun

public static boolean isValidConsolFun(String consolFun)
Checks if function argument represents valid consolidation function name.

Parameters: consolFun Consolidation function to be checked

Returns: true if consolFun is valid consolidation function, false otherwise.