Fawkes API  Fawkes Development Version
fawkes::RRDDataSource Class Reference

Class to represent a RRD data source. More...

#include <>>

List of all members.

Public Types

enum  Type {
  GAUGE, COUNTER, DERIVE, ABSOLUTE,
  COMPUTE
}
 Data source type. More...

Public Member Functions

 RRDDataSource (const char *name, Type type, unsigned int heartbeat=30, float min=0, float max=UNKNOWN)
 Constructor for regular data source.
 RRDDataSource (const char *name, const char *rpn_expression)
 Constructor for expression RRDs.
 RRDDataSource (const RRDDataSource &other)
 Copy constructor.
 ~RRDDataSource ()
 Destructor.
RRDDataSourceoperator= (const RRDDataSource &other)
 Assignment operator.
const char * to_string () const
 Get string reprensetation.
const char * get_name () const
 Get name.
Type get_type () const
 Get type.
unsigned int get_heartbeat () const
 Get heartbeat.
float get_min () const
 Get minimum.
float get_max () const
 Get maximum.
const char * get_rpn_expression () const
 Get RPN expression.

Static Public Attributes

static const float UNKNOWN = FLT_MIN
 Use for unknown min or max values.

Detailed Description

Class to represent a RRD data source.

Author:
Tim Niemueller

Member Enumeration Documentation

Data source type.

Enumerator:
GAUGE 

Gauge value.

COUNTER 

Counter value.

DERIVE 

Derived value.

ABSOLUTE 

Absolute value.

COMPUTE 

Computed value.

Definition at line 41 of file rrd_descriptions.h.


Constructor & Destructor Documentation

fawkes::RRDDataSource::RRDDataSource ( const char *  name,
Type  type,
unsigned int  heartbeat = 30,
float  min = 0,
float  max = UNKNOWN 
)

Constructor for regular data source.

Parameters:
namename of the data source
typetype of the data source, may not be COMPUTE.
heartbeatNumber of seconds after which a new value must be received before the value is considered to be unknown.
minminimum value, use UNKNOWN constant if not known
maxmaximum value, use UNKNOWN constant if not known

Definition at line 56 of file rrd_descriptions.cpp.

References COMPUTE.

fawkes::RRDDataSource::RRDDataSource ( const char *  name,
const char *  rpn_expression 
)

Constructor for expression RRDs.

Parameters:
namename of the data source
rpn_expressionRPN expression

Definition at line 72 of file rrd_descriptions.cpp.

fawkes::RRDDataSource::RRDDataSource ( const RRDDataSource other)

Copy constructor.

Parameters:
otherother instance to copy

Definition at line 81 of file rrd_descriptions.cpp.

fawkes::RRDDataSource::~RRDDataSource ( )

Destructor.

Definition at line 91 of file rrd_descriptions.cpp.


Member Function Documentation

unsigned int fawkes::RRDDataSource::get_heartbeat ( ) const [inline]

Get heartbeat.

Returns:
heartbeat

Definition at line 66 of file rrd_descriptions.h.

float fawkes::RRDDataSource::get_max ( ) const [inline]

Get maximum.

Returns:
maximum

Definition at line 70 of file rrd_descriptions.h.

float fawkes::RRDDataSource::get_min ( ) const [inline]

Get minimum.

Returns:
minimum

Definition at line 68 of file rrd_descriptions.h.

const char* fawkes::RRDDataSource::get_name ( void  ) const [inline]

Get name.

Returns:
name

Definition at line 62 of file rrd_descriptions.h.

const char* fawkes::RRDDataSource::get_rpn_expression ( ) const [inline]

Get RPN expression.

Returns:
RPN expression

Definition at line 72 of file rrd_descriptions.h.

Type fawkes::RRDDataSource::get_type ( ) const [inline]

Get type.

Returns:
type

Definition at line 64 of file rrd_descriptions.h.

RRDDataSource & fawkes::RRDDataSource::operator= ( const RRDDataSource other)

Assignment operator.

Parameters:
otherInstance to copy data from.
Returns:
reference to this instance

Definition at line 103 of file rrd_descriptions.cpp.

const char * fawkes::RRDDataSource::to_string ( ) const

Get string reprensetation.

Returns:
string representation suitable to be bassed to rrd_create().

Definition at line 125 of file rrd_descriptions.cpp.

References COMPUTE, COUNTER, DERIVE, ABSOLUTE, and UNKNOWN.


Member Data Documentation

const float fawkes::RRDDataSource::UNKNOWN = FLT_MIN [static]

Use for unknown min or max values.

Definition at line 49 of file rrd_descriptions.h.

Referenced by to_string().


The documentation for this class was generated from the following files: