aboutsummaryrefslogtreecommitdiffstats
path: root/ydb/library/yql/dq/actors/protos/dq_stats.proto
blob: bcc01b4084a30a26acbace13924b04779f7609dc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
syntax = "proto3";

package NYql.NDqProto;

option cc_enable_arenas = true;

import "google/protobuf/any.proto";

enum EDqStatsMode {
    DQ_STATS_MODE_UNSPECIFIED = 0;
    DQ_STATS_MODE_NONE    = 10; // no statistics is expected, it will be ignored anyway
    DQ_STATS_MODE_BASIC   = 20; // per graph statistics
    DQ_STATS_MODE_FULL    = 25; // per stage/connection statistics
    DQ_STATS_MODE_PROFILE = 30; // per task statistics
}

// XxxxxMs means time period in ms since epoch

message TDqAsyncBufferStats {
    // Data
    uint64 Bytes  = 1; // physical bytes
    uint64 Rows   = 2; // logical rows (if applicable)
    uint64 Chunks = 3; // chunk is group of sent/received bytes in single batch
    uint64 Splits = 4; // logical partitioning (if applicable)
    // Time
    uint64 FirstMessageMs  = 5;  // first message processed
    uint64 PauseMessageMs  = 6;  // first blocking time on empty/overflow condition
    uint64 ResumeMessageMs = 7;  // last unblocking time
    uint64 LastMessageMs   = 8;  // last message processed
    uint64 WaitTimeUs      = 9;  // SUM(Resume_i - Pause_i) in us
    uint64 WaitPeriods     = 10; // COUNT(Resume_i - Pause_i)
}

message TDqAsyncInputBufferStats {
    uint64 InputIndex = 1;
    string IngressName = 9;

    TDqAsyncBufferStats Ingress = 10;
    TDqAsyncBufferStats Push = 11;
    TDqAsyncBufferStats Pop = 12;

    // profile stats
    uint64 MaxMemoryUsage = 6;
    uint32 ErrorsCount = 7;

    google.protobuf.Any Extra = 100;

    // deprecated
    uint64 Chunks_Deprecated = 2;
    uint64 Bytes_Deprecated = 3;
    uint64 RowsIn_Deprecated = 4;
    uint64 RowsOut_Deprecated = 5;
    uint64 IngressBytes_Deprecated = 8;
}

message TDqInputChannelStats {
    uint64 ChannelId = 1;
    uint32 SrcStageId = 12;

    TDqAsyncBufferStats Push = 13;
    TDqAsyncBufferStats Pop = 14;

    // profile stats
    uint64 DeserializationTimeUs = 6;
    uint64 MaxMemoryUsage = 7;
    uint32 PollRequests = 8;
    uint32 ResentMessages = 9;

    google.protobuf.Any Extra = 100;

    // deprecated
    uint64 Chunks_Deprecated = 2;
    uint64 Bytes_Deprecated = 3;
    uint64 RowsIn_Deprecated = 4;
    uint64 RowsOut_Deprecated = 5;
    uint64 IdleTimeUs_Deprecated = 11;
    uint64 WaitTimeUs_Deprecated = 10;
    uint64 FirstMessageMs_Deprecated = 30;
    uint64 LastMessageMs_Deprecated = 31;
}

message TDqAsyncOutputBufferStats {
    uint64 OutputIndex = 1;
    string EgressName = 9;

    TDqAsyncBufferStats Push = 10;
    TDqAsyncBufferStats Pop = 11;
    TDqAsyncBufferStats Egress = 12;

    // profile stats
    uint64 MaxMemoryUsage = 6;
    uint32 ErrorsCount = 7;

    google.protobuf.Any Extra = 100;

    // deprecated
    uint64 Chunks_Deprecated = 2;
    uint64 Bytes_Deprecated = 3;
    uint64 RowsIn_Deprecated = 4;
    uint64 RowsOut_Deprecated = 5;
    uint64 EgressBytes_Deprecated = 8;
}

