[CSM] Fix total blocking time formatting (#77751)
This commit is contained in:
parent
477c812af2
commit
e7a8aed594
|
@ -28,7 +28,7 @@ export function CoreVitals({ data, loading }: Props) {
|
|||
<EuiFlexItem>
|
||||
<CoreVitalItem
|
||||
title={LCP_LABEL}
|
||||
value={lcp ? lcp + 's' : '0'}
|
||||
value={lcp ? lcp + ' s' : '0'}
|
||||
ranks={lcpRanks}
|
||||
loading={loading}
|
||||
thresholds={CoreVitalsThresholds.LCP}
|
||||
|
@ -37,7 +37,7 @@ export function CoreVitals({ data, loading }: Props) {
|
|||
<EuiFlexItem>
|
||||
<CoreVitalItem
|
||||
title={FID_LABEL}
|
||||
value={fid ? fid + 's' : '0'}
|
||||
value={fid ? fid + ' s' : '0'}
|
||||
ranks={fidRanks}
|
||||
loading={loading}
|
||||
thresholds={CoreVitalsThresholds.FID}
|
||||
|
|
|
@ -24,7 +24,7 @@ export function formatToSec(
|
|||
const valueInMs = Number(value ?? 0) / (fromUnit === 'MicroSec' ? 1000 : 1);
|
||||
|
||||
if (valueInMs < 1000) {
|
||||
return valueInMs + ' ms';
|
||||
return valueInMs.toFixed(0) + ' ms';
|
||||
}
|
||||
return (valueInMs / 1000).toFixed(2) + ' s';
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ export function KeyUXMetrics({ data, loading }: Props) {
|
|||
<EuiFlexItem grow={false} style={STAT_STYLE}>
|
||||
<EuiStat
|
||||
titleSize="s"
|
||||
title={formatToSec(data?.tbt)}
|
||||
title={formatToSec(data?.tbt, 'ms')}
|
||||
description={TBT_LABEL}
|
||||
isLoading={loading}
|
||||
/>
|
||||
|
|
|
@ -23,7 +23,7 @@ export interface UXMetrics {
|
|||
cls: string;
|
||||
fid: string;
|
||||
lcp: string;
|
||||
tbt: string;
|
||||
tbt: number;
|
||||
fcp: number;
|
||||
lcpRanks: number[];
|
||||
fidRanks: number[];
|
||||
|
|
|
@ -127,7 +127,7 @@ export async function getWebCoreVitals({
|
|||
cls: String(cls?.values['50.0']?.toFixed(2) || 0),
|
||||
fid: ((fid?.values['50.0'] || 0) / 1000).toFixed(2),
|
||||
lcp: ((lcp?.values['50.0'] || 0) / 1000).toFixed(2),
|
||||
tbt: ((tbt?.values['50.0'] || 0) / 1000).toFixed(2),
|
||||
tbt: tbt?.values['50.0'] || 0,
|
||||
fcp: fcp?.values['50.0'] || 0,
|
||||
|
||||
lcpRanks: getRanksPercentages(lcpRanks?.values ?? defaultRanks),
|
||||
|
|
|
@ -71,7 +71,7 @@ export default function rumServicesApiTests({ getService }: FtrProviderContext)
|
|||
0,
|
||||
0,
|
||||
],
|
||||
"tbt": "0.00",
|
||||
"tbt": 0,
|
||||
}
|
||||
`);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue