]>
Commit | Line | Data |
---|---|---|
1e59de90 TL |
1 | #include "prometheus/counter.h" |
2 | ||
3 | namespace prometheus { | |
4 | ||
5 | void Counter::Increment() { gauge_.Increment(); } | |
6 | ||
7 | void Counter::Increment(const double val) { | |
8 | if (val < 0.0) { | |
9 | return; | |
10 | } | |
11 | gauge_.Increment(val); | |
12 | } | |
13 | ||
14 | double Counter::Value() const { return gauge_.Value(); } | |
15 | ||
16 | ClientMetric Counter::Collect() const { | |
17 | ClientMetric metric; | |
18 | metric.counter.value = Value(); | |
19 | return metric; | |
20 | } | |
21 | ||
22 | } // namespace prometheus |