message TDqOutputChannelStats {
    uint64 ChannelId = 1;
    uint32 DstStageId = 20;

    TDqAsyncBufferStats Push = 16;
    TDqAsyncBufferStats Pop = 17;

    // profile stats
    uint64 SerializationTimeUs = 6;
    uint32 ResentMessages = 8;
    uint32 NoDstActorId = 9;
    uint32 MaxRowsInMemory = 10;
    uint64 MaxMemoryUsage = 11;
    uint64 SpilledBytes = 12;
    uint64 SpilledRows = 13;
    uint64 SpilledBlobs = 14;

    google.protobuf.Any Extra = 100;

    // deprecated
    uint64 Chunks_Deprecated = 2;
    uint64 Bytes_Deprecated = 3;
    uint64 RowsIn_Deprecated = 4;
    uint64 RowsOut_Deprecated = 5;
    uint32 BlockedByCapacity_Deprecated = 7;
    uint64 BlockedTimeUs_Deprecated = 15;
    uint64 FirstMessageMs_Deprecated = 30;
    uint64 LastMessageMs_Deprecated = 31;
}

message TDqTableStats {
    string TablePath = 1;

    uint64 ReadRows = 2;
    uint64 ReadBytes = 3;
    uint64 WriteRows = 4;
    uint64 WriteBytes = 5;
    uint64 EraseRows = 6;
    uint64 EraseBytes = 7;

    uint32 AffectedPartitions = 8; // TODO: move it to the Extra

    google.protobuf.Any Extra = 100;
}

message TDqMkqlStat {
    string Name = 1;
    int64 Value = 2;
    bool Deriv = 3;
}

message TDqDataProviderStats {
    string Name   = 1;
    uint64 Bytes  = 2;
    uint64 Rows   = 3;
    uint64 Chunks = 4;
    uint64 Splits = 5;
}

message TDqTaskStats {
    reserved 154;

    // basic stats
    uint64 TaskId = 1;
    uint32 StageId = 2;
    uint64 CpuTimeUs = 3;        // total cpu time (build & compute)
    uint64 SourceCpuTimeUs = 15; // time consumed in source(s)
    uint64 BuildCpuTimeUs = 103;   // prepare task time: build computation graph, prepare parameters, ...
    uint64 ComputeCpuTimeUs = 102; // compute time only

    repeated TDqDataProviderStats Ingress = 13;
    repeated TDqDataProviderStats Egress = 14;

    uint64 InputRows = 6;
    uint64 InputBytes = 7;
    uint64 OutputRows = 8;
    uint64 OutputBytes = 9;

    // full stats
    repeated TDqAsyncInputBufferStats Sources = 150;
    repeated TDqInputChannelStats InputChannels = 151;
    repeated TDqAsyncOutputBufferStats Sinks = 152;
    repeated TDqOutputChannelStats OutputChannels = 153;
    repeated TDqAsyncInputBufferStats InputTransforms = 155;

    // profile stats
    repeated TDqTableStats Tables = 10;

    repeated TDqMkqlStat MkqlStats = 110; // stats from mkql
    message THistBucket {
        double Bound = 1;
        uint64 Value = 2;
    }
    repeated THistBucket ComputeCpuTimeByRun = 106;

    string HostName = 156;
    uint32 NodeId = 157;

    google.protobuf.Any Extra = 200;

    // to be reviewed
    uint64 StartTimeMs = 158;
    uint64 FinishTimeMs = 5;     // task finish time, timestamp in millis
    uint64 FirstRowTimeMs = 4;   // first row time, timestamp in millis
    reserved 104;
    uint64 WaitInputTimeUs = 111;  // wait input wall time  (any input: channels, source, ...)
    uint64 WaitOutputTimeUs = 105; // wait output wall time (any output: channels, sinks, ...)
    reserved 107;
    reserved 108;
    reserved 109;
}

message TDqComputeActorStats {
    // basic stats
    uint64 CpuTimeUs = 1;  // total cpu time: tasks cpu time + self cpu time
    uint64 DurationUs = 2; // compute actor duration, wall time (from FirstRowTime to FinishTime)
    repeated TDqTaskStats Tasks = 3; // in the BASIC_MODE only basic fields are used
    uint64 MaxMemoryUsage = 4;

    // profile stats
    uint64 MkqlMaxMemoryUsage = 102;       // MKQL allocations stats
    uint64 MkqlExtraMemoryBytes = 103;
    uint32 MkqlExtraMemoryRequests = 104;

    google.protobuf.Any Extra = 200;
}

