aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/monlib/metrics/metric.h
diff options
context:
space:
mode:
authorivanzhukov <ivanzhukov@yandex-team.ru>2022-02-10 16:49:40 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:49:40 +0300
commit0892d79ab411592ad25175c4bdadbcb09b466cf5 (patch)
tree98dfdd45463c9bd747101748a9ca25d2917390fd /library/cpp/monlib/metrics/metric.h
parent1b7466cb957659079ebebbb5d76e64e51f3306f0 (diff)
downloadydb-0892d79ab411592ad25175c4bdadbcb09b466cf5.tar.gz
Restoring authorship annotation for <ivanzhukov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/monlib/metrics/metric.h')
-rw-r--r--library/cpp/monlib/metrics/metric.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/library/cpp/monlib/metrics/metric.h b/library/cpp/monlib/metrics/metric.h
index b8ce12d753..d91dbac9a2 100644
--- a/library/cpp/monlib/metrics/metric.h
+++ b/library/cpp/monlib/metrics/metric.h
@@ -152,14 +152,14 @@ namespace NMonitoring {
double Add(double n) noexcept override {
double newValue;
double oldValue = Get();
-
- do {
+
+ do {
newValue = oldValue + n;
} while (!Value_.compare_exchange_weak(oldValue, newValue, std::memory_order_release, std::memory_order_consume));
-
+
return newValue;
- }
-
+ }
+
void Set(double n) noexcept override {
Value_.store(n, std::memory_order_relaxed);
}
@@ -209,8 +209,8 @@ namespace NMonitoring {
i64 Add(i64 n) noexcept override {
return Value_.fetch_add(n, std::memory_order_relaxed) + n;
- }
-
+ }
+
void Set(i64 value) noexcept override {
Value_.store(value, std::memory_order_relaxed);
}