aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/monlib/metrics/metric.h
diff options
context:
space:
mode:
authorVladimir Gordiychuk <folyga@gmail.com>2022-02-10 16:50:21 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:50:21 +0300
commite7bf3caf59ff1d3936047c1800d0b9adaba5b647 (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/monlib/metrics/metric.h
parent9315561a79f8c08b28065daf027ef493ae27a6d2 (diff)
downloadydb-e7bf3caf59ff1d3936047c1800d0b9adaba5b647.tar.gz
Restoring authorship annotation for Vladimir Gordiychuk <folyga@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/monlib/metrics/metric.h')
-rw-r--r--library/cpp/monlib/metrics/metric.h246
1 files changed, 123 insertions, 123 deletions
diff --git a/library/cpp/monlib/metrics/metric.h b/library/cpp/monlib/metrics/metric.h
index 8794177e7e..b8ce12d753 100644
--- a/library/cpp/monlib/metrics/metric.h
+++ b/library/cpp/monlib/metrics/metric.h
@@ -33,14 +33,14 @@ namespace NMonitoring {
}
};
- class ILazyGauge: public IMetric {
- public:
- EMetricType Type() const noexcept final {
- return EMetricType::GAUGE;
- }
- virtual double Get() const noexcept = 0;
- };
-
+ class ILazyGauge: public IMetric {
+ public:
+ EMetricType Type() const noexcept final {
+ return EMetricType::GAUGE;
+ }
+ virtual double Get() const noexcept = 0;
+ };
+
class IIntGauge: public IMetric {
public:
EMetricType Type() const noexcept final {
@@ -63,15 +63,15 @@ namespace NMonitoring {
}
};
- class ILazyIntGauge: public IMetric {
- public:
- EMetricType Type() const noexcept final {
- return EMetricType::IGAUGE;
- }
-
- virtual i64 Get() const noexcept = 0;
- };
-
+ class ILazyIntGauge: public IMetric {
+ public:
+ EMetricType Type() const noexcept final {
+ return EMetricType::IGAUGE;
+ }
+
+ virtual i64 Get() const noexcept = 0;
+ };
+
class ICounter: public IMetric {
public:
EMetricType Type() const noexcept final {
@@ -87,15 +87,15 @@ namespace NMonitoring {
virtual void Reset() noexcept = 0;
};
- class ILazyCounter: public IMetric {
- public:
- EMetricType Type() const noexcept final {
- return EMetricType::COUNTER;
- }
-
- virtual ui64 Get() const noexcept = 0;
- };
-
+ class ILazyCounter: public IMetric {
+ public:
+ EMetricType Type() const noexcept final {
+ return EMetricType::COUNTER;
+ }
+
+ virtual ui64 Get() const noexcept = 0;
+ };
+
class IRate: public IMetric {
public:
EMetricType Type() const noexcept final {
@@ -111,15 +111,15 @@ namespace NMonitoring {
virtual void Reset() noexcept = 0;
};
- class ILazyRate: public IMetric {
- public:
- EMetricType Type() const noexcept final {
- return EMetricType::RATE;
- }
-
- virtual ui64 Get() const noexcept = 0;
- };
-
+ class ILazyRate: public IMetric {
+ public:
+ EMetricType Type() const noexcept final {
+ return EMetricType::RATE;
+ }
+
+ virtual ui64 Get() const noexcept = 0;
+ };
+
class IHistogram: public IMetric {
public:
explicit IHistogram(bool isRate)
@@ -177,28 +177,28 @@ namespace NMonitoring {
};
///////////////////////////////////////////////////////////////////////////////
- // TLazyGauge
- ///////////////////////////////////////////////////////////////////////////////
- class TLazyGauge final: public ILazyGauge {
- public:
- explicit TLazyGauge(std::function<double()> supplier)
- : Supplier_(std::move(supplier))
- {
- }
-
- double Get() const noexcept override {
- return Supplier_();
- }
-
- void Accept(TInstant time, IMetricConsumer* consumer) const override {
- consumer->OnDouble(time, Get());
- }
-
- private:
- std::function<double()> Supplier_;
- };
-
- ///////////////////////////////////////////////////////////////////////////////
+ // TLazyGauge
+ ///////////////////////////////////////////////////////////////////////////////
+ class TLazyGauge final: public ILazyGauge {
+ public:
+ explicit TLazyGauge(std::function<double()> supplier)
+ : Supplier_(std::move(supplier))
+ {
+ }
+
+ double Get() const noexcept override {
+ return Supplier_();
+ }
+
+ void Accept(TInstant time, IMetricConsumer* consumer) const override {
+ consumer->OnDouble(time, Get());
+ }
+
+ private:
+ std::function<double()> Supplier_;
+ };
+
+ ///////////////////////////////////////////////////////////////////////////////
// TIntGauge
///////////////////////////////////////////////////////////////////////////////
class TIntGauge final: public IIntGauge {
@@ -228,28 +228,28 @@ namespace NMonitoring {
};
///////////////////////////////////////////////////////////////////////////////
- // TLazyIntGauge
- ///////////////////////////////////////////////////////////////////////////////
- class TLazyIntGauge final: public ILazyIntGauge {
- public:
- explicit TLazyIntGauge(std::function<i64()> supplier)
- : Supplier_(std::move(supplier))
- {
- }
-
- i64 Get() const noexcept override {
- return Supplier_();
- }
-
- void Accept(TInstant time, IMetricConsumer* consumer) const override {
- consumer->OnInt64(time, Get());
- }
-
- private:
- std::function<i64()> Supplier_;
- };
-
- ///////////////////////////////////////////////////////////////////////////////
+ // TLazyIntGauge
+ ///////////////////////////////////////////////////////////////////////////////
+ class TLazyIntGauge final: public ILazyIntGauge {
+ public:
+ explicit TLazyIntGauge(std::function<i64()> supplier)
+ : Supplier_(std::move(supplier))
+ {
+ }
+
+ i64 Get() const noexcept override {
+ return Supplier_();
+ }
+
+ void Accept(TInstant time, IMetricConsumer* consumer) const override {
+ consumer->OnInt64(time, Get());
+ }
+
+ private:
+ std::function<i64()> Supplier_;
+ };
+
+ ///////////////////////////////////////////////////////////////////////////////
// TCounter
///////////////////////////////////////////////////////////////////////////////
class TCounter final: public ICounter {
@@ -279,28 +279,28 @@ namespace NMonitoring {
};
///////////////////////////////////////////////////////////////////////////////
- // TLazyCounter
- ///////////////////////////////////////////////////////////////////////////////
- class TLazyCounter final: public ILazyCounter {
- public:
- explicit TLazyCounter(std::function<ui64()> supplier)
- : Supplier_(std::move(supplier))
- {
- }
-
- ui64 Get() const noexcept override {
- return Supplier_();
- }
-
- void Accept(TInstant time, IMetricConsumer* consumer) const override {
- consumer->OnUint64(time, Get());
- }
-
- private:
- std::function<ui64()> Supplier_;
- };
-
- ///////////////////////////////////////////////////////////////////////////////
+ // TLazyCounter
+ ///////////////////////////////////////////////////////////////////////////////
+ class TLazyCounter final: public ILazyCounter {
+ public:
+ explicit TLazyCounter(std::function<ui64()> supplier)
+ : Supplier_(std::move(supplier))
+ {
+ }
+
+ ui64 Get() const noexcept override {
+ return Supplier_();
+ }
+
+ void Accept(TInstant time, IMetricConsumer* consumer) const override {
+ consumer->OnUint64(time, Get());
+ }
+
+ private:
+ std::function<ui64()> Supplier_;
+ };
+
+ ///////////////////////////////////////////////////////////////////////////////
// TRate
///////////////////////////////////////////////////////////////////////////////
class TRate final: public IRate {
@@ -330,28 +330,28 @@ namespace NMonitoring {
};
///////////////////////////////////////////////////////////////////////////////
- // TLazyRate
- ///////////////////////////////////////////////////////////////////////////////
- class TLazyRate final: public ILazyRate {
- public:
- explicit TLazyRate(std::function<ui64()> supplier)
- : Supplier_(std::move(supplier))
- {
- }
-
- ui64 Get() const noexcept override {
- return Supplier_();
- }
-
- void Accept(TInstant time, IMetricConsumer* consumer) const override {
- consumer->OnUint64(time, Get());
- }
-
- private:
- std::function<ui64()> Supplier_;
- };
-
- ///////////////////////////////////////////////////////////////////////////////
+ // TLazyRate
+ ///////////////////////////////////////////////////////////////////////////////
+ class TLazyRate final: public ILazyRate {
+ public:
+ explicit TLazyRate(std::function<ui64()> supplier)
+ : Supplier_(std::move(supplier))
+ {
+ }
+
+ ui64 Get() const noexcept override {
+ return Supplier_();
+ }
+
+ void Accept(TInstant time, IMetricConsumer* consumer) const override {
+ consumer->OnUint64(time, Get());
+ }
+
+ private:
+ std::function<ui64()> Supplier_;
+ };
+
+ ///////////////////////////////////////////////////////////////////////////////
// THistogram
///////////////////////////////////////////////////////////////////////////////
class THistogram final: public IHistogram {