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
Where metric constructor receives following parameters:
91
91
- `T value`
92
92
- `std::string& name`
93
-
-`[time_point<system_clock> timestamp]`
94
93
94
+
See how it works in the example: [examples/1-Basic.cxx](examples/1-Basic.cxx).
95
95
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.
97
97
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).
99
103
100
104
### Debug metrics
101
105
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
109
113
-`/prod` - only `send` metrics are passed to the backend
110
114
-`/debug` - all the metrics are passed to the backend
111
115
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
-
119
116
## Features and additional information
120
117
121
118
### Sending more than one metric
@@ -135,7 +132,7 @@ See how it works in the example: [examples/8-Multiple.cxx](examples/8-Multiple.c
135
132
In order to avoid sending each metric separately, metrics can be temporary stored in the buffer and flushed at the most convenient moment.
136
133
This feature can be operated with following two methods:
137
134
```cpp
138
-
monitoring->enableBuffering(const unsigned int maxSize)
@@ -152,11 +149,10 @@ Metrics consist of 4 parameters: name, value, timestamp and tags.
152
149
| name | string | yes | - |
153
150
| value | int / double / string / uint64_t | yes | - |
154
151
| timestamp | chrono::time_point<std::chrono::system_clock> | no | current timestamp |
155
-
| tags | vector<Tag> | no | -**|
152
+
| tags | vector<unsigned int> | no | -** |
156
153
157
154
**Default tag set is process specific and included in each metric:
158
155
+ hostname
159
-
+ PID
160
156
+ process name
161
157
162
158
### Calculating derived metrics
@@ -186,9 +182,9 @@ The following metrics are generated every interval:
186
182
+**memoryUsagePercentage** - ratio of the process's resident set size to the physical memory on the machine, expressed as a percentage (Linux only)
187
183
188
184
### 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`.
0 commit comments