]> granicus.if.org Git - icinga2/blob - lib/base/perfdatavalue.hpp
Merge pull request #7185 from Icinga/bugfix/gelfwriter-wrong-log-facility
[icinga2] / lib / base / perfdatavalue.hpp
1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
2
3 #ifndef PERFDATAVALUE_H
4 #define PERFDATAVALUE_H
5
6 #include "base/i2-base.hpp"
7 #include "base/perfdatavalue-ti.hpp"
8
9 namespace icinga
10 {
11
12 /**
13  * A performance data value.
14  *
15  * @ingroup base
16  */
17 class PerfdataValue final : public ObjectImpl<PerfdataValue>
18 {
19 public:
20         DECLARE_OBJECT(PerfdataValue);
21
22         PerfdataValue() = default;
23
24         PerfdataValue(const String& label, double value, bool counter = false, const String& unit = "",
25                 const Value& warn = Empty, const Value& crit = Empty,
26                 const Value& min = Empty, const Value& max = Empty);
27
28         static PerfdataValue::Ptr Parse(const String& perfdata);
29         String Format() const;
30
31 private:
32         static Value ParseWarnCritMinMaxToken(const std::vector<String>& tokens,
33                 std::vector<String>::size_type index, const String& description);
34 };
35
36 }
37
38 #endif /* PERFDATA_VALUE */