Skip to content

Commit e683181

Browse files
committed
Adapt docs
1 parent 9f32019 commit e683181

File tree

2 files changed

+19
-23
lines changed

2 files changed

+19
-23
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ endif()
1313

1414
# Define project
1515
project(Monitoring
16-
VERSION 1.9.2
16+
VERSION 2.0.0
1717
DESCRIPTION "O2 Monitoring library"
1818
LANGUAGES CXX
1919
)

README.md

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,24 @@ Monitoring module allows to inject user defined metrics and monitor the process
2121
<br>
2222

2323
+ Compile `Monitoring` and its dependecies via `aliBuild`
24-
~~~
24+
```
2525
aliBuild init Monitoring@master
2626
aliBuild build Monitoring --defaults o2-daq
27-
~~~
27+
```
2828

2929
+ Load the enviroment for Monitoring (in the `alice` directory)
30-
~~~
30+
```
3131
alienv load Monitoring/latest
32-
~~~
32+
```
3333

3434
In case of an issue with `aliBuild` refer to [the official instructions](https://alice-doc.github.io/alice-analysis-tutorial/building).
3535

3636
### Manual
3737
Manual installation of the O<sup>2</sup> Monitoring module.
3838

3939
#### Requirements
40-
+ C++ compiler with C++14 support, eg.:
41-
+ `gcc-c++` package from `devtoolset-6` on CentOS 7
40+
+ C++ compiler with C++17 support, eg.:
41+
+ `gcc-c++` package from `devtoolset-7` on CentOS 7
4242
+ `clang++` on Mac OS
4343
+ Boost >= 1.56
4444
+ libcurl
@@ -79,7 +79,7 @@ Multiple backends may be used at the same time, URLs should be separated by `,`
7979
8080
#### StdCout output format
8181
```
82-
<timestamp/%Y-%m-%d %X> [METRIC] <name>,<type> <value> <timestamp> <tags>
82+
[METRIC] <name>,<type> <value> <timestamp> <tags>
8383
```
8484

8585
### Sending metric
@@ -90,12 +90,16 @@ send(Metric&& metric, [DerivedMetricMode mode])
9090
Where metric constructor receives following parameters:
9191
- `T value`
9292
- `std::string& name`
93-
- `[time_point<system_clock> timestamp]`
9493
94+
See how it works in the example: [examples/1-Basic.cxx](examples/1-Basic.cxx).
9595
96-
The `DerivedMetricMode` is described in [Calculating derived metrics](#calculating-derived-metrics) section.
96+
The `DerivedMetricMode` is optional and described in [Calculating derived metrics](#calculating-derived-metrics) section.
9797
98-
See how it works in the example: [examples/1-Basic.cxx](examples/1-Basic.cxx)
98+
### Taging metric
99+
Each metric can be tagged with any number of [predefined tags](include/Monitoring/Tags.h).
100+
In order to do so use `addTags(std::initializer_list<unsigned int>&& tags)` method.
101+
102+
See the example: [examples/2-TaggedMetrics.cxx](examples/2-TaggedMetrics.cxx).
99103
100104
### Debug metrics
101105
Debug metrics can be send by a similar method to above's `send`:
@@ -109,13 +113,6 @@ Each backend has its default verbosity (see backend in [Monitoring instance](#mo
109113
- `/prod` - only `send` metrics are passed to the backend
110114
- `/debug` - all the metrics are passed to the backend
111115

112-
113-
### Customized metrics
114-
Two additional methods can be chained the to `send(Metric&& metric)` in order to __insert custom tags__ or __set custom timestamp__:
115-
+ `addTags(std::vector<Tag>&& tags)`
116-
117-
See how it works in the example: [examples/2-TaggedMetrics.cxx](examples/2-TaggedMetrics.cxx), [examples/3-UserDefinedTimestamp.cxx](examples/3-UserDefinedTimestamp.cxx).
118-
119116
## Features and additional information
120117

121118
### Sending more than one metric
@@ -135,7 +132,7 @@ See how it works in the example: [examples/8-Multiple.cxx](examples/8-Multiple.c
135132
In order to avoid sending each metric separately, metrics can be temporary stored in the buffer and flushed at the most convenient moment.
136133
This feature can be operated with following two methods:
137134
```cpp
138-
monitoring->enableBuffering(const unsigned int maxSize)
135+
monitoring->enableBuffering(const std::size_t maxSize)
139136
...
140137
monitoring->flushBuffer();
141138
```
@@ -152,11 +149,10 @@ Metrics consist of 4 parameters: name, value, timestamp and tags.
152149
| name | string | yes | - |
153150
| value | int / double / string / uint64_t | yes | - |
154151
| timestamp | chrono::time_point&lt;std::chrono::system_clock&gt; | no | current timestamp |
155-
| tags | vector<Tag> | no | -** |
152+
| tags | vector<unsigned int> | no | -** |
156153
157154
**Default tag set is process specific and included in each metric:
158155
+ hostname
159-
+ PID
160156
+ process name
161157
162158
### Calculating derived metrics
@@ -186,9 +182,9 @@ The following metrics are generated every interval:
186182
+ **memoryUsagePercentage** - ratio of the process's resident set size to the physical memory on the machine, expressed as a percentage (Linux only)
187183

188184
### Automatic metric updates
189-
When global, higher level metrics are created it's necessary to provide values every interval of time (even though values does not change). This can be done using `AutoPushMetric`. The
185+
Sometimes it's necessary to provide value every exact interval of time (even though value does not change). This can be done using `AutoPushMetric`.
190186
```cpp
191-
Metric& metric = monitoring->getAutoPushMetric("exampleMetric");
187+
ComplexMetric& metric = monitoring->getAutoPushMetric("exampleMetric");
192188
metric = 10;
193189
```
194190
See how it works in the example: [examples/11-AutoUpdate.cxx](examples/11-AutoUpdate.cxx).

0 commit comments

Comments
 (0)