diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2024-11-14 10:29:04 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2024-11-14 10:37:01 +0300 |
commit | ff08899f35c35434c56cfb49f1d6d849ed91d228 (patch) | |
tree | 00fe8c2807cdf5f26c553bf9215c8ec70329a925 | |
parent | d225e2343d59698ea86585da575d40e9eb14159c (diff) | |
download | ydb-ff08899f35c35434c56cfb49f1d6d849ed91d228.tar.gz |
Intermediate changes
commit_hash:e2dca294df4458422157edde71bdd5d080ca077f
-rw-r--r-- | yt/yt/library/profiling/sensors_owner/sensors_owner.cpp | 6 | ||||
-rw-r--r-- | yt/yt/library/profiling/sensors_owner/sensors_owner.h | 3 |
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 e0df958c57..2caa2ec098 100644 --- a/yt/yt/library/profiling/sensors_owner/sensors_owner.cpp +++ b/yt/yt/library/profiling/sensors_owner/sensors_owner.cpp @@ -47,6 +47,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>; +using TTimerWrapper = TSensorWrapper<TEventTimer>::template TImpl<&TProfiler::Timer>; template <typename... Args> using TTimeHistogramWrapper = typename TSensorWrapper<TEventTimer, Args...>::template TImpl<&TProfiler::TimeHistogram>; @@ -155,6 +156,11 @@ const TTimeGauge& TSensorsOwner::GetTimeGauge(const std::string& name) const return Get<TTimeGaugeWrapper>(name).Sensor; } +const TEventTimer& TSensorsOwner::GetTimer(const std::string& name) const +{ + return Get<TTimerWrapper>(name).Sensor; +} + const TEventTimer& TSensorsOwner::GetTimeHistogram(const std::string& 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 2b33e6ba0b..b4b0d6e698 100644 --- a/yt/yt/library/profiling/sensors_owner/sensors_owner.h +++ b/yt/yt/library/profiling/sensors_owner/sensors_owner.h @@ -85,6 +85,9 @@ public: //! Gets owned time gauge with given metric suffix. const TTimeGauge& GetTimeGauge(const std::string& name) const; + //! Gets owned timer with given metric suffix. + const TEventTimer& GetTimer(const std::string& name) const; + //! Gets owned TimeHistogram with given metric suffix using bounds as a constructor argument. const TEventTimer& GetTimeHistogram(const std::string& name, std::vector<TDuration> bounds) const; |