@@ -143,6 +143,20 @@ void main() {
143143 return result;
144144 }
145145
146+ Map <String , dynamic > frameRequestPendingStart (String id, int timeStamp) => < String , dynamic > {
147+ 'name' : 'Frame Request Pending' ,
148+ 'ph' : 'b' ,
149+ 'id' : id,
150+ 'ts' : timeStamp,
151+ };
152+
153+ Map <String , dynamic > frameRequestPendingEnd (String id, int timeStamp) => < String , dynamic > {
154+ 'name' : 'Frame Request Pending' ,
155+ 'ph' : 'e' ,
156+ 'id' : id,
157+ 'ts' : timeStamp,
158+ };
159+
146160 group ('frame_count' , () {
147161 test ('counts frames' , () {
148162 expect (
@@ -448,13 +462,19 @@ void main() {
448462 expect (
449463 summarize (< Map <String , dynamic >> [
450464 begin (1000 ), end (19000 ),
451- begin (19000 ), end (29000 ),
452- begin (29000 ), end (49000 ),
465+ begin (19001 ), end (29001 ),
466+ begin (29002 ), end (49002 ),
453467 ...newGenGC (4 , 10 , 100 ),
454468 ...oldGenGC (5 , 10000 , 100 ),
455469 frameBegin (1000 ), frameEnd (18000 ),
456470 frameBegin (19000 ), frameEnd (28000 ),
457471 frameBegin (29000 ), frameEnd (48000 ),
472+ frameRequestPendingStart ('1' , 1000 ),
473+ frameRequestPendingEnd ('1' , 2000 ),
474+ frameRequestPendingStart ('2' , 3000 ),
475+ frameRequestPendingEnd ('2' , 5000 ),
476+ frameRequestPendingStart ('3' , 6000 ),
477+ frameRequestPendingEnd ('3' , 9000 ),
458478 ]).summaryJson,
459479 < String , dynamic > {
460480 'average_frame_build_time_millis' : 15.0 ,
@@ -475,7 +495,7 @@ void main() {
475495 'frame_build_times' : < int > [17000 , 9000 , 19000 ],
476496 'frame_rasterizer_times' : < int > [18000 , 10000 , 20000 ],
477497 'frame_begin_times' : < int > [0 , 18000 , 28000 ],
478- 'frame_rasterizer_begin_times' : < int > [0 , 18000 , 28000 ],
498+ 'frame_rasterizer_begin_times' : < int > [0 , 18001 , 28002 ],
479499 'average_vsync_transitions_missed' : 0.0 ,
480500 '90th_percentile_vsync_transitions_missed' : 0.0 ,
481501 '99th_percentile_vsync_transitions_missed' : 0.0 ,
@@ -505,6 +525,9 @@ void main() {
505525 '90hz_frame_percentage' : 0 ,
506526 '120hz_frame_percentage' : 0 ,
507527 'illegal_refresh_rate_frame_count' : 0 ,
528+ 'average_frame_request_pending_latency' : 2000.0 ,
529+ '90th_percentile_frame_request_pending_latency' : 3000.0 ,
530+ '99th_percentile_frame_request_pending_latency' : 3000.0 ,
508531 },
509532 );
510533 });
@@ -556,8 +579,8 @@ void main() {
556579 test ('writes summary to JSON file' , () async {
557580 await summarize (< Map <String , dynamic >> [
558581 begin (1000 ), end (19000 ),
559- begin (19000 ), end (29000 ),
560- begin (29000 ), end (49000 ),
582+ begin (19001 ), end (29001 ),
583+ begin (29002 ), end (49002 ),
561584 frameBegin (1000 ), frameEnd (18000 ),
562585 frameBegin (19000 ), frameEnd (28000 ),
563586 frameBegin (29000 ), frameEnd (48000 ),
@@ -569,6 +592,12 @@ void main() {
569592 cpuUsage (5000 , 20 ), cpuUsage (5010 , 60 ),
570593 memoryUsage (6000 , 20 , 40 ), memoryUsage (6100 , 30 , 45 ),
571594 platformVsync (7000 ), vsyncCallback (7500 ),
595+ frameRequestPendingStart ('1' , 1000 ),
596+ frameRequestPendingEnd ('1' , 2000 ),
597+ frameRequestPendingStart ('2' , 3000 ),
598+ frameRequestPendingEnd ('2' , 5000 ),
599+ frameRequestPendingStart ('3' , 6000 ),
600+ frameRequestPendingEnd ('3' , 9000 ),
572601 ]).writeTimelineToFile ('test' , destinationDirectory: tempDir.path);
573602 final String written =
574603 await fs.file (path.join (tempDir.path, 'test.timeline_summary.json' )).readAsString ();
@@ -591,7 +620,7 @@ void main() {
591620 'frame_build_times' : < int > [17000 , 9000 , 19000 ],
592621 'frame_rasterizer_times' : < int > [18000 , 10000 , 20000 ],
593622 'frame_begin_times' : < int > [0 , 18000 , 28000 ],
594- 'frame_rasterizer_begin_times' : < int > [0 , 18000 , 28000 ],
623+ 'frame_rasterizer_begin_times' : < int > [0 , 18001 , 28002 ],
595624 'average_vsync_transitions_missed' : 8.0 ,
596625 '90th_percentile_vsync_transitions_missed' : 12.0 ,
597626 '99th_percentile_vsync_transitions_missed' : 12.0 ,
@@ -627,6 +656,9 @@ void main() {
627656 '90hz_frame_percentage' : 0 ,
628657 '120hz_frame_percentage' : 0 ,
629658 'illegal_refresh_rate_frame_count' : 0 ,
659+ 'average_frame_request_pending_latency' : 2000.0 ,
660+ '90th_percentile_frame_request_pending_latency' : 3000.0 ,
661+ '99th_percentile_frame_request_pending_latency' : 3000.0 ,
630662 });
631663 });
632664 });
0 commit comments