Fawkes API
Fawkes Development Version
|
#include <>>
Public Member Functions | |
RRDDefinition (const char *name, std::vector< RRDDataSource > &ds, unsigned int step_sec=10, bool recreate=false) | |
Constructor with default RRAs. More... | |
RRDDefinition (const char *name, std::vector< RRDDataSource > &ds, std::vector< RRDArchive > &rra, unsigned int step_sec=10, bool recreate=false) | |
Constructor. More... | |
RRDDefinition (const RRDDefinition &other) | |
Copy constructor. More... | |
~RRDDefinition () | |
Destructor. More... | |
RRDDefinition & | operator= (const RRDDefinition &other) |
Assignment operator. More... | |
size_t | find_ds_index (const char *ds_name) const |
Find data source index. More... | |
void | set_filename (const char *filename) |
Set filename. More... | |
const char * | get_name () const |
Get name. More... | |
unsigned int | get_step_sec () const |
Get step size in sec. More... | |
bool | get_recreate () const |
Check recreation flag. More... | |
const std::vector< RRDDataSource > & | get_ds () const |
Get data sources. More... | |
const RRDDataSource & | get_ds (size_t i) const |
Get specific data source. More... | |
const std::vector< RRDArchive > & | get_rra () const |
Get RRD archives. More... | |
const char * | get_filename () const |
Get file name. More... | |
void | set_rrd_manager (RRDManager *rrd_manager) |
Set RRD manager. More... | |
Static Public Member Functions | |
static const std::vector< RRDArchive > | get_default_rra () |
Get default RRAs. More... | |
RRD Definition. This class describes everything required to create an RRD file. It does not represent all the options rrdtool provides, but a reasonable subset.
Definition at line 166 of file rrd_descriptions.h.
fawkes::RRDDefinition::RRDDefinition | ( | const char * | name, |
std::vector< RRDDataSource > & | ds, | ||
unsigned int | step_sec = 10 , |
||
bool | recreate = false |
||
) |
Constructor with default RRAs.
This creates the RRD definition with the default RRAs produced by get_default_rra().
name | RRD name |
ds | data sources |
step_sec | Specifies the base interval in seconds with which data will be fed into the RRD. |
recreate | if true existing RRD files will be overwritten, otherwise data is appended. |
Definition at line 292 of file rrd_descriptions.cpp.
fawkes::RRDDefinition::RRDDefinition | ( | const char * | name, |
std::vector< RRDDataSource > & | ds, | ||
std::vector< RRDArchive > & | rra, | ||
unsigned int | step_sec = 10 , |
||
bool | recreate = false |
||
) |
Constructor.
name | RRD name |
ds | data sources |
rra | RRAs for this RRD. |
step_sec | Specifies the base interval in seconds with which data will be fed into the RRD. |
recreate | if true existing RRD files will be overwritten, otherwise data is appended. |
Definition at line 315 of file rrd_descriptions.cpp.
fawkes::RRDDefinition::RRDDefinition | ( | const RRDDefinition & | other | ) |
Copy constructor.
other | instance to clone |
Definition at line 333 of file rrd_descriptions.cpp.
fawkes::RRDDefinition::~RRDDefinition | ( | ) |
Destructor.
Definition at line 370 of file rrd_descriptions.cpp.
size_t fawkes::RRDDefinition::find_ds_index | ( | const char * | ds_name | ) | const |
Find data source index.
ds_name | name of the data source |
Exception | thrown if the data source could not be found |
Definition at line 436 of file rrd_descriptions.cpp.
|
static |
Get default RRAs.
They correspond to the following and assume a 10 second step size.
Definition at line 406 of file rrd_descriptions.cpp.
|
inline |
Get data sources.
Definition at line 208 of file rrd_descriptions.h.
Referenced by RRDThread::add_rrd().
|
inline |
Get specific data source.
i | index of data source |
Definition at line 216 of file rrd_descriptions.h.
|
inline |
Get file name.
Definition at line 228 of file rrd_descriptions.h.
Referenced by RRDThread::add_data(), and RRDThread::add_rrd().
|
inline |
Get name.
Definition at line 189 of file rrd_descriptions.h.
Referenced by RRDThread::add_data(), RRDThread::add_rrd(), RRDExampleThread::loop(), and RRDThread::remove_rrd().
|
inline |
Check recreation flag.
Definition at line 202 of file rrd_descriptions.h.
Referenced by RRDThread::add_rrd().
|
inline |
Get RRD archives.
Definition at line 222 of file rrd_descriptions.h.
Referenced by RRDThread::add_rrd().
|
inline |
Get step size in sec.
Definition at line 195 of file rrd_descriptions.h.
Referenced by RRDThread::add_rrd().
RRDDefinition & fawkes::RRDDefinition::operator= | ( | const RRDDefinition & | other | ) |
Assignment operator.
other | other instance to copy from |
Definition at line 349 of file rrd_descriptions.cpp.
void fawkes::RRDDefinition::set_filename | ( | const char * | filename | ) |
Set filename.
This can be done only once. Do not do this manually, rather let the RRDManager handle this!
filename | new filename, should be absolute, otherwise considered relative to current working directory. |
Definition at line 453 of file rrd_descriptions.cpp.
Referenced by RRDThread::add_rrd().
void fawkes::RRDDefinition::set_rrd_manager | ( | RRDManager * | rrd_manager | ) |
Set RRD manager.
This can be done only once. Do not do this manually, rather let the RRDManager handle this! The RRD manager is used to unregister this RRD if it is deleted. This is a precaution to avoid dangling RRDs.
rrd_manager | RRD manager to use |
Definition at line 468 of file rrd_descriptions.cpp.
Referenced by RRDThread::add_rrd().