diff options
author | hor911 <hor911@ydb.tech> | 2023-06-05 21:47:09 +0300 |
---|---|---|
committer | hor911 <hor911@ydb.tech> | 2023-06-05 21:47:09 +0300 |
commit | 83d6040b98ea02640e30eb9728eff71a38d7e637 (patch) | |
tree | a9c7a1bcc86ef2218c1ed4f233ef068dca07eafe | |
parent | d3873fb189e82701f2a863ed66d1f39292ce0dca (diff) | |
download | ydb-83d6040b98ea02640e30eb9728eff71a38d7e637.tar.gz |
Show raw statistics (feature flag)
-rw-r--r-- | ydb/core/fq/libs/config/protos/control_plane_storage.proto | 1 | ||||
-rw-r--r-- | ydb/core/fq/libs/control_plane_storage/internal/task_ping.cpp | 20 |
2 files changed, 13 insertions, 8 deletions
diff --git a/ydb/core/fq/libs/config/protos/control_plane_storage.proto b/ydb/core/fq/libs/config/protos/control_plane_storage.proto index a1312269c1a..7af90f2c839 100644 --- a/ydb/core/fq/libs/config/protos/control_plane_storage.proto +++ b/ydb/core/fq/libs/config/protos/control_plane_storage.proto @@ -69,4 +69,5 @@ message TControlPlaneStorageConfig { string MetricsTtl = 29; bool UseDbMapping = 30; string DbReloadPeriod = 31; + bool DumpRawStatistics = 32; } diff --git a/ydb/core/fq/libs/control_plane_storage/internal/task_ping.cpp b/ydb/core/fq/libs/control_plane_storage/internal/task_ping.cpp index b4b499d6d9b..d41d5f26502 100644 --- a/ydb/core/fq/libs/control_plane_storage/internal/task_ping.cpp +++ b/ydb/core/fq/libs/control_plane_storage/internal/task_ping.cpp @@ -23,7 +23,8 @@ struct TPingTaskParams { TPingTaskParams ConstructHardPingTask( const Fq::Private::PingTaskRequest& request, std::shared_ptr<Fq::Private::PingTaskResult> response, const TString& tablePathPrefix, const TDuration& automaticQueriesTtl, const TDuration& taskLeaseTtl, - const THashMap<ui64, TRetryPolicyItem>& retryPolicies, ::NMonitoring::TDynamicCounterPtr rootCounters, uint64_t maxRequestSize) { + const THashMap<ui64, TRetryPolicyItem>& retryPolicies, ::NMonitoring::TDynamicCounterPtr rootCounters, + uint64_t maxRequestSize, bool dumpRawStatistics) { auto scope = request.scope(); auto query_id = request.query_id().value(); @@ -194,12 +195,13 @@ TPingTaskParams ConstructHardPingTask( } if (request.statistics()) { - TString statistics; - try { - statistics = GetPrettyStatistics(request.statistics()); - } catch (const std::exception&) { - CPS_LOG_E("Error on statistics prettification: " << CurrentExceptionMessage()); - statistics = request.statistics(); + TString statistics = request.statistics(); + if (!dumpRawStatistics) { + try { + statistics = GetPrettyStatistics(statistics); + } catch (const std::exception&) { + CPS_LOG_E("Error on statistics prettification: " << CurrentExceptionMessage()); + } } *query.mutable_statistics()->mutable_json() = statistics; *job.mutable_statistics()->mutable_json() = statistics; @@ -526,7 +528,9 @@ void TYdbControlPlaneStorageActor::Handle(TEvControlPlaneStorage::TEvPingTaskReq } auto pingTaskParams = DoesPingTaskUpdateQueriesTable(request) ? - ConstructHardPingTask(request, response, YdbConnection->TablePathPrefix, Config->AutomaticQueriesTtl, Config->TaskLeaseTtl, Config->RetryPolicies, Counters.Counters, Config->Proto.GetMaxRequestSize()) : + ConstructHardPingTask(request, response, YdbConnection->TablePathPrefix, Config->AutomaticQueriesTtl, + Config->TaskLeaseTtl, Config->RetryPolicies, Counters.Counters, Config->Proto.GetMaxRequestSize(), + Config->Proto.GetDumpRawStatistics()) : ConstructSoftPingTask(request, response, YdbConnection->TablePathPrefix, Config->TaskLeaseTtl); auto debugInfo = Config->Proto.GetEnableDebugMode() ? std::make_shared<TDebugInfo>() : TDebugInfoPtr{}; auto result = ReadModifyWrite(pingTaskParams.Query, pingTaskParams.Params, pingTaskParams.Prepare, requestCounters, debugInfo); |