aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgryzlov-ad <gryzlov-ad@yandex-team.com>2024-11-26 13:43:50 +0300
committergryzlov-ad <gryzlov-ad@yandex-team.com>2024-11-26 13:56:06 +0300
commitfb73633e2e1bb47297885f16aab471af183ce4c0 (patch)
tree7669a5cc8af4f86c5abd8428533771f68b10c431
parent376f6f42244428b36cde31eaa8c7e89a90d7fd1b (diff)
downloadydb-fb73633e2e1bb47297885f16aab471af183ce4c0.tar.gz
Fix performance metrics calculation
commit_hash:76c815f99ca3dbc4d6a0cdb71dc49d3082446f62
-rw-r--r--yt/yt/core/tracing/trace_context.cpp10
-rw-r--r--yt/yt/core/tracing/trace_context.h1
2 files changed, 9 insertions, 2 deletions
diff --git a/yt/yt/core/tracing/trace_context.cpp b/yt/yt/core/tracing/trace_context.cpp
index b65e537a92..3602a9c528 100644
--- a/yt/yt/core/tracing/trace_context.cpp
+++ b/yt/yt/core/tracing/trace_context.cpp
@@ -377,7 +377,7 @@ TSpanContext TTraceContext::GetSpanContext() const
.TraceId = GetTraceId(),
.SpanId = GetSpanId(),
.Sampled = IsSampled(),
- .Debug = Debug_,
+ .Debug = IsDebug(),
};
}
@@ -476,12 +476,18 @@ void TTraceContext::AddProfilingTag(const std::string& name, i64 value)
ProfilingTags_.emplace_back(name, value);
}
-std::vector<std::pair<std::string, std::variant<std::string, i64>>> TTraceContext::GetProfilingTags()
+std::vector<std::pair<std::string, TTraceContext::TProfilingTagValue>> TTraceContext::GetProfilingTags()
{
auto guard = Guard(Lock_);
return ProfilingTags_;
}
+void TTraceContext::SetProfilingTags(std::vector<std::pair<std::string, TTraceContext::TProfilingTagValue>> profilingTags)
+{
+ auto guard = Guard(Lock_);
+ ProfilingTags_ = std::move(profilingTags);
+}
+
bool TTraceContext::AddAsyncChild(TTraceId traceId)
{
if (!IsRecorded()) {
diff --git a/yt/yt/core/tracing/trace_context.h b/yt/yt/core/tracing/trace_context.h
index 44f618a261..534a7b88e8 100644
--- a/yt/yt/core/tracing/trace_context.h
+++ b/yt/yt/core/tracing/trace_context.h
@@ -213,6 +213,7 @@ public:
using TProfilingTagValue = std::variant<std::string, i64>;
std::vector<std::pair<std::string, TProfilingTagValue>> GetProfilingTags();
+ void SetProfilingTags(std::vector<std::pair<std::string, TProfilingTagValue>> profilingTags);
friend void ToProto(NProto::TTracingExt* ext, const TTraceContextPtr& context);