Skip to content

Commit b52900f

Browse files
authored
fix(tracing): Report the right units for CLS and TTFB (#5303)
- ttfb.requestTime is multiplied times 1000 and is documented in a code comment as ms - Cumulative Layout Shift does not have a unit. A layout cannot shift by 10 milliseconds
1 parent cb2462b commit b52900f

File tree

1 file changed

+2
-2
lines changed
  • packages/tracing/src/browser/metrics

1 file changed

+2
-2
lines changed

packages/tracing/src/browser/metrics/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function _trackCLS(): void {
5050
}
5151

5252
__DEBUG_BUILD__ && logger.log('[Measurements] Adding CLS');
53-
_measurements['cls'] = { value: metric.value, unit: 'millisecond' };
53+
_measurements['cls'] = { value: metric.value, unit: 'none' };
5454
_clsEntry = entry as LayoutShift;
5555
});
5656
}
@@ -172,7 +172,7 @@ export function addPerformanceEntries(transaction: Transaction): void {
172172
// This is the time between the start of the request and the start of the response in milliseconds.
173173
_measurements['ttfb.requestTime'] = {
174174
value: (responseStartTimestamp - requestStartTimestamp) * 1000,
175-
unit: 'second',
175+
unit: 'millisecond',
176176
};
177177
}
178178
}

0 commit comments

Comments
 (0)