@@ -175,6 +175,7 @@ pub fn perform_analysis(data: ProfilingData) -> Results {
175
175
data. self_time -= current_event_duration;
176
176
}
177
177
INCREMENTAL_LOAD_RESULT_EVENT_KIND => {
178
+ data. self_time -= current_event_duration;
178
179
data. incremental_load_time -= current_event_duration;
179
180
}
180
181
_ => {
@@ -200,12 +201,14 @@ pub fn perform_analysis(data: ProfilingData) -> Results {
200
201
201
202
QUERY_BLOCKED_EVENT_KIND => {
202
203
record_event_data ( & current_event. label , & |data| {
204
+ data. self_time += current_event_duration;
203
205
data. blocked_time += current_event_duration;
204
206
} ) ;
205
207
}
206
208
207
209
INCREMENTAL_LOAD_RESULT_EVENT_KIND => {
208
210
record_event_data ( & current_event. label , & |data| {
211
+ data. self_time += current_event_duration;
209
212
data. incremental_load_time += current_event_duration;
210
213
} ) ;
211
214
}
@@ -509,13 +512,13 @@ mod tests {
509
512
510
513
assert_eq ! ( results. total_time, Duration :: from_nanos( 230 ) ) ;
511
514
512
- assert_eq ! ( results. query_data_by_label( "q1" ) . self_time, Duration :: from_nanos( 100 ) ) ;
515
+ assert_eq ! ( results. query_data_by_label( "q1" ) . self_time, Duration :: from_nanos( 230 ) ) ;
513
516
assert_eq ! ( results. query_data_by_label( "q1" ) . blocked_time, Duration :: from_nanos( 130 ) ) ;
514
517
}
515
518
516
519
#[ test]
517
520
fn query_incr_loading_time ( ) {
518
- // T1: <---------------q1---------- ----->
521
+ // T1: <---------------q1 (loading) ----->
519
522
// T2: <------q1 (loading)------>
520
523
// T3: <----q1 (loading)---->
521
524
// 0 30 40 100
@@ -530,7 +533,7 @@ mod tests {
530
533
531
534
assert_eq ! ( results. total_time, Duration :: from_nanos( 230 ) ) ;
532
535
533
- assert_eq ! ( results. query_data_by_label( "q1" ) . self_time, Duration :: from_nanos( 0 ) ) ;
536
+ assert_eq ! ( results. query_data_by_label( "q1" ) . self_time, Duration :: from_nanos( 230 ) ) ;
534
537
assert_eq ! ( results. query_data_by_label( "q1" ) . incremental_load_time, Duration :: from_nanos( 230 ) ) ;
535
538
}
536
539
}
0 commit comments