Skip to content

Commit 205da07

Browse files
author
babenko
committed
YT_DEFINE_GLOBAL for profilers
commit_hash:c9f0f790039ceeef149366a14c9063025fbb1e0c
1 parent e2791d7 commit 205da07

File tree

12 files changed

+17
-17
lines changed

12 files changed

+17
-17
lines changed

yt/yt/core/bus/private.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace NYT::NBus {
1313
////////////////////////////////////////////////////////////////////////////////
1414

1515
YT_DEFINE_GLOBAL(const NLogging::TLogger, BusLogger, "Bus");
16-
inline const NProfiling::TProfiler BusProfiler("/bus");
16+
YT_DEFINE_GLOBAL(const NProfiling::TProfiler, BusProfiler, "/bus");
1717

1818
using TConnectionId = TGuid;
1919
using TPacketId = TGuid;

yt/yt/core/bus/tcp/dispatcher.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace NYT::NBus {
1010
TTcpDispatcher::TTcpDispatcher()
1111
: Impl_(New<TImpl>())
1212
{
13-
BusProfiler.WithSparse().AddProducer("", Impl_);
13+
BusProfiler().WithSparse().AddProducer("", Impl_);
1414
}
1515

1616
TTcpDispatcher* TTcpDispatcher::Get()

yt/yt/core/concurrency/delayed_executor.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,10 @@ class TDelayedExecutorImpl
239239
TActionQueuePtr DelayedQueue_;
240240
IInvokerPtr DelayedInvoker_;
241241

242-
NProfiling::TGauge ScheduledCallbacksGauge_ = ConcurrencyProfiler.Gauge("/delayed_executor/scheduled_callbacks");
243-
NProfiling::TCounter SubmittedCallbacksCounter_ = ConcurrencyProfiler.Counter("/delayed_executor/submitted_callbacks");
244-
NProfiling::TCounter CanceledCallbacksCounter_ = ConcurrencyProfiler.Counter("/delayed_executor/canceled_callbacks");
245-
NProfiling::TCounter StaleCallbacksCounter_ = ConcurrencyProfiler.Counter("/delayed_executor/stale_callbacks");
242+
NProfiling::TGauge ScheduledCallbacksGauge_ = ConcurrencyProfiler().Gauge("/delayed_executor/scheduled_callbacks");
243+
NProfiling::TCounter SubmittedCallbacksCounter_ = ConcurrencyProfiler().Counter("/delayed_executor/submitted_callbacks");
244+
NProfiling::TCounter CanceledCallbacksCounter_ = ConcurrencyProfiler().Counter("/delayed_executor/canceled_callbacks");
245+
NProfiling::TCounter StaleCallbacksCounter_ = ConcurrencyProfiler().Counter("/delayed_executor/stale_callbacks");
246246

247247
class TCallbackGuard
248248
{

yt/yt/core/concurrency/private.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ DECLARE_REFCOUNTED_STRUCT(IFairShareCallbackQueue)
5353
////////////////////////////////////////////////////////////////////////////////
5454

5555
YT_DEFINE_GLOBAL(const NLogging::TLogger, ConcurrencyLogger, "Concurrency");
56-
inline const NProfiling::TProfiler ConcurrencyProfiler("/concurrency");
56+
YT_DEFINE_GLOBAL(const NProfiling::TProfiler, ConcurrencyProfiler, "/concurrency");
5757

5858
////////////////////////////////////////////////////////////////////////////////
5959

yt/yt/core/dns/ares_dns_resolver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ class TAresDnsResolver
180180
private:
181181
const TAresDnsResolverConfigPtr Config_;
182182

183-
const NProfiling::TProfiler Profiler_ = DnsProfiler.WithPrefix("/ares_resolver");
183+
const NProfiling::TProfiler Profiler_ = DnsProfiler().WithPrefix("/ares_resolver");
184184
const NProfiling::TCounter RequestCounter_ = Profiler_.Counter("/request_count");
185185
const NProfiling::TCounter FailureCounter_ = Profiler_.Counter("/failure_count");
186186
const NProfiling::TCounter TimeoutCounter_ = Profiler_.Counter("/timeout_count");

yt/yt/core/dns/private.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace NYT::NDns {
1111
////////////////////////////////////////////////////////////////////////////////
1212

1313
YT_DEFINE_GLOBAL(const NLogging::TLogger, DnsLogger, "Dns");
14-
inline const NProfiling::TProfiler DnsProfiler("/dns");
14+
YT_DEFINE_GLOBAL(const NProfiling::TProfiler, DnsProfiler, "/dns");
1515

1616
////////////////////////////////////////////////////////////////////////////////
1717

yt/yt/core/net/address.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,7 @@ class TAddressResolver::TImpl
987987
: TAsyncExpiringCache(
988988
config,
989989
/*logger*/ {},
990-
DnsProfiler.WithPrefix("/resolve_cache"))
990+
DnsProfiler().WithPrefix("/resolve_cache"))
991991
{
992992
Configure(std::move(config));
993993
}

yt/yt/core/rpc/channel_detail.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ auto TClientRequestPerformanceProfiler::GetPerformanceCounters(
203203
using TCountersMap = NConcurrency::TSyncMap<std::pair<std::string, std::string>, TPerformanceCounters>;
204204

205205
auto [counter, _] = LeakySingleton<TCountersMap>()->FindOrInsert(std::pair(service, method), [&] {
206-
auto profiler = RpcClientProfiler
206+
auto profiler = RpcClientProfiler()
207207
.WithHot()
208208
.WithTag("yt_service", service)
209209
.WithTag("method", method, -1);

yt/yt/core/rpc/grpc/private.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace NYT::NRpc::NGrpc {
2222

2323
////////////////////////////////////////////////////////////////////////////////
2424

25-
inline const NProfiling::TProfiler GrpcServerProfiler("/grpc/server");
25+
YT_DEFINE_GLOBAL(const NProfiling::TProfiler, GrpcServerProfiler, "/grpc/server");
2626

2727
////////////////////////////////////////////////////////////////////////////////
2828

yt/yt/core/rpc/grpc/server.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class TServer
7575
BIND_NO_PROPAGATE(&TServer::Shutdown, MakeWeak(this), /*graceful*/ true),
7676
/*priority*/ GrpcServerShutdownPriority))
7777
, LibraryLock_(TDispatcher::Get()->GetLibraryLock())
78-
, Profiler_(GrpcServerProfiler.WithTag("name", Config_->ProfilingName))
78+
, Profiler_(GrpcServerProfiler().WithTag("name", Config_->ProfilingName))
7979
, CompletionQueue_(TDispatcher::Get()->PickRandomGuardedCompletionQueue()->UnwrapUnsafe())
8080
{
8181
Profiler_.AddFuncGauge("/call_handler_count", MakeStrong(this), [this] {

0 commit comments

Comments
 (0)