Skip to content

Commit 30a8296

Browse files
committed
moved from unsigned long long to uint64_t
1 parent 93e9956 commit 30a8296

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

include/Monitoring/Metric.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace AliceO2
1818
namespace Monitoring
1919
{
2020

21-
enum MetricType { INT = 0, STRING = 1, DOUBLE = 2, UNSIGNEDLONGLONG = 3 };
21+
enum MetricType { INT = 0, STRING = 1, DOUBLE = 2, UINT64_T = 3 };
2222

2323
/// \brief Represents metric parameters except (value, name, entity and timestamp)
2424
class Metric
@@ -29,6 +29,7 @@ class Metric
2929
/// \param name metric name
3030
/// \param timestamp metric timestamp in milliseconds
3131
Metric(int value, const std::string& name, std::chrono::time_point<std::chrono::system_clock> timestamp = Metric::getCurrentTimestamp());
32+
3233
/// Initialize class variables
3334
/// \param value metric value (string)
3435
/// \param name the metric name
@@ -42,10 +43,10 @@ class Metric
4243
Metric(double value, const std::string& name, std::chrono::time_point<std::chrono::system_clock> timestamp = Metric::getCurrentTimestamp());
4344

4445
/// Initialize class variables
45-
/// \param value metric value (unsigned long long)
46+
/// \param value metric value (uint64_t)
4647
/// \param name metric name
4748
/// \param timestamp metric timestamp in milliseconds
48-
Metric(unsigned long long value, const std::string& name, std::chrono::time_point<std::chrono::system_clock> timestamp = Metric::getCurrentTimestamp());
49+
Metric(uint64_t value, const std::string& name, std::chrono::time_point<std::chrono::system_clock> timestamp = Metric::getCurrentTimestamp());
4950

5051
/// Default destructor
5152
~Metric() = default;
@@ -60,7 +61,7 @@ class Metric
6061

6162
/// Value getter
6263
/// \return metric value
63-
boost::variant< int, std::string, double, unsigned long long > getValue() const;
64+
boost::variant< int, std::string, double, uint64_t > getValue() const;
6465

6566
/// Value type getter
6667
/// \return type of value stores inside metric : 0 - int, 1 - std::string, 2 - double
@@ -86,7 +87,7 @@ class Metric
8687

8788
private:
8889
/// Metric value
89-
boost::variant< int, std::string, double, unsigned long long > mValue;
90+
boost::variant< int, std::string, double, uint64_t > mValue;
9091

9192
/// Metric name
9293
std::string mName;

src/Collector.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,17 +181,17 @@ void Collector::sendTimed(T value, std::string name, std::chrono::time_point<std
181181
template void Collector::send(int, std::string);
182182
template void Collector::send(double, std::string);
183183
template void Collector::send(std::string, std::string);
184-
template void Collector::send(unsigned long long, std::string);
184+
template void Collector::send(uint64_t, std::string);
185185

186186
template void Collector::sendTagged(int, std::string, std::vector<Tag>&& tags);
187187
template void Collector::sendTagged(double, std::string, std::vector<Tag>&& tags);
188188
template void Collector::sendTagged(std::string, std::string, std::vector<Tag>&& tags);
189-
template void Collector::sendTagged(unsigned long long, std::string, std::vector<Tag>&& tags);
189+
template void Collector::sendTagged(uint64_t, std::string, std::vector<Tag>&& tags);
190190

191191
template void Collector::sendTimed(int, std::string, std::chrono::time_point<std::chrono::system_clock>& timestamp);
192192
template void Collector::sendTimed(double, std::string, std::chrono::time_point<std::chrono::system_clock>& timestamp);
193193
template void Collector::sendTimed(std::string, std::string, std::chrono::time_point<std::chrono::system_clock>& timestamp);
194-
template void Collector::sendTimed(unsigned long long, std::string, std::chrono::time_point<std::chrono::system_clock>& timestamp);
194+
template void Collector::sendTimed(uint64_t, std::string, std::chrono::time_point<std::chrono::system_clock>& timestamp);
195195

196196
} // namespace Monitoring
197197
} // namespace AliceO2

src/Metric.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ Metric::Metric(double value, const std::string& name, std::chrono::time_point<st
4242
mValue(value), mName(name), mTimestamp(timestamp)
4343
{}
4444

45-
Metric::Metric(unsigned long long value, const std::string& name, std::chrono::time_point<std::chrono::system_clock> timestamp) :
45+
Metric::Metric(uint64_t value, const std::string& name, std::chrono::time_point<std::chrono::system_clock> timestamp) :
4646
mValue(value), mName(name), mTimestamp(timestamp)
4747
{}
4848

49-
boost::variant< int, std::string, double, unsigned long long > Metric::getValue() const
49+
boost::variant< int, std::string, double, uint64_t > Metric::getValue() const
5050
{
5151
return mValue;
5252
}

test/testMetric.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ BOOST_AUTO_TEST_CASE(retrieveString)
5050

5151
BOOST_AUTO_TEST_CASE(retrieveUnsignedLongLong)
5252
{
53-
unsigned long long value = 10000000000000LL;
53+
uint64_t value = 10000000000000LL;
5454
std::string name("metric name");
5555
AliceO2::Monitoring::Metric metricInstance(value, name );
5656

57-
BOOST_CHECK_EQUAL(boost::get<unsigned long long>(metricInstance.getValue()), 10000000000000LL);
57+
BOOST_CHECK_EQUAL(boost::get<uint64_t>(metricInstance.getValue()), 10000000000000LL);
5858
BOOST_CHECK_EQUAL(metricInstance.getType(), 3);
5959
}
6060

0 commit comments

Comments
 (0)