13 #ifndef __PROCESS_METRICS_PUSH_GAUGE_HPP__ 14 #define __PROCESS_METRICS_PUSH_GAUGE_HPP__ 58 return static_cast<double>(data->value.load());
75 prev = data->value.load();
77 if (data->value.compare_exchange_weak(prev, prev + v)) {
82 push(static_cast<double>(prev + v));
93 prev = data->value.load();
95 if (data->value.compare_exchange_weak(prev, prev - v)) {
100 push(static_cast<double>(prev - v));
107 explicit Data() :
value(0) {}
109 std::atomic<double>
value;
112 std::shared_ptr<Data> data;
118 #endif // __PROCESS_METRICS_PUSH_GAUGE_HPP__ PushGauge & operator--()
Definition: push_gauge.hpp:86
PushGauge & operator++()
Definition: push_gauge.hpp:68
PushGauge & operator=(double v)
Definition: push_gauge.hpp:61
Definition: metric.hpp:33
Future< double > value() const override
Definition: push_gauge.hpp:56
PushGauge & operator-=(double v)
Definition: push_gauge.hpp:88
~PushGauge() override
Definition: push_gauge.hpp:54
const std::string & name() const
Definition: metric.hpp:39
Definition: executor.hpp:48
PushGauge(const std::string &name)
Definition: push_gauge.hpp:51
PushGauge & operator+=(double v)
Definition: push_gauge.hpp:70
void push(double value)
Definition: metric.hpp:63
Definition: push_gauge.hpp:41
PID< MetricsProcess > metrics
Definition: future.hpp:58