rrdService.util
Class DataSource

java.lang.Object
  |
  +--rrdService.util.DataSource
All Implemented Interfaces:
java.io.Serializable

public class DataSource
extends java.lang.Object
implements java.io.Serializable

The class DataSource allows to modelize a data source.

Version:
1.0 date : 15/07/2001
key-word
RoundRobin
Author:
Damien Pellier
See Also:
RoundRobinArchive, LockRoundRobinDataBase LockRoundRobinLibrary, Serialized Form

Field Summary
static java.lang.String ABSOLUTE
          ABSOLUTE is for counters which get reset upon reading.
static java.lang.String COUNTER
          COUNTER is for continuous incrementing counters like the InOctets counter in a router.
private  java.lang.String dataSourceType
          Data Source Type.
static java.lang.String DERIVE
          DERIVE will store the derivative of the line going from the last to the current value of the data source.
private  java.lang.String dsName
          ds-Name is the name you will use to reference this particular data source from an RRD.
static java.lang.String GAUGE
          GAUCE is for things like temperatures or number of people in a room or value of a RedHat share
private  int heartbeat
          heartbeat defines the maximum number of seconds that may pass between two updates of this data source before the value of the data source is assumed to be *UNKNOWN*.
private  java.lang.String lastDataSource
          Last data source
private  double max
          max defining the expected max range of the data supplied by this data source.
private  double min
          min defining the expected min range of the data supplied by this data source.
private  int unknownSec
          Unknown second of this dataSource
private  double value
          value of this dataSource
 
Constructor Summary
DataSource()
          Default constructor of a DataSource
DataSource(java.lang.String dsName, java.lang.String dataSourceType, int heartbeat)
          Constructor of a DataSource
DataSource(java.lang.String dsName, java.lang.String dataSourceType, int heartbeat, double min, double max)
          Constructor of a DataSource
DataSource(java.lang.String dsName, java.lang.String dataSourceType, int heartbeat, double min, double max, java.lang.String lastDataSource, double value, int unknownSec)
          Constructor of a DataSource
 
Method Summary
 java.lang.String getDataSourceType()
          Returns the data source type of this data source.
 java.lang.String getDsName()
          Returns the data source name of this data source.
 int getHeartbeat()
          Returns the heartbeat of this data source.
 java.lang.String getLastDataSource()
          Return the lastDataSource in this data source
 double getMax()
          Returns the max range of this data source.
 double getMin()
          Returns the min range of this data source.
 int getUnknownSec()
          Return the unknownSec in this data source
 double getValue()
          Return the value in this data source
static boolean isValideDataSourceType(java.lang.String dataSourceType)
          isValideDataSourceType return true if the type of data source is valide
 void setDataSourceType(java.lang.String dataSourceType)
          Replaces the data source type in this data source
 void setDsName(java.lang.String dsName)
          Replaces the name in this data source
 void setHeartbeat(int heartbeat)
          Replaces the heartbeat in this data source
 void setLastDataSource(java.lang.String lastDataSource)
          Replaces the lastDataSource in this data source
 void setMax(double max)
          Replaces the max range in this data source
 void setMin(double min)
          Replaces the min range in this data source
 void setUnknownSec(int unknownSec)
          Replaces the unknownSec in this data source
 void setValue(double value)
          Replaces the value in this data source
 java.lang.String toString()
          toString return a string representation of this data source for the command line
 java.lang.String toStringAll()
          toStringAll return a string representation of this data source.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

ABSOLUTE

public static final java.lang.String ABSOLUTE
ABSOLUTE is for counters which get reset upon reading. This is used for fast counters which tend to overflow. So instead of reading them normally you reset them after every read to make sure you have a maximal time available before the next overflow. Another usage is for things you count like number of messages since the last update.

COUNTER

public static final java.lang.String COUNTER
COUNTER is for continuous incrementing counters like the InOctets counter in a router. The COUNTER data source assumes that the counter never decreases, except when a counter overflows. The update function takes the overflow into account. The counter is stored as a per-second rate. When the counter overflows, RRDtool checks if the overflow happened at the 32bit or 64bit border and acts accordingly by adding an appropriate value to the result.

dataSourceType

private java.lang.String dataSourceType
Data Source Type. The Datasource Type must be onw of the following: GAUGE, COUNTER, DERIVE, ABSOLUTE

DERIVE

public static final java.lang.String DERIVE
DERIVE will store the derivative of the line going from the last to the current value of the data source. This can be useful for gauges, for example, to measure the rate of people entering or leaving a room. Internally, derive works exaclty like COUNTER but without overflow checks. So if your counter does not reset at 32 or 64 bit you might want to use DERIVE and combine it with a MIN value of 0.

