histo
This commit is contained in:
20
tp2.md
20
tp2.md
@@ -183,3 +183,23 @@ Ajouter un histogramme pour le volume dans le réservoir
|
|||||||
- 8
|
- 8
|
||||||
- 9
|
- 9
|
||||||
- 9.5
|
- 9.5
|
||||||
|
|
||||||
|
```
|
||||||
|
#include <prometheus/histogram.h>
|
||||||
|
|
||||||
|
|
||||||
|
Histogram::BucketBoundaries buckets = {
|
||||||
|
2, 5, 6, 7, 8, 9, 9.5
|
||||||
|
};
|
||||||
|
|
||||||
|
auto& hist_family = BuildHistogram()
|
||||||
|
.Name("volume")
|
||||||
|
.Help("volume du reservoir en m3")
|
||||||
|
.Register(*registry);
|
||||||
|
|
||||||
|
auto& request_volume = hist_family.Add({}, buckets);
|
||||||
|
|
||||||
|
auto& request_duration_login =
|
||||||
|
hist_family.Add({{"endpoint", "/login"}}, buckets);
|
||||||
|
|
||||||
|
request_duration_login.Observe(0.42);
|
||||||
|
|||||||
Reference in New Issue
Block a user