13 #ifndef __PROCESS_METRICS_COUNTER_HPP__ 14 #define __PROCESS_METRICS_COUNTER_HPP__ 36 push(static_cast<double>(data->value.load()));
43 return static_cast<double>(data->value.load());
66 int64_t prev = data->value.fetch_add(v);
67 push(static_cast<double>(prev + v));
74 explicit Data() :
value(0) {}
76 std::atomic<int64_t>
value;
79 std::shared_ptr<Data> data;
85 #endif // __PROCESS_METRICS_COUNTER_HPP__
Definition: metric.hpp:33
Counter & operator++()
Definition: counter.hpp:52
Definition: counter.hpp:26
~Counter() override
Definition: counter.hpp:39
Counter operator++(int)
Definition: counter.hpp:57
Future< double > value() const override
Definition: counter.hpp:41
void reset()
Definition: counter.hpp:46
Counter & operator+=(int64_t v)
Definition: counter.hpp:64
const std::string & name() const
Definition: metric.hpp:39
Definition: executor.hpp:48
Counter(const std::string &name, const Option< Duration > &window=None())
Definition: counter.hpp:32
void push(double value)
Definition: metric.hpp:63
PID< MetricsProcess > metrics
Definition: future.hpp:58