@@ -27,6 +27,8 @@ pub enum ProfilerEvent {
27
27
QueryCount { query_name : & ' static str , category : ProfileCategory , count : usize } ,
28
28
IncrementalLoadResultStart { query_name : & ' static str , time : Instant } ,
29
29
IncrementalLoadResultEnd { query_name : & ' static str , time : Instant } ,
30
+ QueryBlockedStart { query_name : & ' static str , category : ProfileCategory , time : Instant } ,
31
+ QueryBlockedEnd { query_name : & ' static str , category : ProfileCategory , time : Instant } ,
30
32
}
31
33
32
34
impl ProfilerEvent {
@@ -36,13 +38,15 @@ impl ProfilerEvent {
36
38
match self {
37
39
QueryStart { .. } |
38
40
GenericActivityStart { .. } |
39
- IncrementalLoadResultStart { .. } => true ,
41
+ IncrementalLoadResultStart { .. } |
42
+ QueryBlockedStart { .. } => true ,
40
43
41
44
QueryEnd { .. } |
42
45
GenericActivityEnd { .. } |
43
46
QueryCacheHit { .. } |
44
47
QueryCount { .. } |
45
- IncrementalLoadResultEnd { .. } => false ,
48
+ IncrementalLoadResultEnd { .. } |
49
+ QueryBlockedEnd { .. } => false ,
46
50
}
47
51
}
48
52
}
@@ -249,6 +253,24 @@ impl SelfProfiler {
249
253
} )
250
254
}
251
255
256
+ #[ inline]
257
+ pub fn query_blocked_start ( & mut self , query_name : & ' static str , category : ProfileCategory ) {
258
+ self . record ( ProfilerEvent :: QueryBlockedStart {
259
+ query_name,
260
+ category,
261
+ time : Instant :: now ( ) ,
262
+ } )
263
+ }
264
+
265
+ #[ inline]
266
+ pub fn query_blocked_end ( & mut self , query_name : & ' static str , category : ProfileCategory ) {
267
+ self . record ( ProfilerEvent :: QueryBlockedEnd {
268
+ query_name,
269
+ category,
270
+ time : Instant :: now ( ) ,
271
+ } )
272
+ }
273
+
252
274
#[ inline]
253
275
fn record ( & mut self , event : ProfilerEvent ) {
254
276
let thread_id = std:: thread:: current ( ) . id ( ) ;
@@ -343,6 +365,8 @@ impl SelfProfiler {
343
365
} ,
344
366
//we don't summarize incremental load result events in the simple output mode
345
367
IncrementalLoadResultStart { .. } | IncrementalLoadResultEnd { .. } => { } ,
368
+ //we don't summarize parallel query blocking in the simple output mode
369
+ QueryBlockedStart { .. } | QueryBlockedEnd { .. } => { } ,
346
370
}
347
371
}
348
372
0 commit comments