aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryuryalekseev <yuryalekseev@yandex-team.com>2023-03-06 14:08:24 +0300
committeryuryalekseev <yuryalekseev@yandex-team.com>2023-03-06 14:08:24 +0300
commit3bd7c4cda9449366fd7603ae86c62fbe80d7c5b2 (patch)
tree9d4db153e4cc1becafa18bfcc6517e2c49846180
parent2b52843982ad694cf840c1f8f4db4872080b1418 (diff)
downloadydb-3bd7c4cda9449366fd7603ae86c62fbe80d7c5b2.tar.gz
Add scan errors count to TDqComputeActorStats.
-rw-r--r--ydb/core/kqp/compute_actor/kqp_scan_compute_actor.cpp8
-rw-r--r--ydb/core/kqp/executer_actor/kqp_executer_stats.cpp1
-rw-r--r--ydb/core/kqp/opt/kqp_query_plan.cpp3
-rw-r--r--ydb/library/yql/dq/actors/protos/dq_stats.proto3
4 files changed, 15 insertions, 0 deletions
diff --git a/ydb/core/kqp/compute_actor/kqp_scan_compute_actor.cpp b/ydb/core/kqp/compute_actor/kqp_scan_compute_actor.cpp
index 911fb69ca1..7e20401d20 100644
--- a/ydb/core/kqp/compute_actor/kqp_scan_compute_actor.cpp
+++ b/ydb/core/kqp/compute_actor/kqp_scan_compute_actor.cpp
@@ -258,6 +258,8 @@ public:
// NKqpProto::TKqpComputeActorExtraStats extraStats;
auto* taskStats = dst->MutableTasks(0);
+ taskStats->SetErrorsCount(ErrorsCount);
+
auto* tableStats = taskStats->AddTables();
tableStats->SetTablePath(ScanData->TablePath);
@@ -609,6 +611,8 @@ private:
YQL_ENSURE(state->Generation == msg.GetGeneration());
+ ++ErrorsCount;
+
if (state->State == EShardState::Starting) {
// TODO: Do not parse issues here, use status code.
if (FindSchemeErrorInIssues(status, issues)) {
@@ -633,6 +637,9 @@ private:
return;
}
YQL_ENSURE(ScanData);
+
+ ++ErrorsCount;
+
auto& msg = *ev->Get();
if (auto costsState = InFlightShards.GetCostsState(msg.TabletId)) {
@@ -1235,6 +1242,7 @@ private:
NWilson::TProfileSpan KqpComputeActorSpan;
TInFlightShards InFlightShards;
ui32 ScansCounter = 0;
+ ui32 ErrorsCount = 0;
std::set<ui32> TrackingNodes;
ui32 MaxInFlight = 1024;
diff --git a/ydb/core/kqp/executer_actor/kqp_executer_stats.cpp b/ydb/core/kqp/executer_actor/kqp_executer_stats.cpp
index 3a59d76574..24ac99f4da 100644
--- a/ydb/core/kqp/executer_actor/kqp_executer_stats.cpp
+++ b/ydb/core/kqp/executer_actor/kqp_executer_stats.cpp
@@ -151,6 +151,7 @@ void TQueryExecutionStats::AddComputeActorStats(ui32 /* nodeId */, NYql::NDqProt
auto* stageStats = GetOrCreateStageStats(task, *TasksGraph, *Result);
stageStats->SetTotalTasksCount(stageStats->GetTotalTasksCount() + 1);
+ stageStats->SetTotalErrorsCount(stageStats->GetTotalErrorsCount() + task.GetErrorsCount());
UpdateAggr(stageStats->MutableCpuTimeUs(), task.GetCpuTimeUs());
UpdateAggr(stageStats->MutableInputRows(), task.GetInputRows());
UpdateAggr(stageStats->MutableInputBytes(), task.GetInputBytes());
diff --git a/ydb/core/kqp/opt/kqp_query_plan.cpp b/ydb/core/kqp/opt/kqp_query_plan.cpp
index 8a9ba7a8bd..7e6f024b90 100644
--- a/ydb/core/kqp/opt/kqp_query_plan.cpp
+++ b/ydb/core/kqp/opt/kqp_query_plan.cpp
@@ -1653,6 +1653,8 @@ TString AddExecStatsToTxPlan(const TString& txPlanJson, const NYql::NDqProto::TD
SetNonZero(node, "PendingInputTimeUs", taskStats.GetPendingInputTimeUs());
SetNonZero(node, "PendingOutputTimeUs", taskStats.GetPendingOutputTimeUs());
+ SetNonZero(node, "ErrorsCount", taskStats.GetErrorsCount());
+
for (auto& inputStats : taskStats.GetInputChannels()) {
auto& inputNode = node["InputChannels"].AppendValue(NJson::TJsonValue());
fillInputStats(inputNode, inputStats);
@@ -1688,6 +1690,7 @@ TString AddExecStatsToTxPlan(const TString& txPlanJson, const NYql::NDqProto::TD
stats["TotalInputBytes"] = (*stat)->GetInputBytes().GetSum();
stats["TotalOutputRows"] = (*stat)->GetOutputRows().GetSum();
stats["TotalOutputBytes"] = (*stat)->GetOutputBytes().GetSum();
+ stats["TotalErrosCount"] = (*stat)->GetTotalErrorsCount();
for (auto& caStats : (*stat)->GetComputeActors()) {
auto& caNode = stats["ComputeNodes"].AppendValue(NJson::TJsonValue());
diff --git a/ydb/library/yql/dq/actors/protos/dq_stats.proto b/ydb/library/yql/dq/actors/protos/dq_stats.proto
index fda1fa496f..a79b79ba70 100644
--- a/ydb/library/yql/dq/actors/protos/dq_stats.proto
+++ b/ydb/library/yql/dq/actors/protos/dq_stats.proto
@@ -157,6 +157,7 @@ message TDqTaskStats {
repeated TDqAsyncInputBufferStats InputTransforms = 155;
string HostName = 156;
uint32 NodeId = 157;
+ uint32 ErrorsCount = 158;
google.protobuf.Any Extra = 200;
}
@@ -229,6 +230,8 @@ message TDqStageStats {
repeated TDqComputeActorStats ComputeActors = 17; // more detailed stats
+ uint32 TotalErrorsCount = 18;
+
google.protobuf.Any Extra = 100;
}