Skip to content

Commit 0b09c27

Browse files
authored
Fix tag definitions (#181)
* Add QC related tags * Fix tags definition
1 parent 9adef62 commit 0b09c27

File tree

1 file changed

+76
-52
lines changed

1 file changed

+76
-52
lines changed

include/Monitoring/Tags.h

Lines changed: 76 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -29,57 +29,76 @@ namespace tags
2929
using namespace std::string_view_literals;
3030

3131
// Tag keys
32-
enum class Key : unsigned short int { Hostname,
33-
Rolename,
34-
Name,
35-
Detector,
36-
Subsystem,
37-
CRU,
38-
FLP,
39-
EPN,
40-
Unit };
32+
enum class Key : unsigned short int {
33+
Hostname,
34+
Rolename,
35+
Name,
36+
Detector,
37+
Subsystem,
38+
CRU,
39+
FLP,
40+
EPN,
41+
Unit
42+
};
4143

4244
/// Tag keys array
43-
static constexpr std::array<std::string_view, 9> TAG_KEY = {
44-
"hostname"sv, "rolenane"sv, "name"sv, "detector"sv, "subsystem"sv, "CRU"sv, "FLP"sv, "EPN"sv, "unit"sv};
45+
static constexpr std::array<std::string_view, 11> TAG_KEY = {
46+
"hostname"sv,
47+
"rolenane"sv,
48+
"name"sv,
49+
"detector"sv,
50+
"subsystem"sv,
51+
"CRU"sv,
52+
"FLP"sv,
53+
"EPN"sv,
54+
"unit"sv,
55+
"run"sv,
56+
"id"sv
57+
};
4558

4659
// Tag values
47-
enum class Value : unsigned short int { ACO,
48-
AD,
49-
CPV,
50-
EMC,
51-
FMD,
52-
HMP,
53-
MCH,
54-
MTR,
55-
PHS,
56-
PMD,
57-
ITS,
58-
T0,
59-
TOF,
60-
TPC,
61-
TRD,
62-
V0,
63-
QC,
64-
Readout,
65-
DPL,
66-
CRU,
67-
Bytes,
68-
Megabytes,
69-
Gigabytes,
70-
Bits,
71-
Megabits,
72-
Gigabits,
73-
bps,
74-
Mbps,
75-
Gbps,
76-
Nanoseconds,
77-
Microseconds,
78-
Milliseconds,
79-
Seconds };
60+
enum class Value : unsigned short int {
61+
ACO,
62+
AD, // 1
63+
CPV, // 2
64+
EMC, // 3
65+
FMD, // 4
66+
HMP, // 5
67+
MCH, // 6
68+
MTR, // 7
69+
PHS, // 8
70+
PMD, // 9
71+
ITS, // 10
72+
T0, // 11
73+
TOF, // 12
74+
TPC, // 13
75+
TRD, // 14
76+
V0, // 15
77+
QC, // 16
78+
Readout, // 17
79+
DPL, // 18
80+
CRU, // 19
81+
Bytes, // 20
82+
Megabytes, // 21
83+
Gigabytes, // 22
84+
Bits, // 23
85+
Megabits, // 24
86+
Gigabits, // 25
87+
bps, // 26
88+
Mbps, // 27
89+
Gbps, // 28
90+
Nanoseconds, // 29
91+
Microseconds, // 30
92+
Milliseconds, // 31
93+
Seconds, // 32
94+
PerSecond, // 33
95+
PerCycle, // 34
96+
PerRun, // 35
97+
Monitoring
98+
};
8099

81100
// Tag value array
82-
static constexpr std::array<std::string_view, 33> TAG_VALUE = {{
101+
static constexpr std::array<std::string_view, 37> TAG_VALUE = {{
83102
"ACO"sv,
84103
"AD"sv, // 1
85104
"CPV"sv, // 2
@@ -97,7 +116,7 @@ static constexpr std::array<std::string_view, 33> TAG_VALUE = {{
97116
"TRD"sv, // 14
98117
"V0"sv, // 15
99118
"QC"sv, // 16
100-
"Readout"sv, //17
119+
"Readout"sv, // 17
101120
"DPL"sv, // 18
102121
"CRU"sv, // 19
103122
"B"sv, // 20
@@ -108,18 +127,23 @@ static constexpr std::array<std::string_view, 33> TAG_VALUE = {{
108127
"Gb"sv, // 25
109128
"bps"sv, // 26
110129
"Mbps"sv, // 27
111-
"Gbps"sv, //28
112-
"ns"sv, //29
113-
"us"sv, //30
114-
"ms"sv //31
115-
"s"sv // 32
130+
"Gbps"sv, // 28
131+
"ns"sv, // 29
132+
"us"sv, // 30
133+
"ms"sv, // 31
134+
"s"sv, // 32
135+
"ps"sv, // 33
136+
"pcycle"sv, // 34
137+
"prun"sv, // 35
138+
"monitoring"sv
116139
}};
140+
117141
static constexpr std::string_view GetValue(const int value)
118142
{
119143
return value >= 0 ? TAG_VALUE[value] : std::to_string(0 - value);
120144
}
121-
} // namespace tags
122145

146+
} // namespace tags
123147
} // namespace monitoring
124148
} // namespace o2
125149

0 commit comments

Comments
 (0)