message TDqStatsAggr {
    uint64 Min = 1;
    uint64 Max = 2;
    uint64 Sum = 3;
    uint64 Cnt = 4;
}

message TExtraStats {
    map<string, TDqStatsAggr> Stats = 1;
}

message TDqStatsMinMax {
    uint64 Min = 1;
    uint64 Max = 2;
}

message TDqAsyncStatsAggr {
    // Data
    TDqStatsAggr Bytes  = 1;
    TDqStatsAggr Rows   = 2;
    TDqStatsAggr Chunks = 3;
    TDqStatsAggr Splits = 4;
    // Time
    TDqStatsAggr FirstMessageMs  = 5;
    TDqStatsAggr PauseMessageMs  = 6;
    TDqStatsAggr ResumeMessageMs = 7;
    TDqStatsAggr LastMessageMs   = 8;
    TDqStatsAggr WaitTimeUs      = 9;
    TDqStatsAggr WaitPeriods     = 10;
    TDqStatsAggr ActiveTimeUs    = 11;
}

message TDqAsyncBufferStatsAggr {
    TDqAsyncStatsAggr Ingress = 1; // for Ingress only
    TDqAsyncStatsAggr Push    = 2;
    TDqAsyncStatsAggr Pop     = 3;
    TDqAsyncStatsAggr Egress  = 4; // for Egress only
}

message TDqTableAggrStats {
    string TablePath = 1;

    TDqStatsAggr ReadRows = 2;
    TDqStatsAggr ReadBytes = 3;
    TDqStatsAggr WriteRows = 4;
    TDqStatsAggr WriteBytes = 5;
    TDqStatsAggr EraseRows = 6;
    TDqStatsAggr EraseBytes = 7;

    uint32 AffectedPartitions = 8;

    google.protobuf.Any Extra = 100;
}

// aggregated stats for all tasks of the stage
message TDqStageStats {
    uint32 StageId = 1;
    string StageGuid = 2;
    string Program = 3;

    uint32 TotalTasksCount = 5;
    uint32 FailedTasksCount = 6;

    TDqStatsAggr CpuTimeUs = 8;
    TDqStatsAggr SourceCpuTimeUs = 25;
    TDqStatsAggr InputRows = 9;
    TDqStatsAggr InputBytes = 10;
    TDqStatsAggr OutputRows = 11;
    TDqStatsAggr OutputBytes = 12;

    TDqStatsMinMax FirstRowTimeMs = 13;
    TDqStatsMinMax FinishTimeMs = 14;
    TDqStatsMinMax StartTimeMs = 21;
    uint64 DurationUs = 15; // microseconds from min(task_first_row_time) to max(task_finish_time)

    repeated TDqTableAggrStats Tables = 16; // is it required?

    repeated TDqComputeActorStats ComputeActors = 17; // more detailed stats
    oneof LlvmOptions {
        bool UseLlvm = 18;
    }

    // currently only 1 source/sink per stage is possible, but format is ready for multiples
    map<string, TDqAsyncBufferStatsAggr> Ingress = 19; // ingress from external source, per provider
    map<string, TDqAsyncBufferStatsAggr> Egress = 20;  // egress to external consumer, per provider
    map<uint32, TDqAsyncBufferStatsAggr> Input = 22;   // input from other stage, per stage
    map<uint32, TDqAsyncBufferStatsAggr> Output = 23;  // output to other stage, per stage
    TDqStatsAggr MaxMemoryUsage = 24;

    google.protobuf.Any Extra = 100;
}

// graph execution stats
message TDqExecutionStats {
    // basic stats
    uint64 CpuTimeUs = 1;  // total cpu time, executer + compute actors + ...
    uint64 DurationUs = 2; // execution wall time

    uint64 ResultRows = 3;
    uint64 ResultBytes = 4;

    repeated TDqTableStats Tables = 6;

    // profile stats
    uint64 ExecuterCpuTimeUs = 10; // executer self cpu time, microseconds
    uint64 StartTimeMs = 11;       // executer start timestamp, milliseconds
    uint64 FinishTimeMs = 12;      // executer finish timestamp, milliseconds
    uint64 FirstRowTimeMs = 13;    // first result row timestamp, milliseconds

    repeated TDqStageStats Stages = 14;
    repeated string TxPlansWithStats = 15;

    google.protobuf.Any Extra = 100;
}