From 1715700d00b30399d3648be821fd585ae552365e Mon Sep 17 00:00:00 2001 From: gusev-p <gusev-p@yandex-team.ru> Date: Thu, 10 Feb 2022 16:47:20 +0300 Subject: Restoring authorship annotation for <gusev-p@yandex-team.ru>. Commit 1 of 2. --- library/cpp/monlib/metrics/metric_value.h | 36 +++++++++++++++---------------- 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'library/cpp/monlib/metrics') diff --git a/library/cpp/monlib/metrics/metric_value.h b/library/cpp/monlib/metrics/metric_value.h index 607fcc8602..5f235e7a0b 100644 --- a/library/cpp/monlib/metrics/metric_value.h +++ b/library/cpp/monlib/metrics/metric_value.h @@ -384,35 +384,35 @@ namespace NMonitoring { template <typename T> void Add(TInstant time, T value) { - Add(TPoint(time, value), TValueType<T>::Type); - } - - void Add(TPoint point, EMetricValueType valueType) { + Add(TPoint(time, value), TValueType<T>::Type); + } + + void Add(TPoint point, EMetricValueType valueType) { if (Empty()) { - ValueType_ = valueType; + ValueType_ = valueType; } else { - CheckTypes(ValueType_, valueType); + CheckTypes(ValueType_, valueType); } - Points_.push_back(point); + Points_.push_back(point); if (ValueType_ == EMetricValueType::SUMMARY) { - TPoint& p = Points_.back(); - p.GetValue().AsSummaryDouble()->Ref(); + TPoint& p = Points_.back(); + p.GetValue().AsSummaryDouble()->Ref(); } else if (ValueType_ == EMetricValueType::HISTOGRAM) { - TPoint& p = Points_.back(); - p.GetValue().AsHistogram()->Ref(); + TPoint& p = Points_.back(); + p.GetValue().AsHistogram()->Ref(); } else if (ValueType_ == EMetricValueType::LOGHISTOGRAM) { - TPoint& p = Points_.back(); - p.GetValue().AsLogHistogram()->Ref(); + TPoint& p = Points_.back(); + p.GetValue().AsLogHistogram()->Ref(); } } void CopyFrom(const TMetricTimeSeries& other) { - if (Empty()) { - ValueType_ = other.ValueType_; - } else { - CheckTypes(GetValueType(), other.GetValueType()); - } + if (Empty()) { + ValueType_ = other.ValueType_; + } else { + CheckTypes(GetValueType(), other.GetValueType()); + } size_t prevSize = Points_.size(); Copy(std::begin(other.Points_), std::end(other.Points_), -- cgit v1.2.3