Skip to content

Commit dcab44b

Browse files
committed
[mon] Update monitoring format, add tags
1 parent d1ae0b8 commit dcab44b

File tree

3 files changed

+26
-12
lines changed

3 files changed

+26
-12
lines changed

src/CommandLineUtilities/Program.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class Program : public AliceO2::Common::Program
6464
InfoLogger::InfoLogger mLogger;
6565
InfoLogger::InfoLogger::Severity mLogLevel = InfoLogger::InfoLogger::Severity::Info;
6666

67-
const std::string MONITORING_URI = "stdout://";
67+
const std::string MONITORING_URI = "influxdb-stdout://";
6868
};
6969

7070
} // namespace CommandLineUtilities

src/CommandLineUtilities/ProgramMetrics.cxx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,15 @@ class ProgramMetrics : public Program
104104
uint32_t totalPacketsPerSecond = bar2->getTotalPacketsPerSecond(0);
105105

106106
if (mOptions.monitoring) {
107-
monitoring->send(Metric{ std::to_string(i), "card" }
108-
.addValue(CardType::toString(card.cardType), "type")
107+
monitoring->send(Metric{ "card" }
109108
.addValue(card.pciAddress.toString(), "pciAddress")
110109
.addValue(temperature, "temperature")
111110
.addValue(dropped, "droppedPackets")
112111
.addValue(ctpClock, "ctpClock")
113112
.addValue(localClock, "localClock")
114-
.addValue((int)totalPacketsPerSecond, "totalPacketsPerSecond"));
113+
.addValue((int)totalPacketsPerSecond, "totalPacketsPerSecond")
114+
.addTag(tags::Key::ID, i)
115+
.addTag(tags::Key::Type, tags::Value::CRU));
115116

116117
} else if (mOptions.jsonOut) {
117118
pt::ptree cardNode;

src/CommandLineUtilities/ProgramStatus.cxx

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,18 +110,22 @@ class ProgramStatus : public Program
110110

111111
/* GENERAL PARAMETERS */
112112
if (mOptions.monitoring) {
113-
monitoring->send(Metric{ cardIdString, "CRORC" }
113+
monitoring->send(Metric{ "CRORC" }
114+
.addValue(card.pciAddress.toString(), "pciAddress")
114115
.addValue(qsfpEnabled, "qsfp")
115116
.addValue(offset, "offset")
116117
.addValue(timeFrameDetectionEnabled, "timeFrameDetection")
117-
.addValue(reportInfo.timeFrameLength, "timeFrameLength"));
118+
.addValue(reportInfo.timeFrameLength, "timeFrameLength")
119+
.addTag(tags::Key::ID, card.sequenceId)
120+
.addTag(tags::Key::Type, tags::Value::CRORC));
118121
} else if (mOptions.jsonOut) {
119122
root.put("qsfp", qsfpEnabled);
120123
root.put("offset", offset);
121124
root.put("timeFrameDetection", timeFrameDetectionEnabled);
122125
root.put("timeFrameLength", reportInfo.timeFrameLength);
123126
} else if (mOptions.csvOut) {
124127
auto csvLine = std::string(",,,") + qsfpEnabled + "," + offset + "," + timeFrameDetectionEnabled + "," + std::to_string(reportInfo.timeFrameLength) + "\n";
128+
125129
std::cout << csvLine;
126130
} else {
127131
std::cout << "-----------------------------" << std::endl;
@@ -142,9 +146,12 @@ class ProgramStatus : public Program
142146
float opticalPower = link.opticalPower;
143147

144148
if (mOptions.monitoring) {
145-
monitoring->send(Metric{ id, "link" }
149+
monitoring->send(Metric{ "link" }
150+
.addValue(card.pciAddress.toString(), "pciAddress")
146151
.addValue(linkStatus, "status")
147-
.addValue(opticalPower, "opticalPower"));
152+
.addValue(opticalPower, "opticalPower")
153+
.addTag(tags::Key::CRORC, card.sequenceId)
154+
.addTag(tags::Key::ID, id));
148155
} else if (mOptions.jsonOut) {
149156
pt::ptree linkNode;
150157

@@ -188,10 +195,13 @@ class ProgramStatus : public Program
188195

189196
/* GENERAL PARAMETERS */
190197
if (mOptions.monitoring) {
191-
monitoring->send(Metric{ cardIdString, "CRU" }
198+
monitoring->send(Metric{ "CRU" }
199+
.addValue(card.pciAddress.toString(), "pciAddress")
192200
.addValue(clock, "clock")
193201
.addValue(offset, "offset")
194-
.addValue(userLogic, "userLogic"));
202+
.addValue(userLogic, "userLogic")
203+
.addTag(tags::Key::ID, card.sequenceId)
204+
.addTag(tags::Key::Type, tags::Value::CRU));
195205
} else if (mOptions.jsonOut) {
196206
root.put("clock", clock);
197207
root.put("offset", offset);
@@ -249,7 +259,8 @@ class ProgramStatus : public Program
249259
float opticalPower = link.opticalPower;
250260

251261
if (mOptions.monitoring) {
252-
monitoring->send(Metric{ globalId, "link" }
262+
monitoring->send(Metric{ "link" }
263+
.addValue(card.pciAddress.toString(), "pciAddress")
253264
.addValue(gbtTxRxMode, "gbtMode")
254265
.addValue(loopback, "loopback")
255266
.addValue(gbtMux, "gbtMux")
@@ -258,7 +269,9 @@ class ProgramStatus : public Program
258269
.addValue(rxFreq, "rxFreq")
259270
.addValue(txFreq, "txFreq")
260271
.addValue(linkStatus, "status")
261-
.addValue(opticalPower, "opticalPower"));
272+
.addValue(opticalPower, "opticalPower")
273+
.addTag(tags::Key::CRU, card.sequenceId)
274+
.addTag(tags::Key::ID, globalId));
262275
} else if (mOptions.jsonOut) {
263276
pt::ptree linkNode;
264277

0 commit comments

Comments
 (0)