Skip to content

Commit b73e7e8

Browse files
authored
fix(perf-issues): Allow http timings small drift (#54547)
### Summary It seems there are times where the http timings are slightly off from span duration, in the millisecond range. This is likely due to the differences between timing the fetch operations and how PerformanceNetworkTiming works, but for now we can ease off the exit condition by a few milliseconds so we get subtimings when it's really close.
1 parent 85750ab commit b73e7e8

File tree

1 file changed

+10
-1
lines changed
  • static/app/components/events/interfaces/spans

1 file changed

+10
-1
lines changed

static/app/components/events/interfaces/spans/utils.tsx

+10-1
Original file line numberDiff line numberDiff line change
@@ -397,10 +397,19 @@ export function getSpanSubTimings(span: ProcessedSpanType): SubTimingInfo[] | nu
397397
const spanStart = subTimingMarkToTime(span, SpanSubTimingMark.SPAN_START);
398398
const spanEnd = subTimingMarkToTime(span, SpanSubTimingMark.SPAN_END);
399399

400+
const TEN_MS = 0.001;
401+
400402
for (const def of timingDefinitions) {
401403
const start = subTimingMarkToTime(span, def.startMark);
402404
const end = subTimingMarkToTime(span, def.endMark);
403-
if (!start || !end || !spanStart || !spanEnd || start < spanStart || end > spanEnd) {
405+
if (
406+
!start ||
407+
!end ||
408+
!spanStart ||
409+
!spanEnd ||
410+
start < spanStart - TEN_MS ||
411+
end > spanEnd + TEN_MS
412+
) {
404413
return null;
405414
}
406415
timings.push({

0 commit comments

Comments
 (0)