diff options
author | uzhas <uzhas@yandex-team.ru> | 2022-03-03 11:50:41 +0300 |
---|---|---|
committer | uzhas <uzhas@yandex-team.ru> | 2022-03-03 11:50:41 +0300 |
commit | 473e96c44443a8567db5ba7ee48110663fcb21c7 (patch) | |
tree | f853013de295c62b2c12ba468eadd9b53046ba6c | |
parent | 2915b650d76ba005f1787d130afa5b54990b23f1 (diff) | |
download | ydb-473e96c44443a8567db5ba7ee48110663fcb21c7.tar.gz |
YQ-855: add public sensors query.source_input_messages, query.sink_output_messages
ref:fa5ba662be924fbeb067449c60547b2946e377f1
-rw-r--r-- | ydb/library/yql/providers/dq/actors/task_controller.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ydb/library/yql/providers/dq/actors/task_controller.cpp b/ydb/library/yql/providers/dq/actors/task_controller.cpp index e206500791..2b210fd28d 100644 --- a/ydb/library/yql/providers/dq/actors/task_controller.cpp +++ b/ydb/library/yql/providers/dq/actors/task_controller.cpp @@ -212,6 +212,8 @@ private: YQL_LOG(DEBUG) << " " << SelfId() << " ExportStats " << (taskId ? ToString(taskId) : "Summary"); TString name; std::map<TString, TString> labels; + static const TString SourceLabel = "Source"; + static const TString SinkLabel = "Sink"; for (const auto& [k, v] : stat.Get()) { labels.clear(); if (auto group = GroupForExport(stat, k, taskId, name, labels)) { @@ -225,10 +227,15 @@ private: publicCounterName = "query.cpu_usage_us"; isDeriv = true; } else if (name == "Bytes") { - if (labels.find("Source") != labels.end()) publicCounterName = "query.input_bytes"; - else if (labels.find("Sink") != labels.end()) publicCounterName = "query.output_bytes"; + if (labels.count(SourceLabel)) publicCounterName = "query.input_bytes"; + else if (labels.count(SinkLabel)) publicCounterName = "query.output_bytes"; + isDeriv = true; + } else if (name == "RowsIn") { + if (labels.count(SourceLabel)) publicCounterName = "query.source_input_messages"; + else if (labels.count(SinkLabel)) publicCounterName = "query.sink_output_messages"; // RowsIn == RowsOut for Sinks isDeriv = true; } + if (publicCounterName) { *ServiceCounters.PublicCounters->GetNamedCounter("name", publicCounterName, isDeriv) = v.Count; } |