File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
packages/tracing/src/browser Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -236,11 +236,13 @@ export class MetricsInstrumentation {
236236 return ;
237237 }
238238
239- const timeOrigin = msToSec ( performance . timeOrigin ) ;
240239 const startTime = msToSec ( entry . startTime as number ) ;
241240 logger . log ( '[Measurements] Adding LCP' ) ;
242241 this . _measurements [ 'lcp' ] = { value : metric . value } ;
243- this . _measurements [ 'mark.lcp' ] = { value : timeOrigin + startTime } ;
242+ if ( browserPerformanceTimeOrigin !== undefined ) {
243+ const timeOrigin = msToSec ( browserPerformanceTimeOrigin ) ;
244+ this . _measurements [ 'mark.lcp' ] = { value : timeOrigin + startTime } ;
245+ }
244246 } ) ;
245247 }
246248
@@ -253,11 +255,13 @@ export class MetricsInstrumentation {
253255 return ;
254256 }
255257
256- const timeOrigin = msToSec ( performance . timeOrigin ) ;
257258 const startTime = msToSec ( entry . startTime as number ) ;
258259 logger . log ( '[Measurements] Adding FID' ) ;
259260 this . _measurements [ 'fid' ] = { value : metric . value } ;
260- this . _measurements [ 'mark.fid' ] = { value : timeOrigin + startTime } ;
261+ if ( browserPerformanceTimeOrigin !== undefined ) {
262+ const timeOrigin = msToSec ( browserPerformanceTimeOrigin ) ;
263+ this . _measurements [ 'mark.fid' ] = { value : timeOrigin + startTime } ;
264+ }
261265 } ) ;
262266 }
263267
You can’t perform that action at this time.
0 commit comments