dsName

private java.lang.String dsName
ds-Name is the name you will use to reference this particular data source from an RRD. A ds-name must be 1 to 19 characters long in the characters [a-zA-Z0-9_].

GAUGE

public static final java.lang.String GAUGE
GAUCE is for things like temperatures or number of people in a room or value of a RedHat share

heartbeat

private int heartbeat
heartbeat defines the maximum number of seconds that may pass between two updates of this data source before the value of the data source is assumed to be *UNKNOWN*.

lastDataSource

private java.lang.String lastDataSource
Last data source

max

private double max
max defining the expected max range of the data supplied by this data source. *

min

private double min
min defining the expected min range of the data supplied by this data source.

unknownSec

private int unknownSec
Unknown second of this dataSource

value

private double value
value of this dataSource
Constructor Detail

DataSource

public DataSource()
           throws java.lang.Exception
Default constructor of a DataSource

DataSource

public DataSource(java.lang.String dsName,
                  java.lang.String dataSourceType,
                  int heartbeat)
           throws java.lang.Exception
Constructor of a DataSource
Parameters:
dsName - the name of the data source
dataSourceType - the type of the data source
heartBeat - the heartbeat of the data source

DataSource

public DataSource(java.lang.String dsName,
                  java.lang.String dataSourceType,
                  int heartbeat,
                  double min,
                  double max)
           throws java.lang.Exception
Constructor of a DataSource
Parameters:
dsName - the name of the data source
dataSourceType - the type of the data source
heartBeat - the heartbeat of the data source
min - the min rang of the data source
max - the max rang of the data source

DataSource

public DataSource(java.lang.String dsName,
                  java.lang.String dataSourceType,
                  int heartbeat,
                  double min,
                  double max,
                  java.lang.String lastDataSource,
                  double value,
                  int unknownSec)
           throws java.lang.Exception
Constructor of a DataSource
Parameters:
dsName - the name of the data source
dataSourceType - the type of the data source
heartBeat - the heartbeat of the data source
min - the min rang of the data source
max - the max rang of the data source
lastDataSource - the last data source of this data source
value - the value of this data source
unknownSec - the unknown second of this data source
Method Detail

getDataSourceType

public java.lang.String getDataSourceType()
Returns the data source type of this data source.

getDsName

public java.lang.String getDsName()
Returns the data source name of this data source.

getHeartbeat

public int getHeartbeat()
Returns the heartbeat of this data source.

getLastDataSource

public java.lang.String getLastDataSource()
Return the lastDataSource in this data source

getMax

public double getMax()
Returns the max range of this data source.

getMin

public double getMin()
Returns the min range of this data source.

getUnknownSec

public int getUnknownSec()
Return the unknownSec in this data source

getValue

public double getValue()
Return the value in this data source

isValideDataSourceType

public static boolean isValideDataSourceType(java.lang.String dataSourceType)
isValideDataSourceType return true if the type of data source is valide

setDataSourceType

public void setDataSourceType(java.lang.String dataSourceType)
                       throws java.lang.Exception
Replaces the data source type in this data source
Parameters:
dataSourceType - the data source type in this data source to set

setDsName

public void setDsName(java.lang.String dsName)
Replaces the name in this data source
Parameters:
dsName - the name in this data source to set

setHeartbeat

public void setHeartbeat(int heartbeat)
Replaces the heartbeat in this data source
Parameters:
heartbeat - the heartbeat in this data source to set

setLastDataSource

public void setLastDataSource(java.lang.String lastDataSource)
Replaces the lastDataSource in this data source
Parameters:
lastDataSource - the last data source in this data source to set

setMax

public void setMax(double max)
Replaces the max range in this data source
Parameters:
max - the max range in this data source to set

setMin

public void setMin(double min)
Replaces the min range in this data source
Parameters:
min - the min range in this data source to set

setUnknownSec

public void setUnknownSec(int unknownSec)
Replaces the unknownSec in this data source
Parameters:
unknownSec - the unknownSec in this data source to set

setValue

public void setValue(double value)
Replaces the value in this data source
Parameters:
value - the value in this data source to set

toString

public java.lang.String toString()
toString return a string representation of this data source for the command line
Overrides:
toString in class java.lang.Object

toStringAll

public java.lang.String toStringAll()
toStringAll return a string representation of this data source.

Copyright 1885-2001 FIRMENICH SA, Geneva

Submit a bug or feature
Copyright 1885-2001 FIRMENICH SA, Geneva,
All Rights Reserved.