File tree Expand file tree Collapse file tree
support/Firefox/extension Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -668,6 +668,12 @@ def on_stop_recording(self, task):
668668 interactive_file = os .path .join (task ['dir' ], task ['prefix' ] + '_interactive.json.gz' )
669669 with gzip .open (interactive_file , GZIP_TEXT , 7 ) as f_out :
670670 f_out .write (interactive )
671+ long_tasks = self .execute_js ('window.wrappedJSObject.wptagentGetLongTasks();' )
672+ if long_tasks is not None and len (long_tasks ):
673+ long_tasks_file = os .path .join (task ['dir' ], task ['prefix' ] + '_long_tasks.json.gz' )
674+ with gzip .open (long_tasks_file , GZIP_TEXT , 7 ) as f_out :
675+ f_out .write (long_tasks )
676+ self .execute_js ('window.wrappedJSObject.wptagentResetLongTasks();' )
671677 # Close the browser if we are done testing (helps flush logs)
672678 if not len (task ['script' ]):
673679 self .close_browser (self .job , task )
Original file line number Diff line number Diff line change @@ -978,6 +978,7 @@ def on_start_processing(self, task):
978978 self .trace_parser .WriteCPUSlices (self .path_base + '_timeline_cpu.json.gz' )
979979 self .trace_parser .WriteScriptTimings (self .path_base + '_script_timing.json.gz' )
980980 self .trace_parser .WriteInteractive (self .path_base + '_interactive.json.gz' )
981+ self .trace_parser .WriteLongTasks (self .path_base + '_long_tasks.json.gz' )
981982 elapsed = monotonic () - start
982983 logging .debug ("Done processing the trace events: %0.3fs" , elapsed )
983984 self .trace_parser = None
Original file line number Diff line number Diff line change @@ -31,9 +31,19 @@ function wptagentGetInteractivePeriods() {
3131 start = longTasks [ i ] [ 1 ] ;
3232 }
3333 interactive . push ( [ start , now ] ) ;
34+ return JSON . stringify ( interactive ) ;
35+ }
36+
37+ function wptagentGetLongTasks ( ) {
38+ checkLongTask ( ) ;
39+ return JSON . stringify ( longTasks ) ;
40+ }
41+
42+ function wptagentResetLongTasks ( ) {
3443 longTasks = [ ] ;
3544 startTime = now ;
36- return JSON . stringify ( interactive ) ;
3745}
3846
3947exportFunction ( wptagentGetInteractivePeriods , window , { defineAs :'wptagentGetInteractivePeriods' } ) ;
48+ exportFunction ( wptagentGetLongTasks , window , { defineAs :'wptagentGetLongTasks' } ) ;
49+ exportFunction ( wptagentResetLongTasks , window , { defineAs :'wptagentResetLongTasks' } ) ;
You can’t perform that action at this time.
0 commit comments