Fawkes API  Fawkes Development Version
rrd_descriptions.h
1 
2 /***************************************************************************
3  * rrd_descriptions.h - Fawkes RRD descriptions
4  *
5  * Created: Sat Dec 18 02:19:03 2010
6  * Copyright 2006-2011 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef _PLUGINS_RRD_ASPECT_RRD_DESCRIPTIONS_H_
25 #define _PLUGINS_RRD_ASPECT_RRD_DESCRIPTIONS_H_
26 
27 #include <ctime>
28 #include <vector>
29 
30 namespace fawkes {
31 
32 class RRDManager;
33 
34 class RRDDataSource
35 {
36 public:
37  /** Data source type. */
38  typedef enum {
39  GAUGE, /**< Gauge value. */
40  COUNTER, /**< Counter value. */
41  DERIVE, /**< Derived value. */
42  ABSOLUTE, /**< Absolute value. */
43  COMPUTE /**< Computed value. */
44  } Type;
45 
46  static const float UNKNOWN;
47 
48  RRDDataSource(const char * name,
49  Type type,
50  unsigned int heartbeat = 30,
51  float min = 0,
52  float max = UNKNOWN);
53  RRDDataSource(const char *name, const char *rpn_expression);
54  RRDDataSource(const RRDDataSource &other);
56  RRDDataSource &operator=(const RRDDataSource &other);
57 
58  const char *to_string() const;
59 
60  /** Get name. @return name */
61  const char *
62  get_name() const
63  {
64  return name_;
65  };
66  /** Get type. @return type */
67  Type
68  get_type() const
69  {
70  return type_;
71  };
72  /** Get heartbeat. @return heartbeat */
73  unsigned int
74  get_heartbeat() const
75  {
76  return heartbeat_;
77  };
78  /** Get minimum. @return minimum */
79  float
80  get_min() const
81  {
82  return min_;
83  };
84  /** Get maximum. @return maximum */
85  float
86  get_max() const
87  {
88  return max_;
89  };
90  /** Get RPN expression. @return RPN expression */
91  const char *
93  {
94  return rpn_expression_;
95  };
96 
97 private:
98  char * name_;
99  Type type_;
100  unsigned int heartbeat_;
101  float min_;
102  float max_;
103  char * rpn_expression_;
104 
105  mutable char *string_;
106 };
107 
108 class RRDArchive
109 {
110 public:
111  /** Consolidation function type. */
112  typedef enum {
113  AVERAGE, /**< Averaging consolidation function. */
114  MIN, /**< Minimum consolidation function. */
115  MAX, /**< Maximum consolidation function. */
116  LAST /**< Last value consolidation function. */
118 
119  RRDArchive(ConsolidationFunction cf, float xff, unsigned int steps, unsigned int rows);
120  RRDArchive(const RRDArchive &rra);
122 
123  const char * to_string() const;
124  static const char *cf_to_string(ConsolidationFunction cf);
125 
126  RRDArchive &operator=(const RRDArchive &rra);
127 
128  /** Get consolidation function type. @return consolidation function type */
130  get_cf() const
131  {
132  return cf_;
133  }
134  /** Get xfiles factor. @return xfiles factor */
135  float
136  get_xff() const
137  {
138  return xff_;
139  }
140  /** Get number of steps. @return number of steps */
141  unsigned int
142  get_steps() const
143  {
144  return steps_;
145  }
146  /** Get number of rows. @return number of rows */
147  unsigned int
148  get_rows() const
149  {
150  return rows_;
151  }
152 
153 private:
155  float xff_;
156  unsigned int steps_;
157  unsigned int rows_;
158 
159  mutable char *string_;
160 };
161 
162 class RRDDefinition
163 {
164 public:
165  RRDDefinition(const char * name,
166  std::vector<RRDDataSource> &ds,
167  unsigned int step_sec = 10,
168  bool recreate = false);
169 
170  RRDDefinition(const char * name,
171  std::vector<RRDDataSource> &ds,
172  std::vector<RRDArchive> & rra,
173  unsigned int step_sec = 10,
174  bool recreate = false);
175  RRDDefinition(const RRDDefinition &other);
176  ~RRDDefinition();
177  RRDDefinition &operator=(const RRDDefinition &other);
178 
179  size_t find_ds_index(const char *ds_name) const;
180  void set_filename(const char *filename);
181  static const std::vector<RRDArchive> get_default_rra();
182 
183  /** Get name. @return name */
184  const char *
185  get_name() const
186  {
187  return name_;
188  }
189  /** Get step size in sec. @return step size */
190  unsigned int
191  get_step_sec() const
192  {
193  return step_sec_;
194  }
195  /** Check recreation flag.
196  * @return true if files should be overwritte, false otherwise */
197  bool
198  get_recreate() const
199  {
200  return recreate_;
201  }
202  /** Get data sources. * @return data sources */
203  const std::vector<RRDDataSource> &
204  get_ds() const
205  {
206  return ds_;
207  }
208  /** Get specific data source.
209  * @param i index of data source
210  * @return data source */
211  const RRDDataSource &
212  get_ds(size_t i) const
213  {
214  return ds_[i];
215  }
216  /** Get RRD archives. @return RRD archive */
217  const std::vector<RRDArchive> &
218  get_rra() const
219  {
220  return rra_;
221  }
222  /** Get file name. @return file name */
223  const char *
224  get_filename() const
225  {
226  return filename_;
227  }
228 
229  void set_rrd_manager(RRDManager *rrd_manager);
230 
231 private:
232  char * name_;
233  unsigned int step_sec_;
234  bool recreate_;
235  std::vector<RRDDataSource> ds_;
236  std::vector<RRDArchive> rra_;
237  char * filename_;
238 
239  RRDManager *rrd_manager_;
240 };
241 
243 {
244 public:
245  RRDGraphDataDefinition(const char * name,
247  const RRDDefinition * rrd_def,
248  const char * ds_name = NULL);
249  RRDGraphDataDefinition(const char *name, const char *rpn_expression);
253 
254  const char *to_string() const;
255 
256  /** Get name. @return name */
257  const char *
258  get_name() const
259  {
260  return name_;
261  };
262  /** Get RRD definition. @return RRD definition */
263  const RRDDefinition *
264  get_rrd_def() const
265  {
266  return rrd_def_;
267  };
268  /** Get data source name. @return data source name */
269  const char *
270  get_ds_name() const
271  {
272  return ds_name_;
273  };
274  /** Get RPN expression. @return RPN expression */
275  const char *
277  {
278  return rpn_expression_;
279  };
280  /** Get consolidation function type. @return consolidation function type */
282  get_cf() const
283  {
284  return cf_;
285  };
286 
287 private:
288  char * name_;
289  const RRDDefinition * rrd_def_;
290  char * ds_name_;
291  char * rpn_expression_;
293 
294  mutable char *string_;
295 };
296 
297 class RRDGraphElement
298 {
299 public:
300  virtual ~RRDGraphElement()
301  {
302  }
303  virtual RRDGraphElement *clone() const = 0;
304  virtual const char * to_string() const;
305 };
306 
307 class RRDGraphGPrint : public RRDGraphElement
308 {
309 public:
310  RRDGraphGPrint(const char *def_name, RRDArchive::ConsolidationFunction cf, const char *format);
311  RRDGraphGPrint(const RRDGraphGPrint &other);
312  virtual ~RRDGraphGPrint();
313 
315 
316  virtual RRDGraphElement *
317  clone() const
318  {
319  return new RRDGraphGPrint(*this);
320  }
321 
322  virtual const char *to_string() const;
323 
324  /** Get definition name. @return definition name */
325  const char *
326  get_def_name() const
327  {
328  return def_name_;
329  }
330  /** Get consolidation function type. @return consolidation function type */
332  get_cf() const
333  {
334  return cf_;
335  }
336  /** Get format string. @return format string */
337  const char *
338  get_format() const
339  {
340  return format_;
341  }
342 
343 private:
344  char * def_name_;
346  char * format_;
347 
348  mutable char *string_;
349 };
350 
351 class RRDGraphLine : public RRDGraphElement
352 {
353 public:
354  RRDGraphLine(const char *def_name,
355  float width,
356  const char *color,
357  const char *legend,
358  bool stacked = false);
359  RRDGraphLine(const RRDGraphLine &other);
360  virtual ~RRDGraphLine();
361 
362  virtual RRDGraphElement *
363  clone() const
364  {
365  return new RRDGraphLine(*this);
366  }
367 
369 
370  virtual const char *to_string() const;
371 
372  /** Get definition name. @return definition name */
373  const char *
374  get_def_name() const
375  {
376  return def_name_;
377  }
378  /** Get line width. @return line width */
379  float
380  get_width() const
381  {
382  return width_;
383  }
384  /** Get color string. @return color string */
385  const char *
386  get_color() const
387  {
388  return color_;
389  }
390  /** Get legend label. @return legend label */
391  const char *
392  get_legend() const
393  {
394  return legend_;
395  }
396  /** Get stacked flag. @return true if line should be stacked, false otherwise. */
397  bool
398  get_stacked() const
399  {
400  return stacked_;
401  }
402 
403 private:
404  char *def_name_;
405  float width_;
406  char *color_;
407  char *legend_;
408  bool stacked_;
409 
410  mutable char *string_;
411 };
412 
413 class RRDGraphArea : public RRDGraphElement
414 {
415 public:
416  RRDGraphArea(const char *def_name, const char *color, const char *legend, bool stacked = false);
417  RRDGraphArea(const RRDGraphArea &other);
418  virtual ~RRDGraphArea();
419 
420  virtual RRDGraphElement *
421  clone() const
422  {
423  return new RRDGraphArea(*this);
424  }
425 
427 
428  virtual const char *to_string() const;
429 
430  /** Get definition name. @return definition name */
431  const char *
432  get_def_name() const
433  {
434  return def_name_;
435  }
436  /** Get color string. @return color string */
437  const char *
438  get_color() const
439  {
440  return color_;
441  }
442  /** Get legend label. @return legend label */
443  const char *
444  get_legend() const
445  {
446  return legend_;
447  }
448  /** Get stacked flag. @return true if line should be stacked, false otherwise. */
449  bool
450  get_stacked() const
451  {
452  return stacked_;
453  }
454 
455 private:
456  char *def_name_;
457  char *color_;
458  char *legend_;
459  bool stacked_;
460 
461  mutable char *string_;
462 };
463 
464 class RRDGraphDefinition
465 {
466 public:
467  RRDGraphDefinition(const char * name,
468  RRDDefinition * rrd_def,
469  const char * title,
470  const char * vertical_label,
471  std::vector<RRDGraphDataDefinition> &def,
472  std::vector<RRDGraphElement *> & elements,
473  time_t start = -600,
474  time_t end = -10,
475  unsigned int step = 10,
476  unsigned int update_interval = 10,
477  bool slope_mode = false);
480 
481  void set_filename(const char *filename);
482  const char **get_argv(size_t &argc) const;
483 
484  /** Get graph definition name. @return graph definition name */
485  const char *
486  get_name() const
487  {
488  return name_;
489  }
490  /** Get RRD definition. @return RRD definition */
491  const RRDDefinition *
492  get_rrd_def() const
493  {
494  return rrd_def_;
495  }
496  /** Get start time. @return start time */
497  time_t
498  get_start() const
499  {
500  return start_;
501  }
502  /** Get end time. @return end time */
503  time_t
504  get_end() const
505  {
506  return end_;
507  }
508  /** Get step size. @return step size */
509  unsigned int
510  get_step() const
511  {
512  return step_;
513  }
514  /** Get title. @return tile */
515  const char *
516  get_title() const
517  {
518  return title_;
519  }
520  /** Get vertical label. @return vertical label */
521  const char *
523  {
524  return vertical_label_;
525  }
526  /** Get update interval. @return update interval */
527  unsigned int
529  {
530  return update_interval_;
531  }
532  /** Get slope moe. @return slope mode */
533  bool
535  {
536  return slope_mode_;
537  }
538  /** Get definitions. @return definitions */
539  const std::vector<RRDGraphDataDefinition> &
540  get_defs() const
541  {
542  return defs_;
543  }
544  /** Get graph elements. @return graph elements */
545  const std::vector<RRDGraphElement *> &
546  get_elements() const
547  {
548  return elements_;
549  }
550  /** Get line width. @return line width. */
551  unsigned int
552  get_width() const
553  {
554  return width_;
555  }
556  /** Get fonts. @return fonts */
557  const std::vector<const char *>
558  get_fonts() const
559  {
560  return fonts_;
561  }
562  /** Get filename. @return filename */
563  const char *
564  get_filename() const
565  {
566  return filename_;
567  }
568 
569 private:
570  char * name_;
571  const RRDDefinition * rrd_def_;
572  const time_t start_;
573  const time_t end_;
574  unsigned int step_;
575  char * title_;
576  char * vertical_label_;
577  const unsigned int update_interval_;
578  const bool slope_mode_;
579  std::vector<RRDGraphDataDefinition> defs_;
580  std::vector<RRDGraphElement *> elements_;
581  unsigned int width_;
582  char * width_s_;
583  char * start_s_;
584  char * end_s_;
585  char * step_s_;
586  std::vector<const char *> fonts_;
587  char * filename_;
588  mutable size_t argc_;
589  mutable const char ** argv_;
590 };
591 
592 } // end namespace fawkes
593 
594 #endif
fawkes::RRDDefinition::find_ds_index
size_t find_ds_index(const char *ds_name) const
Find data source index.
Definition: rrd_descriptions.cpp:438
fawkes::RRDDefinition::set_filename
void set_filename(const char *filename)
Set filename.
Definition: rrd_descriptions.cpp:455
fawkes::RRDDataSource::DERIVE
@ DERIVE
Derived value.
Definition: rrd_descriptions.h:47
fawkes::RRDGraphDefinition
Definition: rrd_descriptions.h:470
fawkes::RRDGraphDefinition::get_filename
const char * get_filename() const
Get filename.
Definition: rrd_descriptions.h:570
fawkes::RRDGraphGPrint::RRDGraphGPrint
RRDGraphGPrint(const char *def_name, RRDArchive::ConsolidationFunction cf, const char *format)
Constructor.
Definition: rrd_descriptions.cpp:634
fawkes::RRDGraphArea::get_legend
const char * get_legend() const
Get legend label.
Definition: rrd_descriptions.h:450
fawkes::RRDGraphDefinition::~RRDGraphDefinition
~RRDGraphDefinition()
Destructor.
Definition: rrd_descriptions.cpp:972
fawkes::RRDDataSource::get_type
Type get_type() const
Get type.
Definition: rrd_descriptions.h:74
fawkes::RRDGraphArea::clone
virtual RRDGraphElement * clone() const
Definition: rrd_descriptions.h:427
fawkes::RRDArchive::MIN
@ MIN
Minimum consolidation function.
Definition: rrd_descriptions.h:120
fawkes::RRDDataSource::RRDDataSource
RRDDataSource(const char *name, Type type, unsigned int heartbeat=30, float min=0, float max=UNKNOWN)
Constructor for regular data source.
Definition: rrd_descriptions.cpp:59
fawkes::RRDGraphArea::get_def_name
const char * get_def_name() const
Get definition name.
Definition: rrd_descriptions.h:438
fawkes::RRDGraphGPrint::get_format
const char * get_format() const
Get format string.
Definition: rrd_descriptions.h:344
fawkes::RRDGraphGPrint
Definition: rrd_descriptions.h:313
fawkes::RRDGraphLine::~RRDGraphLine
virtual ~RRDGraphLine()
Destructor.
Definition: rrd_descriptions.cpp:735
fawkes::RRDGraphElement
Definition: rrd_descriptions.h:303
fawkes::RRDGraphLine::get_def_name
const char * get_def_name() const
Get definition name.
Definition: rrd_descriptions.h:380
fawkes::RRDArchive::MAX
@ MAX
Maximum consolidation function.
Definition: rrd_descriptions.h:121
fawkes::RRDDataSource::get_min
float get_min() const
Get minimum.
Definition: rrd_descriptions.h:86
fawkes::RRDArchive::cf_to_string
static const char * cf_to_string(ConsolidationFunction cf)
Convert consolidation function type to string.
Definition: rrd_descriptions.cpp:266
fawkes::RRDGraphDefinition::get_elements
const std::vector< RRDGraphElement * > & get_elements() const
Get graph elements.
Definition: rrd_descriptions.h:552
fawkes::RRDDataSource::get_name
const char * get_name() const
Get name.
Definition: rrd_descriptions.h:68
fawkes::RRDGraphDefinition::get_start
time_t get_start() const
Get start time.
Definition: rrd_descriptions.h:504
fawkes::RRDGraphLine::to_string
virtual const char * to_string() const
Create string representation.
Definition: rrd_descriptions.cpp:774
fawkes::RRDGraphDataDefinition::get_ds_name
const char * get_ds_name() const
Get data source name.
Definition: rrd_descriptions.h:276
fawkes::RRDArchive::get_rows
unsigned int get_rows() const
Get number of rows.
Definition: rrd_descriptions.h:154
fawkes::RRDGraphDefinition::get_vertical_label
const char * get_vertical_label() const
Get vertical label.
Definition: rrd_descriptions.h:528
fawkes::RRDDataSource
Definition: rrd_descriptions.h:40
fawkes::RRDDefinition::get_step_sec
unsigned int get_step_sec() const
Get step size in sec.
Definition: rrd_descriptions.h:197
fawkes::RRDArchive::operator=
RRDArchive & operator=(const RRDArchive &rra)
Assignment operator.
Definition: rrd_descriptions.cpp:227
fawkes::RRDDataSource::Type
Type
Data source type.
Definition: rrd_descriptions.h:44
fawkes::RRDGraphGPrint::get_cf
RRDArchive::ConsolidationFunction get_cf() const
Get consolidation function type.
Definition: rrd_descriptions.h:338
fawkes::RRDGraphLine::RRDGraphLine
RRDGraphLine(const char *def_name, float width, const char *color, const char *legend, bool stacked=false)
Constructor.
Definition: rrd_descriptions.cpp:707
fawkes::RRDGraphGPrint::get_def_name
const char * get_def_name() const
Get definition name.
Definition: rrd_descriptions.h:332
fawkes::RRDArchive::get_xff
float get_xff() const
Get xfiles factor.
Definition: rrd_descriptions.h:142
fawkes::RRDDataSource::get_rpn_expression
const char * get_rpn_expression() const
Get RPN expression.
Definition: rrd_descriptions.h:98
fawkes::RRDDefinition::get_rra
const std::vector< RRDArchive > & get_rra() const
Get RRD archives.
Definition: rrd_descriptions.h:224
fawkes::RRDDataSource::get_max
float get_max() const
Get maximum.
Definition: rrd_descriptions.h:92
fawkes::RRDGraphElement::to_string
virtual const char * to_string() const
Create string representation.
Definition: rrd_descriptions.cpp:619
fawkes::RRDGraphGPrint::to_string
virtual const char * to_string() const
Create string representation.
Definition: rrd_descriptions.cpp:683
fawkes::RRDDataSource::to_string
const char * to_string() const
Get string reprensetation.
Definition: rrd_descriptions.cpp:149
fawkes::RRDDefinition::RRDDefinition
RRDDefinition(const char *name, std::vector< RRDDataSource > &ds, unsigned int step_sec=10, bool recreate=false)
Constructor with default RRAs.
Definition: rrd_descriptions.cpp:294
fawkes::RRDArchive::to_string
const char * to_string() const
Get string representation.
Definition: rrd_descriptions.cpp:243
fawkes::RRDGraphDefinition::get_argv
const char ** get_argv(size_t &argc) const
Get argument array and size.
Definition: rrd_descriptions.cpp:1018
fawkes::RRDGraphDataDefinition::get_rrd_def
const RRDDefinition * get_rrd_def() const
Get RRD definition.
Definition: rrd_descriptions.h:270
fawkes::RRDGraphDefinition::get_rrd_def
const RRDDefinition * get_rrd_def() const
Get RRD definition.
Definition: rrd_descriptions.h:498
fawkes::RRDGraphLine::clone
virtual RRDGraphElement * clone() const
Definition: rrd_descriptions.h:369
fawkes::RRDArchive::ConsolidationFunction
ConsolidationFunction
Consolidation function type.
Definition: rrd_descriptions.h:118
fawkes::RRDGraphDataDefinition::to_string
const char * to_string() const
Create string representation.
Definition: rrd_descriptions.cpp:577
fawkes::RRDGraphLine::get_color
const char * get_color() const
Get color string.
Definition: rrd_descriptions.h:392
fawkes::RRDDefinition::get_ds
const std::vector< RRDDataSource > & get_ds() const
Get data sources.
Definition: rrd_descriptions.h:210
fawkes::RRDGraphDefinition::get_slope_mode
bool get_slope_mode() const
Get slope moe.
Definition: rrd_descriptions.h:540
fawkes::RRDGraphDataDefinition
Definition: rrd_descriptions.h:248
fawkes::RRDDataSource::operator=
RRDDataSource & operator=(const RRDDataSource &other)
Assignment operator.
Definition: rrd_descriptions.cpp:124
fawkes::RRDDataSource::COUNTER
@ COUNTER
Counter value.
Definition: rrd_descriptions.h:46
fawkes::RRDDataSource::get_heartbeat
unsigned int get_heartbeat() const
Get heartbeat.
Definition: rrd_descriptions.h:80
fawkes::RRDDefinition::get_filename
const char * get_filename() const
Get file name.
Definition: rrd_descriptions.h:230
fawkes::RRDGraphDefinition::get_width
unsigned int get_width() const
Get line width.
Definition: rrd_descriptions.h:558
fawkes
fawkes::RRDGraphGPrint::clone
virtual RRDGraphElement * clone() const
Definition: rrd_descriptions.h:323
fawkes::RRDGraphElement::clone
virtual RRDGraphElement * clone() const =0
fawkes::RRDArchive::get_cf
ConsolidationFunction get_cf() const
Get consolidation function type.
Definition: rrd_descriptions.h:136
fawkes::RRDGraphGPrint::operator=
RRDGraphGPrint & operator=(const RRDGraphGPrint &g)
Assignment operator.
Definition: rrd_descriptions.cpp:665
fawkes::RRDGraphArea::~RRDGraphArea
virtual ~RRDGraphArea()
Destructor.
Definition: rrd_descriptions.cpp:828
fawkes::RRDGraphArea::get_stacked
bool get_stacked() const
Get stacked flag.
Definition: rrd_descriptions.h:456
fawkes::RRDGraphDefinition::get_update_interval
unsigned int get_update_interval() const
Get update interval.
Definition: rrd_descriptions.h:534
fawkes::RRDDefinition::get_name
const char * get_name() const
Get name.
Definition: rrd_descriptions.h:191
fawkes::RRDGraphLine::operator=
RRDGraphLine & operator=(const RRDGraphLine &g)
Assignment operator.
Definition: rrd_descriptions.cpp:752
fawkes::RRDGraphDataDefinition::get_name
const char * get_name() const
Get name.
Definition: rrd_descriptions.h:264
fawkes::RRDDefinition::operator=
RRDDefinition & operator=(const RRDDefinition &other)
Assignment operator.
Definition: rrd_descriptions.cpp:351
fawkes::RRDDataSource::GAUGE
@ GAUGE
Gauge value.
Definition: rrd_descriptions.h:45
fawkes::RRDGraphDefinition::get_fonts
const std::vector< const char * > get_fonts() const
Get fonts.
Definition: rrd_descriptions.h:564
fawkes::RRDGraphDataDefinition::~RRDGraphDataDefinition
~RRDGraphDataDefinition()
Destructor.
Definition: rrd_descriptions.cpp:532
fawkes::RRDManager
Definition: rrd_manager.h:42
fawkes::RRDGraphArea
Definition: rrd_descriptions.h:419
fawkes::RRDDataSource::COMPUTE
@ COMPUTE
Computed value.
Definition: rrd_descriptions.h:49
fawkes::RRDGraphDefinition::get_end
time_t get_end() const
Get end time.
Definition: rrd_descriptions.h:510
fawkes::RRDGraphDefinition::get_step
unsigned int get_step() const
Get step size.
Definition: rrd_descriptions.h:516
fawkes::RRDDefinition::get_recreate
bool get_recreate() const
Check recreation flag.
Definition: rrd_descriptions.h:204
fawkes::RRDArchive::RRDArchive
RRDArchive(ConsolidationFunction cf, float xff, unsigned int steps, unsigned int rows)
Constructor.
Definition: rrd_descriptions.cpp:202
fawkes::RRDGraphLine::get_width
float get_width() const
Get line width.
Definition: rrd_descriptions.h:386
fawkes::RRDGraphArea::get_color
const char * get_color() const
Get color string.
Definition: rrd_descriptions.h:444
fawkes::RRDGraphDefinition::get_name
const char * get_name() const
Get graph definition name.
Definition: rrd_descriptions.h:492
fawkes::RRDDefinition::~RRDDefinition
~RRDDefinition()
Destructor.
Definition: rrd_descriptions.cpp:372
fawkes::RRDDefinition
Definition: rrd_descriptions.h:168
fawkes::RRDDefinition::get_default_rra
static const std::vector< RRDArchive > get_default_rra()
Get default RRAs.
Definition: rrd_descriptions.cpp:408
fawkes::RRDGraphLine::get_stacked
bool get_stacked() const
Get stacked flag.
Definition: rrd_descriptions.h:404
fawkes::RRDDataSource::~RRDDataSource
~RRDDataSource()
Destructor.
Definition: rrd_descriptions.cpp:109
fawkes::RRDDefinition::set_rrd_manager
void set_rrd_manager(RRDManager *rrd_manager)
Set RRD manager.
Definition: rrd_descriptions.cpp:470
fawkes::RRDArchive::AVERAGE
@ AVERAGE
Averaging consolidation function.
Definition: rrd_descriptions.h:119
fawkes::RRDGraphArea::RRDGraphArea
RRDGraphArea(const char *def_name, const char *color, const char *legend, bool stacked=false)
Constructor.
Definition: rrd_descriptions.cpp:803
fawkes::RRDGraphDataDefinition::get_rpn_expression
const char * get_rpn_expression() const
Get RPN expression.
Definition: rrd_descriptions.h:282
fawkes::RRDGraphGPrint::~RRDGraphGPrint
virtual ~RRDGraphGPrint()
Destructor.
Definition: rrd_descriptions.cpp:650
fawkes::RRDGraphDataDefinition::operator=
RRDGraphDataDefinition & operator=(const RRDGraphDataDefinition &rra)
Assignment operator.
Definition: rrd_descriptions.cpp:549
fawkes::RRDArchive::get_steps
unsigned int get_steps() const
Get number of steps.
Definition: rrd_descriptions.h:148
fawkes::RRDGraphArea::to_string
virtual const char * to_string() const
Create string representation.
Definition: rrd_descriptions.cpp:866
fawkes::RRDArchive
Definition: rrd_descriptions.h:114
fawkes::RRDDataSource::UNKNOWN
static const float UNKNOWN
Use for unknown min or max values.
Definition: rrd_descriptions.h:52
fawkes::RRDGraphDefinition::get_defs
const std::vector< RRDGraphDataDefinition > & get_defs() const
Get definitions.
Definition: rrd_descriptions.h:546
fawkes::RRDGraphDefinition::get_title
const char * get_title() const
Get title.
Definition: rrd_descriptions.h:522
fawkes::RRDArchive::LAST
@ LAST
Last value consolidation function.
Definition: rrd_descriptions.h:122
fawkes::RRDGraphDefinition::RRDGraphDefinition
RRDGraphDefinition(const char *name, RRDDefinition *rrd_def, const char *title, const char *vertical_label, std::vector< RRDGraphDataDefinition > &def, std::vector< RRDGraphElement * > &elements, time_t start=-600, time_t end=-10, unsigned int step=10, unsigned int update_interval=10, bool slope_mode=false)
Constructor.
Definition: rrd_descriptions.cpp:903
fawkes::RRDGraphDefinition::set_filename
void set_filename(const char *filename)
Set filename.
Definition: rrd_descriptions.cpp:1003
fawkes::RRDGraphArea::operator=
RRDGraphArea & operator=(const RRDGraphArea &g)
Assignment operator.
Definition: rrd_descriptions.cpp:845
fawkes::RRDGraphLine::get_legend
const char * get_legend() const
Get legend label.
Definition: rrd_descriptions.h:398
fawkes::RRDDataSource::ABSOLUTE
@ ABSOLUTE
Absolute value.
Definition: rrd_descriptions.h:48
fawkes::RRDGraphLine
Definition: rrd_descriptions.h:357
fawkes::RRDGraphDataDefinition::get_cf
RRDArchive::ConsolidationFunction get_cf() const
Get consolidation function type.
Definition: rrd_descriptions.h:288
fawkes::RRDArchive::~RRDArchive
~RRDArchive()
Destructor.
Definition: rrd_descriptions.cpp:216
fawkes::RRDGraphDataDefinition::RRDGraphDataDefinition
RRDGraphDataDefinition(const char *name, RRDArchive::ConsolidationFunction cf, const RRDDefinition *rrd_def, const char *ds_name=NULL)
DEF constructor.
Definition: rrd_descriptions.cpp:491