Просмотр исходного кода

fix(replay): Move timeline frame metric (#74951)

The frame metric was right after the start of the gap was set, which
would cause extra background frames to be tracked. The metric should be
before the start of the timeline gap is set.
Catherine Lee 7 месяцев назад
Родитель
Сommit
38fa365205
1 измененных файлов с 5 добавлено и 5 удалено
  1. 5 5
      static/app/components/replays/breadcrumbs/timelineGaps.tsx

+ 5 - 5
static/app/components/replays/breadcrumbs/timelineGaps.tsx

@@ -29,11 +29,6 @@ export default function TimelineGaps({durationMs, startTimestampMs, frames}: Pro
   let end = -1;
   let end = -1;
 
 
   for (const currFrame of frames) {
   for (const currFrame of frames) {
-    // only considered start of gap if background frame hasn't been found yet
-    if (start === -1 && isBackgroundFrame(currFrame)) {
-      start = currFrame.timestampMs - startTimestampMs;
-    }
-
     // add metrics for frame coming after a background frame to see how often we have bad data
     // add metrics for frame coming after a background frame to see how often we have bad data
     if (start !== -1) {
     if (start !== -1) {
       trackAnalytics('replay.frame-after-background', {
       trackAnalytics('replay.frame-after-background', {
@@ -42,6 +37,11 @@ export default function TimelineGaps({durationMs, startTimestampMs, frames}: Pro
       });
       });
     }
     }
 
 
+    // only considered start of gap if background frame hasn't been found yet
+    if (start === -1 && isBackgroundFrame(currFrame)) {
+      start = currFrame.timestampMs - startTimestampMs;
+    }
+
     // gap only ends if a frame that's not a background frame or error frame has been found
     // gap only ends if a frame that's not a background frame or error frame has been found
     if (start !== -1 && !isBackgroundFrame(currFrame) && !isErrorFrame(currFrame)) {
     if (start !== -1 && !isBackgroundFrame(currFrame) && !isErrorFrame(currFrame)) {
       end = currFrame.timestampMs - startTimestampMs;
       end = currFrame.timestampMs - startTimestampMs;