File tree 3 files changed +18
-1
lines changed
support/Firefox/extension
3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -668,6 +668,12 @@ def on_stop_recording(self, task):
668
668
interactive_file = os .path .join (task ['dir' ], task ['prefix' ] + '_interactive.json.gz' )
669
669
with gzip .open (interactive_file , GZIP_TEXT , 7 ) as f_out :
670
670
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();' )
671
677
# Close the browser if we are done testing (helps flush logs)
672
678
if not len (task ['script' ]):
673
679
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):
978
978
self .trace_parser .WriteCPUSlices (self .path_base + '_timeline_cpu.json.gz' )
979
979
self .trace_parser .WriteScriptTimings (self .path_base + '_script_timing.json.gz' )
980
980
self .trace_parser .WriteInteractive (self .path_base + '_interactive.json.gz' )
981
+ self .trace_parser .WriteLongTasks (self .path_base + '_long_tasks.json.gz' )
981
982
elapsed = monotonic () - start
982
983
logging .debug ("Done processing the trace events: %0.3fs" , elapsed )
983
984
self .trace_parser = None
Original file line number Diff line number Diff line change @@ -31,9 +31,19 @@ function wptagentGetInteractivePeriods() {
31
31
start = longTasks [ i ] [ 1 ] ;
32
32
}
33
33
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 ( ) {
34
43
longTasks = [ ] ;
35
44
startTime = now ;
36
- return JSON . stringify ( interactive ) ;
37
45
}
38
46
39
47
exportFunction ( 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