java.lang.Object | |
↳ | org.rrd4j.core.RrdDef |
Class to represent definition of new Round Robin Database (RRD).
Object of this class is used to create
new RRD from scratch - pass its reference as a RrdDb
constructor
argument (see documentation for RrdDb
class). RrdDef
object does not actually create new RRD. It just holds all necessary
information which will be used during the actual creation process
RRD definition (RrdDef object) consists of the following elements:
RrdDef provides API to set all these elements. For the complete explanation of all RRD definition parameters, see RRDTool's rrdcreate man page.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | DEFAULTVERSION | ||||||||||
long | DEFAULT_INITIAL_SHIFT | If not specified in constructor, starting timestamp will be set to the current timestamp plus DEFAULT_INITIAL_SHIFT seconds (-10). | |||||||||
long | DEFAULT_STEP | Default RRD step to be used if not specified in constructor (300 seconds). |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates new RRD definition object with the given path. | |||||||||||
Creates new RRD definition object with the given path and step.
| |||||||||||
Creates new RRD definition object with the given path, starting timestamp
and step.
| |||||||||||
Creates new RRD definition object with the given path, starting timestamp,
step and version.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds single archive definition by specifying its consolidation function, X-files factor,
number of steps and rows.
| |||||||||||
Adds archive definitions to RRD definition in bulk.
| |||||||||||
Adds single archive to RRD definition from a RRDTool-like
archive definition string.
| |||||||||||
Adds single archive definition represented with object of class
ArcDef . | |||||||||||
Adds single datasource definition represented with object of class
DsDef . | |||||||||||
Adds data source definitions to RRD definition in bulk.
| |||||||||||
Adds single datasource to RRD definition from a RRDTool-like
datasource definition string.
| |||||||||||
Adds single datasource to RRD definition by specifying its data source name, source type, heartbeat, minimal and maximal value. | |||||||||||
Returns string that represents all specified RRD creation parameters.
| |||||||||||
Compares the current RrdDef with another.
| |||||||||||
Exports RrdDef object to string in XML format.
| |||||||||||
Exports RrdDef object to a file in XML format.
| |||||||||||
Exports RrdDef object to output stream in XML format.
| |||||||||||
Returns number of defined archives.
| |||||||||||
Returns all archive definition objects specified so far.
| |||||||||||
Returns number of defined datasources.
| |||||||||||
Returns all data source definition objects specified so far.
| |||||||||||
Returns the number of storage bytes required to create RRD from this
RrdDef object.
| |||||||||||
Returns path for the new RR
| |||||||||||
Returns starting timestamp for the RRD that should be created.
| |||||||||||
Returns time step for the RRD that will be created.
| |||||||||||
Returns the RRD file version
| |||||||||||
Removes all RRA archive definitions.
| |||||||||||
Removes all datasource definitions.
| |||||||||||
Sets path to RRD.
| |||||||||||
Sets RRD's starting timestamp.
| |||||||||||
Sets RRD's starting timestamp.
| |||||||||||
Sets RRD's starting timestamp.
| |||||||||||
Sets RRD's time step.
| |||||||||||
Sets RRD's file version.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
If not specified in constructor, starting timestamp will be set to the current timestamp plus DEFAULT_INITIAL_SHIFT seconds (-10).
Default RRD step to be used if not specified in constructor (300 seconds).
Creates new RRD definition object with the given path.
When this object is passed to
RrdDb
constructor, new RRD will be created using the
specified path.
path | Path to new RRD. |
---|
Creates new RRD definition object with the given path and step.
path | Path to new RRD. |
---|---|
step | RRD step. |
Creates new RRD definition object with the given path, starting timestamp and step.
path | Path to new RRD. |
---|---|
startTime | RRD starting timestamp. |
step | RRD step. |
Creates new RRD definition object with the given path, starting timestamp, step and version.
path | Path to new RRD. |
---|---|
startTime | RRD starting timestamp. |
step | RRD step. |
version | RRD's file version. |
Adds single archive definition by specifying its consolidation function, X-files factor, number of steps and rows. For the complete explanation of all archive definition parameters see RRDTool's rrdcreate man page.
consolFun | Consolidation function. |
---|---|
xff | X-files factor. Valid values are between 0 and 1. |
steps | Number of archive steps |
rows | Number of archive rows |
IllegalArgumentException | Thrown if archive with the same consolidation function and the same number of steps is already added. |
---|
Adds archive definitions to RRD definition in bulk.
arcDefs | Array of archive definition objects |
---|
IllegalArgumentException | Thrown if RRD definition already contains archive with the same consolidation function and the same number of steps. |
---|
Adds single archive to RRD definition from a RRDTool-like archive definition string. The string must have five elements separated with colons (:) in the following order:
RRA:consolidationFunction:XFilesFactor:steps:rowsFor example:
RRA:AVERAGE:0.5:10:1000For more information on archive definition parameters see
rrdcreate
man page.rrdToolArcDef | Archive definition string with the syntax borrowed from RRDTool. |
---|
IllegalArgumentException | Thrown if invalid string is supplied. |
---|
Adds single archive definition represented with object of class ArcDef
.
arcDef | Archive definition. |
---|
IllegalArgumentException | Thrown if archive with the same consolidation function and the same number of steps is already added. |
---|
Adds single datasource definition represented with object of class DsDef
.
dsDef | Datasource definition. |
---|
Adds data source definitions to RRD definition in bulk.
dsDefs | Array of data source definition objects. |
---|
Adds single datasource to RRD definition from a RRDTool-like datasource definition string. The string must have six elements separated with colons (:) in the following order:
DS:name:type:heartbeat:minValue:maxValueFor example:
DS:input:COUNTER:600:0:UFor more information on datasource definition parameters see
rrdcreate
man page.rrdToolDsDef | Datasource definition string with the syntax borrowed from RRDTool. |
---|
IllegalArgumentException | Thrown if invalid string is supplied. |
---|
Adds single datasource to RRD definition by specifying its data source name, source type, heartbeat, minimal and maximal value. For the complete explanation of all data source definition parameters see RRDTool's rrdcreate man page.
IMPORTANT NOTE: If datasource name ends with '!', corresponding archives will never store NaNs as datasource values. In that case, NaN datasource values will be silently replaced with zeros by the framework.
dsName | Data source name. |
---|---|
dsType | Data source type. Valid types are "COUNTER",
"GAUGE", "DERIVE" and "ABSOLUTE" (these string constants are conveniently defined in
the DsType class). |
heartbeat | Data source heartbeat. |
minValue | Minimal acceptable value. Use Double.NaN if unknown. |
maxValue | Maximal acceptable value. Use Double.NaN if unknown. |
IllegalArgumentException | Thrown if new datasource definition uses already used data source name. |
---|
Returns string that represents all specified RRD creation parameters. Returned string
has the syntax of RRDTool's create
command.
RrdDb
object.
Compares the current RrdDef with another. RrdDefs are considered equal if:
obj | The second RrdDef object |
---|
Exports RrdDef object to string in XML format. Generated XML string can be parsed
with RrdDefTemplate
class.
Exports RrdDef object to a file in XML format. Generated XML code can be parsed
with RrdDefTemplate
class.
filePath | Path to the file |
---|
IOException |
---|
Exports RrdDef object to output stream in XML format. Generated XML code can be parsed
with RrdDefTemplate
class.
out | Output stream |
---|
Returns number of defined archives.
Returns all archive definition objects specified so far.
Returns number of defined datasources.
Returns all data source definition objects specified so far.
Returns the number of storage bytes required to create RRD from this RrdDef object.
Returns path for the new RR
Returns starting timestamp for the RRD that should be created.
Returns time step for the RRD that will be created.
Returns the RRD file version
Removes all RRA archive definitions.
Removes all datasource definitions.
Sets RRD's starting timestamp.
startTime | starting timestamp. |
---|
Sets RRD's time step.
step | RRD time step. |
---|
Sets RRD's file version.
version | the version to set |
---|