-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy path2-TaggedMetrics.cxx
More file actions
29 lines (23 loc) · 918 Bytes
/
2-TaggedMetrics.cxx
File metadata and controls
29 lines (23 loc) · 918 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
///
/// \file 2-TaggedMetrics.cxx
/// \author Adam Wegrzynek <adam.wegrzynek@cern.ch>
///
#include "Monitoring/MonitoringFactory.h"
using namespace o2::monitoring;
int main()
{
// Configure monitoring
// Pass string with list of URLs as parameter
auto monitoring = MonitoringFactory::Get("stdout://debug:@/");
/// Add global tags
monitoring->addGlobalTag("name", "test");
monitoring->addGlobalTag(tags::Key::Subsystem, tags::Value::DPL);
// now send an application specific metric with additional tags
// 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::ACO));
monitoring->send(Metric{10, "myMetric"}.addTag(tags::Key::CRU, 0));
monitoring->send(Metric{10, "myMetric"}.addTag(tags::Key::CRU, 12));
monitoring->send(Metric{10, "myMetric"}.addTag(tags::Key::CRU, 1234));
}