java.lang.Object
org.rrd4j.core.DsDef
Class to represent single data source definition within the RRD. Datasource definition consists of the following five elements:
- data source name
- data source type
- heartbeat
- minimal value
- maximal value
For the complete explanation of all source definition parameters, see the rrdcreate man page.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringName of the data source.private final DsTypeHow the source's values are interpreted.(package private) static final StringForce zeros for NaNs suffixprivate final longLongest gap between updates before the source is unknown, in seconds.private final doubleRange of accepted values, NaN for unbounded.private final doubleRange of accepted values, NaN for unbounded.Constructor Summary
Method Summary
Public MethodsModifier and TypeMethodDescriptiondump()Returns string representing source definition (RRDTool format).boolean(package private) booleanexactlyEqual(DsDef def) Checks if this DsDef is exactly equal to another, including all fields.Returns data source name.Returns source type.longReturns source heartbeat.doubleReturns maximal calculated source value.doubleReturns minimal calculated source value.inthashCode()Hashes the data source name alone, matchingequals(Object).
Field Details
FORCE_ZEROS_FOR_NANS_SUFFIX
Force zeros for NaNs suffix- See Also:
dsName
Name of the data source.dsType
How the source's values are interpreted.heartbeat
private final long heartbeatLongest gap between updates before the source is unknown, in seconds.minValue
private final double minValueRange of accepted values, NaN for unbounded.maxValue
private final double maxValueRange of accepted values, NaN for unbounded.
Constructor Details
DsDef
Creates new data source definition object. This object should be passed as argument toaddDatasource()method ofRrdDbobject.For the complete explanation of all source definition parameters, see the 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.
- Parameters:
dsName- Data source name.dsType- Data source type. Valid values are "COUNTER", "GAUGE", "DERIVE" and "ABSOLUTE" (these string constants are conveniently defined in theDsTypeclass).heartbeat- seconds between writes of unknown or NaN valuesminValue- Minimal value. UseDouble.NaNif unknown.maxValue- Maximal value. UseDouble.NaNif unknown.
Method Details
getDsName
getDsType
Returns source type.- Returns:
- Source type ("COUNTER", "GAUGE", "DERIVE" or "ABSOLUTE").
getHeartbeat
public long getHeartbeat()Returns source heartbeat.- Returns:
- Source heartbeat in seconds.
getMinValue
public double getMinValue()Returns minimal calculated source value.- Returns:
- Minimal value.
getMaxValue
public double getMaxValue()Returns maximal calculated source value.- Returns:
- Maximal value.
dump
Returns string representing source definition (RRDTool format).- Returns:
- String containing all data source definition parameters.
equals
hashCode
public int hashCode()Hashes the data source name alone, matchingequals(Object).exactlyEqual
Checks if this DsDef is exactly equal to another, including all fields.- Parameters:
def- the other DsDef to compare- Returns:
- true if all fields match