aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2024-08-12 19:15:43 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2024-08-12 19:29:19 +0300
commitc1df86f69d5fe6dda5a7248f232b9f2c4adb0ef3 (patch)
tree1ef846383d2a0ee75f5516631b6679a7da84e008
parent63e00b040bda0f49cd303babce3a27e0bcb3a473 (diff)
downloadydb-c1df86f69d5fe6dda5a7248f232b9f2c4adb0ef3.tar.gz
Intermediate changes
-rw-r--r--yt/yt/library/profiling/sensors_owner/sensors_owner.cpp6
-rw-r--r--yt/yt/library/profiling/sensors_owner/sensors_owner.h3
2 files changed, 9 insertions, 0 deletions
diff --git a/yt/yt/library/profiling/sensors_owner/sensors_owner.cpp b/yt/yt/library/profiling/sensors_owner/sensors_owner.cpp
index b29b612c6d..55db938c05 100644
--- a/yt/yt/library/profiling/sensors_owner/sensors_owner.cpp
+++ b/yt/yt/library/profiling/sensors_owner/sensors_owner.cpp
@@ -46,6 +46,7 @@ struct TSensorWrapper
using TCounterWrapper = TSensorWrapper<TCounter>::template TImpl<&TProfiler::Counter>;
using TGaugeWrapper = TSensorWrapper<TGauge>::template TImpl<&TProfiler::Gauge>;
+using TTimeGaugeWrapper = TSensorWrapper<TTimeGauge>::template TImpl<&TProfiler::TimeGauge>;
template <typename... Args>
using TTimeHistogramWrapper = typename TSensorWrapper<TEventTimer, Args...>::template TImpl<&TProfiler::TimeHistogram>;
@@ -149,6 +150,11 @@ const TGauge& TSensorsOwner::GetGauge(TStringBuf name) const
return Get<TGaugeWrapper>(name).Sensor;
}
+const TTimeGauge& TSensorsOwner::GetTimeGauge(TStringBuf name) const
+{
+ return Get<TTimeGaugeWrapper>(name).Sensor;
+}
+
const TEventTimer& TSensorsOwner::GetTimeHistogram(TStringBuf name, std::vector<TDuration> bounds) const
{
return Get<TTimeHistogramWrapper<std::vector<TDuration>>>(name, std::move(bounds)).Sensor;
diff --git a/yt/yt/library/profiling/sensors_owner/sensors_owner.h b/yt/yt/library/profiling/sensors_owner/sensors_owner.h
index 14f0dd9cfd..77d4ec3ad4 100644
--- a/yt/yt/library/profiling/sensors_owner/sensors_owner.h
+++ b/yt/yt/library/profiling/sensors_owner/sensors_owner.h
@@ -82,6 +82,9 @@ public:
//! Gets owned gauge with given metric suffix.
const TGauge& GetGauge(TStringBuf name) const;
+ //! Gets owned time gauge with given metric suffix.
+ const TTimeGauge& GetTimeGauge(TStringBuf name) const;
+
//! Gets owned TimeHistogram with given metric suffix using bounds as a constructor argument.
const TEventTimer& GetTimeHistogram(TStringBuf name, std::vector<TDuration> bounds) const;