Fawkes API Fawkes Development Version
|
RRD Definition. More...
#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 162 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 288 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 311 of file rrd_descriptions.cpp.
fawkes::RRDDefinition::RRDDefinition | ( | const RRDDefinition & | other | ) |
Copy constructor.
other | instance to clone |
Definition at line 329 of file rrd_descriptions.cpp.
fawkes::RRDDefinition::~RRDDefinition | ( | ) |
Destructor.
Definition at line 366 of file rrd_descriptions.cpp.
References fawkes::RRDManager::remove_rrd().
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 432 of file rrd_descriptions.cpp.
References get_name().
Referenced by fawkes::RRDGraphDataDefinition::to_string().
|
static |
Get default RRAs.
They correspond to the following and assume a 10 second step size.
Definition at line 402 of file rrd_descriptions.cpp.
References fawkes::RRDArchive::AVERAGE, fawkes::RRDArchive::MAX, and fawkes::RRDArchive::MIN.
|
inline |
Get data sources.
Definition at line 204 of file rrd_descriptions.h.
Referenced by RRDThread::add_rrd(), and fawkes::RRDGraphDataDefinition::to_string().
|
inline |
Get specific data source.
i | index of data source |
Definition at line 212 of file rrd_descriptions.h.
|
inline |
Get file name.
Definition at line 224 of file rrd_descriptions.h.
Referenced by RRDThread::add_data(), RRDThread::add_rrd(), and fawkes::RRDGraphDataDefinition::to_string().
|
inline |
Get name.
Definition at line 185 of file rrd_descriptions.h.
Referenced by RRDThread::add_data(), RRDThread::add_rrd(), find_ds_index(), RRDExampleThread::loop(), RRDThread::remove_rrd(), and fawkes::RRDGraphDefinition::set_filename().
|
inline |
Check recreation flag.
Definition at line 198 of file rrd_descriptions.h.
Referenced by RRDThread::add_rrd().
|
inline |
Get RRD archives.
Definition at line 218 of file rrd_descriptions.h.
Referenced by RRDThread::add_rrd().
|
inline |
Get step size in sec.
Definition at line 191 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 345 of file rrd_descriptions.cpp.
References fawkes::RRDManager::remove_rrd().
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 449 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 464 of file rrd_descriptions.cpp.
Referenced by RRDThread::add_rrd().