aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvadim-xd <vadim-xd@yandex-team.com>2024-10-01 14:31:53 +0300
committervadim-xd <vadim-xd@yandex-team.com>2024-10-01 14:43:22 +0300
commitaf48ba2c77c5cee782c174e7f091e3b3b84c20b4 (patch)
tree4cca68ab97b28bcb73b3d98ad0c2392c93138fb1
parente2a808cdb1ed0d2c1c217498c5940e95be78b2a5 (diff)
downloadydb-af48ba2c77c5cee782c174e7f091e3b3b84c20b4.tar.gz
Make NMonitoring::IHistogram write methods noexcept
commit_hash:e67a69864ab541f86bd413dfa8df106a77d05b71
-rw-r--r--library/cpp/monlib/metrics/fake.h6
-rw-r--r--library/cpp/monlib/metrics/histogram_collector.h6
-rw-r--r--library/cpp/monlib/metrics/histogram_collector_explicit.cpp4
-rw-r--r--library/cpp/monlib/metrics/histogram_collector_exponential.cpp4
-rw-r--r--library/cpp/monlib/metrics/histogram_collector_linear.cpp4
-rw-r--r--library/cpp/monlib/metrics/metric.h12
6 files changed, 18 insertions, 18 deletions
diff --git a/library/cpp/monlib/metrics/fake.h b/library/cpp/monlib/metrics/fake.h
index b61f80fb41..b01ff2505a 100644
--- a/library/cpp/monlib/metrics/fake.h
+++ b/library/cpp/monlib/metrics/fake.h
@@ -131,11 +131,11 @@ namespace NMonitoring {
{
}
- void Record(double value) override {
+ void Record(double value) noexcept override {
Y_UNUSED(value);
}
- void Record(double value, ui32 count) override {
+ void Record(double value, ui32 count) noexcept override {
Y_UNUSED(value, count);
}
@@ -147,7 +147,7 @@ namespace NMonitoring {
Y_UNUSED(time, consumer);
}
- void Reset() override {
+ void Reset() noexcept override {
}
};
diff --git a/library/cpp/monlib/metrics/histogram_collector.h b/library/cpp/monlib/metrics/histogram_collector.h
index 177d779634..718aa42bd2 100644
--- a/library/cpp/monlib/metrics/histogram_collector.h
+++ b/library/cpp/monlib/metrics/histogram_collector.h
@@ -14,12 +14,12 @@ namespace NMonitoring {
/**
* Store {@code count} times given {@code value} in this collector.
*/
- virtual void Collect(double value, ui64 count) = 0;
+ virtual void Collect(double value, ui64 count) noexcept = 0;
/**
* Store given {@code value} in this collector.
*/
- void Collect(double value) {
+ void Collect(double value) noexcept {
Collect(value, 1);
}
@@ -35,7 +35,7 @@ namespace NMonitoring {
/**
* Reset collector values
*/
- virtual void Reset() = 0;
+ virtual void Reset() noexcept = 0;
/**
* @return snapshot of the state of this collector.
diff --git a/library/cpp/monlib/metrics/histogram_collector_explicit.cpp b/library/cpp/monlib/metrics/histogram_collector_explicit.cpp
index a567573a02..e0422b578e 100644
--- a/library/cpp/monlib/metrics/histogram_collector_explicit.cpp
+++ b/library/cpp/monlib/metrics/histogram_collector_explicit.cpp
@@ -21,13 +21,13 @@ namespace NMonitoring {
Bounds_.push_back(Max<TBucketBound>());
}
- void Collect(double value, ui64 count) override {
+ void Collect(double value, ui64 count) noexcept override {
auto it = LowerBound(Bounds_.begin(), Bounds_.end(), value);
auto index = std::distance(Bounds_.begin(), it);
Values_.Add(index, count);
}
- void Reset() override {
+ void Reset() noexcept override {
Values_.Reset();
}
diff --git a/library/cpp/monlib/metrics/histogram_collector_exponential.cpp b/library/cpp/monlib/metrics/histogram_collector_exponential.cpp
index c6bbfcfc69..73657cda56 100644
--- a/library/cpp/monlib/metrics/histogram_collector_exponential.cpp
+++ b/library/cpp/monlib/metrics/histogram_collector_exponential.cpp
@@ -22,7 +22,7 @@ namespace NMonitoring {
{
}
- void Collect(double value, ui64 count) override {
+ void Collect(double value, ui64 count) noexcept override {
ui32 index = Max<ui32>();
if (value <= MinValue_) {
index = 0;
@@ -35,7 +35,7 @@ namespace NMonitoring {
Values_.Add(index, count);
}
- void Reset() override {
+ void Reset() noexcept override {
Values_.Reset();
}
diff --git a/library/cpp/monlib/metrics/histogram_collector_linear.cpp b/library/cpp/monlib/metrics/histogram_collector_linear.cpp
index 8342485320..b893b16a83 100644
--- a/library/cpp/monlib/metrics/histogram_collector_linear.cpp
+++ b/library/cpp/monlib/metrics/histogram_collector_linear.cpp
@@ -23,7 +23,7 @@ namespace NMonitoring {
{
}
- void Collect(double value, ui64 count) override {
+ void Collect(double value, ui64 count) noexcept override {
ui32 index = Max<ui32>();
if (value <= StartValue_) {
index = 0;
@@ -36,7 +36,7 @@ namespace NMonitoring {
Values_.Add(index, count);
}
- void Reset() override {
+ void Reset() noexcept override {
Values_.Reset();
}
diff --git a/library/cpp/monlib/metrics/metric.h b/library/cpp/monlib/metrics/metric.h
index cf736e8d80..2f7d9de687 100644
--- a/library/cpp/monlib/metrics/metric.h
+++ b/library/cpp/monlib/metrics/metric.h
@@ -131,10 +131,10 @@ namespace NMonitoring {
return IsRate_ ? EMetricType::HIST_RATE : EMetricType::HIST;
}
- virtual void Record(double value) = 0;
- virtual void Record(double value, ui32 count) = 0;
+ virtual void Record(double value) noexcept = 0;
+ virtual void Record(double value, ui32 count) noexcept = 0;
virtual IHistogramSnapshotPtr TakeSnapshot() const = 0;
- virtual void Reset() = 0;
+ virtual void Reset() noexcept = 0;
protected:
const bool IsRate_;
@@ -368,11 +368,11 @@ namespace NMonitoring {
{
}
- void Record(double value) override {
+ void Record(double value) noexcept override {
Collector_->Collect(value);
}
- void Record(double value, ui32 count) override {
+ void Record(double value, ui32 count) noexcept override {
Collector_->Collect(value, count);
}
@@ -384,7 +384,7 @@ namespace NMonitoring {
return Collector_->Snapshot();
}
- void Reset() override {
+ void Reset() noexcept override {
Collector_->Reset();
}