@@ -87,11 +87,8 @@ function _trackLCP(reportAllChanges: boolean): void {
87
87
return ;
88
88
}
89
89
90
- const timeOrigin = msToSec ( browserPerformanceTimeOrigin as number ) ;
91
- const startTime = msToSec ( entry . startTime ) ;
92
90
__DEBUG_BUILD__ && logger . log ( '[Measurements] Adding LCP' ) ;
93
91
_measurements [ 'lcp' ] = { value : metric . value , unit : 'millisecond' } ;
94
- _measurements [ 'mark.lcp' ] = { value : timeOrigin + startTime , unit : 'second' } ;
95
92
_lcpEntry = entry as LargestContentfulPaint ;
96
93
} , reportAllChanges ) ;
97
94
}
@@ -147,7 +144,7 @@ export function addPerformanceEntries(transaction: Transaction): void {
147
144
case 'mark' :
148
145
case 'paint' :
149
146
case 'measure' : {
150
- const startTimestamp = _addMeasureSpans ( transaction , entry , startTime , duration , timeOrigin ) ;
147
+ _addMeasureSpans ( transaction , entry , startTime , duration , timeOrigin ) ;
151
148
152
149
// capture web vitals
153
150
const firstHidden = getVisibilityWatcher ( ) ;
@@ -157,12 +154,10 @@ export function addPerformanceEntries(transaction: Transaction): void {
157
154
if ( entry . name === 'first-paint' && shouldRecord ) {
158
155
__DEBUG_BUILD__ && logger . log ( '[Measurements] Adding FP' ) ;
159
156
_measurements [ 'fp' ] = { value : entry . startTime , unit : 'millisecond' } ;
160
- _measurements [ 'mark.fp' ] = { value : startTimestamp , unit : 'second' } ;
161
157
}
162
158
if ( entry . name === 'first-contentful-paint' && shouldRecord ) {
163
159
__DEBUG_BUILD__ && logger . log ( '[Measurements] Adding FCP' ) ;
164
160
_measurements [ 'fcp' ] = { value : entry . startTime , unit : 'millisecond' } ;
165
- _measurements [ 'mark.fcp' ] = { value : startTimestamp , unit : 'second' } ;
166
161
}
167
162
break ;
168
163
}
@@ -220,14 +215,18 @@ export function addPerformanceEntries(transaction: Transaction): void {
220
215
_measurements [ name ] . value = normalizedValue ;
221
216
} ) ;
222
217
223
- if ( _measurements [ 'mark.fid' ] && _measurements [ 'fid' ] ) {
218
+ const fidMark = _measurements [ 'mark.fid' ] ;
219
+ if ( fidMark && _measurements [ 'fid' ] ) {
224
220
// create span for FID
225
221
_startChild ( transaction , {
226
222
description : 'first input delay' ,
227
- endTimestamp : _measurements [ 'mark.fid' ] . value + msToSec ( _measurements [ 'fid' ] . value ) ,
223
+ endTimestamp : fidMark . value + msToSec ( _measurements [ 'fid' ] . value ) ,
228
224
op : 'web.vitals' ,
229
- startTimestamp : _measurements [ 'mark.fid' ] . value ,
225
+ startTimestamp : fidMark . value ,
230
226
} ) ;
227
+
228
+ // Delete mark.fid as we don't want it to be part of final payload
229
+ delete _measurements [ 'mark.fid' ] ;
231
230
}
232
231
233
232
// If FCP is not recorded we should not record the cls value
0 commit comments