Skip to content

Commit ff08899

Browse files
committed
Intermediate changes
commit_hash:e2dca294df4458422157edde71bdd5d080ca077f
1 parent d225e23 commit ff08899

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

yt/yt/library/profiling/sensors_owner/sensors_owner.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ struct TSensorWrapper
4747
using TCounterWrapper = TSensorWrapper<TCounter>::template TImpl<&TProfiler::Counter>;
4848
using TGaugeWrapper = TSensorWrapper<TGauge>::template TImpl<&TProfiler::Gauge>;
4949
using TTimeGaugeWrapper = TSensorWrapper<TTimeGauge>::template TImpl<&TProfiler::TimeGauge>;
50+
using TTimerWrapper = TSensorWrapper<TEventTimer>::template TImpl<&TProfiler::Timer>;
5051

5152
template <typename... Args>
5253
using TTimeHistogramWrapper = typename TSensorWrapper<TEventTimer, Args...>::template TImpl<&TProfiler::TimeHistogram>;
@@ -155,6 +156,11 @@ const TTimeGauge& TSensorsOwner::GetTimeGauge(const std::string& name) const
155156
return Get<TTimeGaugeWrapper>(name).Sensor;
156157
}
157158

159+
const TEventTimer& TSensorsOwner::GetTimer(const std::string& name) const
160+
{
161+
return Get<TTimerWrapper>(name).Sensor;
162+
}
163+
158164
const TEventTimer& TSensorsOwner::GetTimeHistogram(const std::string& name, std::vector<TDuration> bounds) const
159165
{
160166
return Get<TTimeHistogramWrapper<std::vector<TDuration>>>(name, std::move(bounds)).Sensor;

yt/yt/library/profiling/sensors_owner/sensors_owner.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ class TSensorsOwner
8585
//! Gets owned time gauge with given metric suffix.
8686
const TTimeGauge& GetTimeGauge(const std::string& name) const;
8787

88+
//! Gets owned timer with given metric suffix.
89+
const TEventTimer& GetTimer(const std::string& name) const;
90+
8891
//! Gets owned TimeHistogram with given metric suffix using bounds as a constructor argument.
8992
const TEventTimer& GetTimeHistogram(const std::string& name, std::vector<TDuration> bounds) const;
9093

0 commit comments

Comments
 (0)