@@ -27,6 +27,8 @@ pub enum ProfilerEvent {
2727 QueryCount { query_name : & ' static str , category : ProfileCategory , count : usize } ,
2828 IncrementalLoadResultStart { query_name : & ' static str , time : Instant } ,
2929 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 } ,
3032}
3133
3234impl ProfilerEvent {
@@ -36,13 +38,15 @@ impl ProfilerEvent {
3638 match self {
3739 QueryStart { .. } |
3840 GenericActivityStart { .. } |
39- IncrementalLoadResultStart { .. } => true ,
41+ IncrementalLoadResultStart { .. } |
42+ QueryBlockedStart { .. } => true ,
4043
4144 QueryEnd { .. } |
4245 GenericActivityEnd { .. } |
4346 QueryCacheHit { .. } |
4447 QueryCount { .. } |
45- IncrementalLoadResultEnd { .. } => false ,
48+ IncrementalLoadResultEnd { .. } |
49+ QueryBlockedEnd { .. } => false ,
4650 }
4751 }
4852}
@@ -249,6 +253,24 @@ impl SelfProfiler {
249253 } )
250254 }
251255
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+
252274 #[ inline]
253275 fn record ( & mut self , event : ProfilerEvent ) {
254276 let thread_id = std:: thread:: current ( ) . id ( ) ;
@@ -343,6 +365,8 @@ impl SelfProfiler {
343365 } ,
344366 //we don't summarize incremental load result events in the simple output mode
345367 IncrementalLoadResultStart { .. } | IncrementalLoadResultEnd { .. } => { } ,
368+ //we don't summarize parallel query blocking in the simple output mode
369+ QueryBlockedStart { .. } | QueryBlockedEnd { .. } => { } ,
346370 }
347371 }
348372
0 commit comments