public class DsDef extends Object implements DsTypes
For the complete explanation of all source definition parameters, see RRDTool's rrdcreate man page.
Modifier and Type | Field and Description |
---|---|
static String[] |
DS_TYPES
array of valid source types
|
(package private) static String |
FORCE_ZEROS_FOR_NANS_SUFFIX |
DT_ABSOLUTE, DT_COUNTER, DT_DERIVE, DT_GAUGE
Constructor and Description |
---|
DsDef(String dsName,
String dsType,
long heartbeat,
double minValue,
double maxValue)
Creates new data source definition object.
|
Modifier and Type | Method and Description |
---|---|
String |
dump()
Returns string representing source definition (RRDTool format).
|
boolean |
equals(Object obj)
Checks if two datasource definitions are equal.
|
(package private) boolean |
exactlyEqual(DsDef def) |
String |
getDsName()
Returns data source name.
|
String |
getDsType()
Returns source type.
|
long |
getHeartbeat()
Returns source heartbeat.
|
double |
getMaxValue()
Returns maximal calculated source value.
|
double |
getMinValue()
Returns minimal calculated source value.
|
int |
hashCode() |
static boolean |
isValidDsType(String dsType)
Checks if function argument represents valid source type.
|
String |
toString() |
public static final String[] DS_TYPES
static final String FORCE_ZEROS_FOR_NANS_SUFFIX
public DsDef(String dsName, String dsType, long heartbeat, double minValue, double maxValue) throws RrdException
addDatasource()
method of RrdDb
object.
For the complete explanation of all 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 values are "COUNTER", "GAUGE", "DERIVE"
and "ABSOLUTE" (these string constants are conveniently defined in the
DsTypes
class).heartbeat
- HearbeatminValue
- Minimal value. Use Double.NaN
if unknown.maxValue
- Maximal value. Use Double.NaN
if unknown.RrdException
- Thrown if any parameter has illegal value.public String getDsName()
public String getDsType()
public long getHeartbeat()
public double getMinValue()
public double getMaxValue()
public static boolean isValidDsType(String dsType)
dsType
- Source type to be checked.true
if dsType
is valid type,
false
otherwise.public String dump()
public boolean equals(Object obj)
boolean exactlyEqual(DsDef def)