#ifndef SLED_METRIC_GAUGE_H
#define SLED_METRIC_GAUGE_H

#pragma once

namespace sled {
namespace metric {
class Gauge {
public:
    Gauge() = default;
    explicit Gauge(double value);

    void Increment();
    void Increment(double value);

    void Decrement();
    void Decrement(double value);

    void Set(double value);
    // set the gauge to the current unix timestamp
    void SetToCurrentTime();

    double Value() const;

private:
    void Change(double delta);
    std::atomic<double> value_{0.0};
};
}// namespace metric
}// namespace sled

#endif// SLED_METRIC_GAUGE_H
