aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbabenko <babenko@yandex-team.com>2024-09-11 09:53:48 +0300
committerbabenko <babenko@yandex-team.com>2024-09-11 10:05:29 +0300
commitfd5ce57a120baa3f8bf042bb7dacb3819750a71d (patch)
tree190ed501f4fb7e6424adca2eb9155f1cc7718312
parent4b4aec2e3e4cf5409f9874f6cad0bb8d2d7482e8 (diff)
downloadydb-fd5ce57a120baa3f8bf042bb7dacb3819750a71d.tar.gz
YT-22593: Drop std::string migration compats
c60c60ffac2ea21b9f2184846a0f356c45f52be1
-rw-r--r--yt/yt/client/driver/driver.cpp3
-rw-r--r--yt/yt/core/concurrency/action_queue.cpp4
-rw-r--r--yt/yt/core/concurrency/profiling_helpers.cpp12
-rw-r--r--yt/yt/core/rpc/channel_detail.cpp4
-rw-r--r--yt/yt/core/rpc/service_detail.cpp14
-rw-r--r--yt/yt/library/tracing/jaeger/sampler.cpp3
-rw-r--r--yt/yt/library/ytprof/allocation_tag_profiler/allocation_tag_profiler.cpp3
7 files changed, 19 insertions, 24 deletions
diff --git a/yt/yt/client/driver/driver.cpp b/yt/yt/client/driver/driver.cpp
index 8cdc9cbe88..19a0f3bdc5 100644
--- a/yt/yt/client/driver/driver.cpp
+++ b/yt/yt/client/driver/driver.cpp
@@ -548,8 +548,7 @@ private:
NTracing::TChildTraceContextGuard commandSpan(ConcatToString(TStringBuf("Driver:"), request.CommandName));
NTracing::AnnotateTraceContext([&] (const auto& traceContext) {
- // TODO(babenko): switch to std::string
- traceContext->AddTag("user", TString(request.AuthenticatedUser));
+ traceContext->AddTag("user", request.AuthenticatedUser);
traceContext->AddTag("request_id", request.Id);
});
diff --git a/yt/yt/core/concurrency/action_queue.cpp b/yt/yt/core/concurrency/action_queue.cpp
index 3ff52fbbc5..99e6ec94f0 100644
--- a/yt/yt/core/concurrency/action_queue.cpp
+++ b/yt/yt/core/concurrency/action_queue.cpp
@@ -253,7 +253,7 @@ IInvokerPtr CreateSerializedInvoker(IInvokerPtr underlyingInvoker, const NProfil
IInvokerPtr CreateSerializedInvoker(IInvokerPtr underlyingInvoker, const TString& invokerName, NProfiling::IRegistryImplPtr registry)
{
NProfiling::TTagSet tagSet;
- tagSet.AddTag(std::pair<TString, TString>("invoker", invokerName));
+ tagSet.AddTag(NProfiling::TTag("invoker", invokerName));
return CreateSerializedInvoker(std::move(underlyingInvoker), std::move(tagSet), std::move(registry));
}
@@ -326,7 +326,7 @@ IPrioritizedInvokerPtr CreatePrioritizedInvoker(IInvokerPtr underlyingInvoker, c
IPrioritizedInvokerPtr CreatePrioritizedInvoker(IInvokerPtr underlyingInvoker, const TString& invokerName, NProfiling::IRegistryImplPtr registry)
{
NProfiling::TTagSet tagSet;
- tagSet.AddTag(std::pair<TString, TString>("invoker", invokerName));
+ tagSet.AddTag(NProfiling::TTag("invoker", invokerName));
return CreatePrioritizedInvoker(std::move(underlyingInvoker), std::move(tagSet), std::move(registry));
}
diff --git a/yt/yt/core/concurrency/profiling_helpers.cpp b/yt/yt/core/concurrency/profiling_helpers.cpp
index b6b67994c0..1a80490da5 100644
--- a/yt/yt/core/concurrency/profiling_helpers.cpp
+++ b/yt/yt/core/concurrency/profiling_helpers.cpp
@@ -10,7 +10,7 @@ TTagSet GetThreadTags(
const TString& threadName)
{
TTagSet tags;
- tags.AddTag(std::pair<TString, TString>("thread", threadName));
+ tags.AddTag(TTag("thread", threadName));
return tags;
}
@@ -20,8 +20,8 @@ TTagSet GetBucketTags(
{
TTagSet tags;
- tags.AddTag(std::pair<TString, TString>("thread", threadName));
- tags.AddTag(std::pair<TString, TString>("bucket", bucketName), -1);
+ tags.AddTag(TTag("thread", threadName));
+ tags.AddTag(TTag("bucket", bucketName), -1);
return tags;
}
@@ -33,9 +33,9 @@ TTagSet GetQueueTags(
{
TTagSet tags;
- tags.AddTag(std::pair<TString, TString>("thread", threadName));
- tags.AddTag(std::pair<TString, TString>("bucket", bucketName), -1);
- tags.AddTag(std::pair<TString, TString>("queue", queueName), -1);
+ tags.AddTag(TTag("thread", threadName));
+ tags.AddTag(TTag("bucket", bucketName), -1);
+ tags.AddTag(TTag("queue", queueName), -1);
return tags;
}
diff --git a/yt/yt/core/rpc/channel_detail.cpp b/yt/yt/core/rpc/channel_detail.cpp
index 89750b2e6f..b6edfbb2ea 100644
--- a/yt/yt/core/rpc/channel_detail.cpp
+++ b/yt/yt/core/rpc/channel_detail.cpp
@@ -205,8 +205,8 @@ auto TClientRequestPerformanceProfiler::GetPerformanceCounters(
auto [counter, _] = LeakySingleton<TCountersMap>()->FindOrInsert(std::pair(service, method), [&] {
auto profiler = RpcClientProfiler
.WithHot()
- .WithTag("yt_service", TString(service))
- .WithTag("method", TString(method), -1);
+ .WithTag("yt_service", service)
+ .WithTag("method", method, -1);
return TPerformanceCounters(profiler);
});
return counter;
diff --git a/yt/yt/core/rpc/service_detail.cpp b/yt/yt/core/rpc/service_detail.cpp
index 09cc08b0a0..d23ef9ba4c 100644
--- a/yt/yt/core/rpc/service_detail.cpp
+++ b/yt/yt/core/rpc/service_detail.cpp
@@ -57,7 +57,7 @@ constexpr auto ServiceLivenessCheckPeriod = TDuration::MilliSeconds(100);
TRequestQueuePtr CreateRequestQueue(const std::string& name, const NProfiling::TProfiler& profiler)
{
// TODO(babenko): migrate to std::string
- return New<TRequestQueue>(name, profiler.WithTag("user", TString(name)));
+ return New<TRequestQueue>(name, profiler.WithTag("user", std::string(name)));
}
////////////////////////////////////////////////////////////////////////////////
@@ -1643,7 +1643,7 @@ TServiceBase::TServiceBase(
, MemoryUsageTracker_(std::move(options.MemoryUsageTracker))
, Profiler_(RpcServerProfiler
.WithHot(options.UseHotProfiler)
- .WithTag("yt_service", TString(ServiceId_.ServiceName)))
+ .WithTag("yt_service", ServiceId_.ServiceName))
, AuthenticationTimer_(Profiler_.Timer("/authentication_time"))
, ServiceLivenessChecker_(New<TPeriodicExecutor>(
TDispatcher::Get()->GetLightInvoker(),
@@ -1933,8 +1933,7 @@ void TServiceBase::RegisterRequestQueue(
auto profiler = runtimeInfo->Profiler.WithSparse();
if (runtimeInfo->Descriptor.RequestQueueProvider) {
- // TODO(babenko): switch to std::string
- profiler = profiler.WithTag("queue", TString(requestQueue->GetName()));
+ profiler = profiler.WithTag("queue", requestQueue->GetName());
}
profiler.AddFuncGauge("/request_queue_size", MakeStrong(this), [=] {
return requestQueue->GetQueueSize();
@@ -2327,12 +2326,11 @@ TServiceBase::TMethodPerformanceCountersPtr TServiceBase::CreateMethodPerformanc
auto profiler = runtimeInfo->Profiler.WithSparse();
if (userTag) {
- // TODO(babenko): switch to std::string
- profiler = profiler.WithTag("user", TString(userTag));
+ // TODO(babenko): migrate to std::string
+ profiler = profiler.WithTag("user", std::string(userTag));
}
if (runtimeInfo->Descriptor.RequestQueueProvider) {
- // TODO(babenko): switch to std::string
- profiler = profiler.WithTag("queue", TString(requestQueue->GetName()));
+ profiler = profiler.WithTag("queue", requestQueue->GetName());
}
return New<TMethodPerformanceCounters>(profiler, TimeHistogramConfig_.Acquire());
}
diff --git a/yt/yt/library/tracing/jaeger/sampler.cpp b/yt/yt/library/tracing/jaeger/sampler.cpp
index d33623f532..8e7d1ab1ab 100644
--- a/yt/yt/library/tracing/jaeger/sampler.cpp
+++ b/yt/yt/library/tracing/jaeger/sampler.cpp
@@ -58,8 +58,7 @@ void TSampler::SampleTraceContext(const std::string& user, const TTraceContextPt
auto [userState, inserted] = Users_.FindOrInsert(user, [&] {
auto state = New<TUserState>();
- // TODO(babenko): switch to std::string
- auto profiler = Profiler_.WithSparse().WithTag("user", TString(user));
+ auto profiler = Profiler_.WithSparse().WithTag("user", user);
state->TracesSampledByUser = profiler.Counter("/traces_sampled_by_user");
state->TracesSampledByProbability = profiler.Counter("/traces_sampled_by_probability");
diff --git a/yt/yt/library/ytprof/allocation_tag_profiler/allocation_tag_profiler.cpp b/yt/yt/library/ytprof/allocation_tag_profiler/allocation_tag_profiler.cpp
index f79052d105..a2cccc2241 100644
--- a/yt/yt/library/ytprof/allocation_tag_profiler/allocation_tag_profiler.cpp
+++ b/yt/yt/library/ytprof/allocation_tag_profiler/allocation_tag_profiler.cpp
@@ -69,8 +69,7 @@ private:
auto it = guages.find(tagValue);
if (it == guages.end()) {
it = guages.emplace(tagValue, Profiler_
- // TODO(babenko): migrate to std::string
- .WithTag(TString(tagKey), TString(tagValue))
+ .WithTag(tagKey, tagValue)
.Gauge(Format("/%v", NYPath::ToYPathLiteral(tagKey))))
.first;
it->second.Update(usage);