Skip to content

Commit 0795fea

Browse files
authored
[ORC-322] Make sure CRU ID=0 will not ACO label (#198)
* Make sure CRU ID=0 will not ACO label * Bump to v3.0.6
1 parent 27973cf commit 0795fea

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ endif()
1717

1818
# Define project
1919
project(Monitoring
20-
VERSION 3.0.5
20+
VERSION 3.0.6
2121
DESCRIPTION "O2 Monitoring library"
2222
LANGUAGES CXX
2323
)

examples/2-TaggedMetrics.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ int main()
2222
// 10 is the value
2323
// myMetric is the name of the metric
2424
// then add predefined tag
25-
monitoring->send(Metric{10, "myMetric"}.addTag(tags::Key::Detector, tags::Value::TPC));
26-
monitoring->send(Metric{10, "myMetric"}.addTag(tags::Key::CRU, 123));
25+
monitoring->send(Metric{10, "myMetric"}.addTag(tags::Key::Detector, tags::Value::ACO));
26+
monitoring->send(Metric{10, "myMetric"}.addTag(tags::Key::CRU, 0));
2727
}

include/Monitoring/Tags.h

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static constexpr std::array<std::string_view, 13> TAG_KEY = {
6464

6565
// Tag values
6666
enum class Value : unsigned short int {
67-
ACO,
67+
Null,
6868
AD, // 1
6969
CPV, // 2
7070
EMC, // 3
@@ -101,12 +101,13 @@ enum class Value : unsigned short int {
101101
PerCycle, // 34
102102
PerRun, // 35
103103
Monitoring, // 36
104-
CRORC
104+
CRORC, // 37
105+
ACO // 38
105106
};
106107

107108
// Tag value array
108-
static constexpr std::array<std::string_view, 38> TAG_VALUE = {{
109-
"ACO"sv,
109+
static constexpr std::array<std::string_view, 39> TAG_VALUE = {{
110+
"Null"sv,
110111
"AD"sv, // 1
111112
"CPV"sv, // 2
112113
"EMC"sv, // 3
@@ -142,13 +143,14 @@ static constexpr std::array<std::string_view, 38> TAG_VALUE = {{
142143
"ps"sv, // 33
143144
"pcycle"sv, // 34
144145
"prun"sv, // 35
145-
"monitoring"sv,
146-
"CRORC"sv
146+
"monitoring"sv, // 36
147+
"CRORC"sv, // 37
148+
"ACO"sv // 38
147149
}};
148150

149151
static constexpr std::string_view GetValue(const int value)
150152
{
151-
return value >= 0 ? TAG_VALUE[value] : std::to_string(0 - value);
153+
return value > 0 ? TAG_VALUE[value] : std::to_string(0 - value);
152154
}
153155

154156
} // namespace tags

0 commit comments

Comments
 (0)