File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
packages/replay/metrics/src/perf Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ export class PerfMetricsSampler {
5252 await cdp . send ( 'Performance.enable' , { timeDomain : 'timeTicks' } )
5353
5454 // collect first sample immediately
55- void self . _collectSample ( ) ;
55+ self . _collectSample ( ) ;
5656
5757 // and set up automatic collection in the given interval
5858 self . _timer = setInterval ( self . _collectSample . bind ( self ) , interval ) ;
@@ -68,9 +68,10 @@ export class PerfMetricsSampler {
6868 clearInterval ( this . _timer ) ;
6969 }
7070
71- private async _collectSample ( ) : Promise < void > {
72- const response = await this . _cdp . send ( 'Performance.getMetrics' ) ;
73- const metrics = new PerfMetrics ( response . metrics ) ;
74- this . _consumers . forEach ( cb => cb ( metrics ) . catch ( console . error ) ) ;
71+ private _collectSample ( ) : void {
72+ this . _cdp . send ( 'Performance.getMetrics' ) . then ( response => {
73+ const metrics = new PerfMetrics ( response . metrics ) ;
74+ this . _consumers . forEach ( cb => cb ( metrics ) . catch ( console . error ) ) ;
75+ } , console . error ) ;
7576 }
7677}
You can’t perform that action at this time.
0 commit comments