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 125 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 274 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 290 of file rrd_descriptions.cpp.
fawkes::RRDDefinition::RRDDefinition | ( | const RRDDefinition & | other | ) |
Copy constructor.
other | instance to clone |
Definition at line 303 of file rrd_descriptions.cpp.
fawkes::RRDDefinition::~RRDDefinition | ( | ) |
Destructor.
Definition at line 333 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 397 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 366 of file rrd_descriptions.cpp.
References fawkes::RRDArchive::AVERAGE, fawkes::RRDArchive::MAX, and fawkes::RRDArchive::MIN.
|
inline |
Get data sources.
Definition at line 152 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 156 of file rrd_descriptions.h.
|
inline |
Get file name.
Definition at line 160 of file rrd_descriptions.h.
Referenced by RRDThread::add_data(), RRDThread::add_rrd(), and fawkes::RRDGraphDataDefinition::to_string().
|
inline |
Get name.
Definition at line 145 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 150 of file rrd_descriptions.h.
Referenced by RRDThread::add_rrd().
|
inline |
Get RRD archives.
Definition at line 158 of file rrd_descriptions.h.
Referenced by RRDThread::add_rrd().
|
inline |
Get step size in sec.
Definition at line 147 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 316 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 413 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 429 of file rrd_descriptions.cpp.
Referenced by RRDThread::add_rrd().