Skip to content

Commit

Permalink
[ORC-322] Make sure CRU ID=0 will not ACO label (#198)
Browse files Browse the repository at this point in the history
* Make sure CRU ID=0 will not ACO label

* Bump to v3.0.6
  • Loading branch information
awegrzyn authored Apr 29, 2020
1 parent 27973cf commit 0795fea
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ endif()

# Define project
project(Monitoring
VERSION 3.0.5
VERSION 3.0.6
DESCRIPTION "O2 Monitoring library"
LANGUAGES CXX
)
Expand Down
4 changes: 2 additions & 2 deletions examples/2-TaggedMetrics.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ int main()
// 10 is the value
// myMetric is the name of the metric
// then add predefined tag
monitoring->send(Metric{10, "myMetric"}.addTag(tags::Key::Detector, tags::Value::TPC));
monitoring->send(Metric{10, "myMetric"}.addTag(tags::Key::CRU, 123));
monitoring->send(Metric{10, "myMetric"}.addTag(tags::Key::Detector, tags::Value::ACO));
monitoring->send(Metric{10, "myMetric"}.addTag(tags::Key::CRU, 0));
}
16 changes: 9 additions & 7 deletions include/Monitoring/Tags.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static constexpr std::array<std::string_view, 13> TAG_KEY = {

// Tag values
enum class Value : unsigned short int {
ACO,
Null,
AD, // 1
CPV, // 2
EMC, // 3
Expand Down Expand Up @@ -101,12 +101,13 @@ enum class Value : unsigned short int {
PerCycle, // 34
PerRun, // 35
Monitoring, // 36
CRORC
CRORC, // 37
ACO // 38
};

// Tag value array
static constexpr std::array<std::string_view, 38> TAG_VALUE = {{
"ACO"sv,
static constexpr std::array<std::string_view, 39> TAG_VALUE = {{
"Null"sv,
"AD"sv, // 1
"CPV"sv, // 2
"EMC"sv, // 3
Expand Down Expand Up @@ -142,13 +143,14 @@ static constexpr std::array<std::string_view, 38> TAG_VALUE = {{
"ps"sv, // 33
"pcycle"sv, // 34
"prun"sv, // 35
"monitoring"sv,
"CRORC"sv
"monitoring"sv, // 36
"CRORC"sv, // 37
"ACO"sv // 38
}};

static constexpr std::string_view GetValue(const int value)
{
return value >= 0 ? TAG_VALUE[value] : std::to_string(0 - value);
return value > 0 ? TAG_VALUE[value] : std::to_string(0 - value);
}

} // namespace tags
Expand Down

0 comments on commit 0795fea

Please sign in to comment.