1010#include < chrono>
1111#include < vector>
1212#include < boost/variant.hpp>
13- #include " Tag .h"
13+ #include " Tags .h"
1414
1515namespace o2
1616{
@@ -27,32 +27,27 @@ class Metric
2727 // / Integer metric construtor
2828 // / \param value metric value (int)
2929 // / \param name metric name
30- // / \param timestamp metric timestamp in milliseconds
31- Metric (int value, const std::string& name, std::chrono::time_point<std::chrono::system_clock> timestamp = Metric::getCurrentTimestamp());
30+ Metric (int value, const std::string& name);
3231
3332 // / String metric construtor
3433 // / \param value metric value (string)
3534 // / \param name the metric name
36- // / \param timestamp metric timestamp in milliseconds
37- Metric (std::string value, const std::string& name, std::chrono::time_point<std::chrono::system_clock> timestamp = Metric::getCurrentTimestamp());
35+ Metric (std::string value, const std::string& name);
3836
3937 // / Double metric constructor
4038 // / \param value metric value (double)
4139 // / \param name metric name
42- // / \param timestamp metric timestamp in milliseconds
43- Metric (double value, const std::string& name, std::chrono::time_point<std::chrono::system_clock> timestamp = Metric::getCurrentTimestamp());
40+ Metric (double value, const std::string& name);
4441
4542 // / uint64_t metric constructor
4643 // / \param value metric value (uint64_t)
4744 // / \param name metric name
48- // / \param timestamp metric timestamp in milliseconds
49- Metric (uint64_t value, const std::string& name, std::chrono::time_point<std::chrono::system_clock> timestamp = Metric::getCurrentTimestamp());
45+ Metric (uint64_t value, const std::string& name);
5046
5147 // / boost variant metric constructor, required by derived metrics logic
5248 // / \param value metric value (boost variant)
5349 // / \param name metric name
54- // / \param timestamp metric timestamp in milliseconds
55- Metric (boost::variant< int , std::string, double , uint64_t >, const std::string& name, std::chrono::time_point<std::chrono::system_clock> timestamp = Metric::getCurrentTimestamp());
50+ Metric (boost::variant< int , std::string, double , uint64_t >, const std::string& name);
5651
5752 // / Default destructor
5853 ~Metric () = default ;
@@ -77,21 +72,18 @@ class Metric
7772 int getType () const ;
7873
7974 // / Tag list getter
80- // / \return vector of tags
81- std::vector<Tag> getTags () const ;
75+ // / \return tags
76+ const std::vector<unsigned int >& getTags () const ;
8277
8378 // / Add user defined tags
8479 // / \param tags r-value to vector of tags
8580 // / \return r-value to "this" - to be able to chain methods
86- Metric&& addTags(std::vector<Tag >&& tags);
81+ Metric&& addTags(std::initializer_list< unsigned int >&& tags);
8782
8883 // / Generetes current timestamp
8984 // / return timestamp as std::chrono::system_clock
9085 static auto getCurrentTimestamp () -> decltype(std::chrono::system_clock::now());
9186
92- // / Tagset vector size getter
93- std::size_t tagSize () const ;
94-
9587 protected:
9688 // / Metric value
9789 boost::variant< int , std::string, double , uint64_t > mValue ;
@@ -103,7 +95,7 @@ class Metric
10395 std::chrono::time_point<std::chrono::system_clock> mTimestamp ;
10496
10597 // / Metric tags
106- std::vector<Tag> tagSet ;
98+ std::vector<unsigned int > mTags ;
10799};
108100
109101} // namespace monitoring
0 commit comments