Skip to content

Commit

Permalink
fix(tracing): Don't send negative ttfb
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhiPrasad committed Jan 22, 2024
1 parent 7e3207d commit 02ef34e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/tracing-internal/src/browser/metrics/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export function addPerformanceEntries(transaction: Transaction): void {
if (typeof responseStartTimestamp === 'number' && transactionStartTime) {
DEBUG_BUILD && logger.log('[Measurements] Adding TTFB');
_measurements['ttfb'] = {
value: (responseStartTimestamp - transactionStartTime) * 1000,
value: Math.max(responseStartTimestamp - transactionStartTime, 0) * 1000,
unit: 'millisecond',
};

Expand Down

0 comments on commit 02ef34e

Please sign in to comment.