You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Drop debug API
* Make send vector method private
* Rename methods passing values to backend to transmit
* Fix influxdb http backend
* Added metric verbosity
* Fix - remove unintended code
* Match metric and backend verbosities
* Add verbosity example
* Fix buffering
* Derived metric should have the same verbosity
* Add verbosity example
* Adapt README
Copy file name to clipboardExpand all lines: README.md
+38-43Lines changed: 38 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,8 +56,8 @@ make install
56
56
57
57
## Getting started
58
58
### Monitoring instance
59
-
The recommended way of getting (`unique_ptr` to) monitoring instance is `Get`ing it from `MonitoringFactory` by passing backend URI(s) as a parameter (comma seperated if more than one).
60
-
The library is accessible from `o2::monitoring` namespace.
59
+
The recommended way of getting monitoring instance is `Get`ing it from `MonitoringFactory` by passing backend's URI(s) as a parameter (comma separated if more than one).
60
+
The factory is accessible from `o2::monitoring` namespace.
| value | int / double / string / uint64_t | yes | - |
90
+
| timestamp | chrono::time_point<std::chrono::system_clock>| no | current timestamp |
91
+
| verbosity | DEBUG / INFO / PROD | no | INFO |
92
+
| tags | vector<unsignedint> | no | - |
93
+
94
+
A metric can be constructed by providing required parameters:
87
95
```cpp
88
-
send(Metric&& metric, [DerivedMetricMode mode])
96
+
Metric{10, "name"}
89
97
```
90
-
Where metric constructor receives following parameters:
91
-
- `T value`
92
-
- `std::string& name`
93
98
94
-
See how it works in the example: [examples/1-Basic.cxx](examples/1-Basic.cxx).
99
+
#### Verbosity
100
+
There are 3 verbosity levels (the same as for backends): DEBUG, INFO, PROD. The default verbosity is set using: `Metric::setDefaultVerbosity(verbosity)`.
101
+
To overwrite verbosity on per metric basis use third, optional parameter to metric constructor:
102
+
```cpp
103
+
Metric{10, "name", Verbosity::PROD}
104
+
```
105
+
106
+
Metrics need to match backends verbosity in order to be sent, eg. backend with `/info` verbosity will accept `INFO` and `PROD` metrics only.
95
107
96
-
The `DerivedMetricMode` is optional and described in [Calculating derived metrics](#calculating-derived-metrics) section.
97
108
98
-
### Taging metric
109
+
#### Tags
99
110
Each metric can be tagged with any number of [predefined tags](include/Monitoring/Tags.h).
100
111
In order to do so use `addTags(std::initializer_list<unsigned int>&& tags)` method.
101
112
102
113
See the example: [examples/2-TaggedMetrics.cxx](examples/2-TaggedMetrics.cxx).
103
114
104
-
### Debug metrics
105
-
Debug metrics can be send by a similar method to above's `send`:
115
+
### Sending metric
116
+
106
117
```cpp
107
-
debug(Metric&& metric)
118
+
send(Metric&& metric, [DerivedMetricMode mode])
108
119
```
109
120
110
-
The difference is that debug metrics are only passed to backends which verbosity level is set to `debug`.
121
+
See how it works in the example: [examples/1-Basic.cxx](examples/1-Basic.cxx).
111
122
112
-
Each backend has its default verbosity (see backend in [Monitoring instance](#monitoring-instance) section). This can be changed by defining path of a backend URL:
113
-
-`/prod` - only `send` metrics are passed to the backend
114
-
-`/debug` - all the metrics are passed to the backend
123
+
The `DerivedMetricMode` is optional and described in [Calculating derived metrics](#calculating-derived-metrics) section.
115
124
116
-
## Features and additional information
125
+
## Advanced features
117
126
118
127
### Sending more than one metric
119
128
In order to send more than one metric in a packet group them into vector:
@@ -141,20 +150,6 @@ monitoring->flushBuffer();
141
150
142
151
See how it works in the example: [examples/10-Buffering.cxx](examples/10-Buffering.cxx).
143
152
144
-
### Metrics
145
-
Metrics consist of 4 parameters: name, value, timestamp and tags.
0 commit comments