Skip to content

Commit

Permalink
In-progress wait time reporting + time series stat fields (ydb-platfo…
Browse files Browse the repository at this point in the history
  • Loading branch information
Hor911 authored Jul 16, 2024
1 parent ef5f653 commit 3de9c00
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
7 changes: 7 additions & 0 deletions ydb/library/yql/dq/actors/protos/dq_stats.proto
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,17 @@ message TDqComputeActorStats {
google.protobuf.Any Extra = 200;
}

message TDqHistoryItem {
uint64 TimeMs = 1;
uint64 Value = 2;
}

message TDqStatsAggr {
uint64 Min = 1;
uint64 Max = 2;
uint64 Sum = 3;
uint64 Cnt = 4;
repeated TDqHistoryItem History = 5;
}

message TExtraStats {
Expand Down Expand Up @@ -301,6 +307,7 @@ message TDqStageStats {
uint32 StageId = 1;
string StageGuid = 2;
string Program = 3;
uint64 BaseTimeMs = 38;

uint32 TotalTasksCount = 5;
uint32 FailedTasksCount = 6;
Expand Down
14 changes: 13 additions & 1 deletion ydb/library/yql/dq/runtime/dq_async_stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,9 @@ struct TDqAsyncStats {

inline void TryPause() {
if (CollectFull()) {
auto now = TInstant::Now();

if (!CurrentPauseTs) {
auto now = TInstant::Now();
if (ResumeMessageTs) {
auto delta = now - ResumeMessageTs;
if (delta >= MinWaitDuration) {
Expand All @@ -114,6 +115,17 @@ struct TDqAsyncStats {
CurrentPauseTs = now;
}
}

// we want to report wait time asap (not on next message only)
// so we decrease wait period to minimal possible value of MinWaitDuration
// (used to filter out short periods) and report the rest

auto delta = now - *CurrentPauseTs;
if (delta >= MinWaitDuration * 2) {
WaitTime += delta;
WaitTime -= MinWaitDuration;
*CurrentPauseTs = now - MinWaitDuration;
}
}
}

Expand Down

0 comments on commit 3de9c00

Please sign in to comment.