From 230fdc366a56dc34e9b1c1a9d4954d4195dc5733 Mon Sep 17 00:00:00 2001 From: vigneshshanmugam Date: Mon, 15 Jun 2020 15:25:57 +0200 Subject: [PATCH] chore(rum-core): use startTime for LCP marks --- packages/rum-core/src/performance-monitoring/metrics.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/rum-core/src/performance-monitoring/metrics.js b/packages/rum-core/src/performance-monitoring/metrics.js index a0e78e6b8..0c5dfbdbe 100644 --- a/packages/rum-core/src/performance-monitoring/metrics.js +++ b/packages/rum-core/src/performance-monitoring/metrics.js @@ -190,10 +190,11 @@ export function captureObserverEntries(list, { capturePaint }) { if (lastLcpEntry) { /** + * `startTime` - equals to renderTime if it's nonzero, otherwise equal to loadTime. * `renderTime` will not be available for Image element and for the element * that is loaded cross-origin without the `Timing-Allow-Origin` header. */ - const lcp = parseInt(lastLcpEntry.renderTime || lastLcpEntry.loadTime) + const lcp = parseInt(lastLcpEntry.startTime) metrics.lcp = lcp result.marks.largestContentfulPaint = lcp }