Fawkes API  Fawkes Development Version
fawkes::RRDDataSource Class Reference

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

#include <>>

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. More...
 
 RRDDataSource (const char *name, const char *rpn_expression)
 Constructor for expression RRDs. More...
 
 RRDDataSource (const RRDDataSource &other)
 Copy constructor. More...
 
 ~RRDDataSource ()
 Destructor. More...
 
RRDDataSourceoperator= (const RRDDataSource &other)
 Assignment operator. More...
 
const char * to_string () const
 Get string reprensetation. More...
 
const char * get_name () const
 Get name. More...
 
Type get_type () const
 Get type. More...
 
unsigned int get_heartbeat () const
 Get heartbeat. More...
 
float get_min () const
 Get minimum. More...
 
float get_max () const
 Get maximum. More...
 
const char * get_rpn_expression () const
 Get RPN expression. More...
 

Static Public Attributes

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

Detailed Description

Class to represent a RRD data source.

Author
Tim Niemueller

Definition at line 37 of file rrd_descriptions.h.

Member Enumeration Documentation

◆ Type

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

◆ RRDDataSource() [1/3]

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.

◆ RRDDataSource() [2/3]

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.

◆ RRDDataSource() [3/3]

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

Copy constructor.

Parameters
otherother instance to copy

Definition at line 81 of file rrd_descriptions.cpp.

◆ ~RRDDataSource()

fawkes::RRDDataSource::~RRDDataSource ( )

Destructor.

Definition at line 91 of file rrd_descriptions.cpp.

Member Function Documentation

◆ get_heartbeat()

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

Get heartbeat.

Returns
heartbeat

Definition at line 66 of file rrd_descriptions.h.

◆ get_max()

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

Get maximum.

Returns
maximum

Definition at line 70 of file rrd_descriptions.h.

◆ get_min()

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

Get minimum.

Returns
minimum

Definition at line 68 of file rrd_descriptions.h.

◆ get_name()

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

Get name.

Returns
name

Definition at line 62 of file rrd_descriptions.h.

◆ get_rpn_expression()

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

Get RPN expression.

Returns
RPN expression

Definition at line 72 of file rrd_descriptions.h.

◆ get_type()

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

Get type.

Returns
type

Definition at line 64 of file rrd_descriptions.h.

◆ operator=()

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.

Referenced by fawkes::RRDGraphLine::clone(), and fawkes::RRDGraphArea::clone().

◆ to_string()

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 ABSOLUTE, COMPUTE, COUNTER, DERIVE, and UNKNOWN.

Referenced by fawkes::RRDGraphGPrint::clone(), fawkes::RRDGraphLine::clone(), and fawkes::RRDGraphArea::clone().

Member Data Documentation

◆ UNKNOWN

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: