fix width for stats size, noWrap for stats
This commit is contained in:
1 parent
72f23ca025
commit
3de392c3c9
1 file changed
+10
-4
@@ -35,7 +35,7 @@ const calculateResponseTimeStats = (checks: CheckSnapshot[]): ResponseTimeStats
|
|||||||
}
|
}
|
||||||
|
|
||||||
const responseTimes = validChecks.map((check) => check.originalResponseTime);
|
const responseTimes = validChecks.map((check) => check.originalResponseTime);
|
||||||
const max = Math.max(...responseTimes);
|
const max = Math.round(Math.max(...responseTimes));
|
||||||
const avg = Math.round(
|
const avg = Math.round(
|
||||||
responseTimes.reduce((sum, time) => sum + time, 0) / responseTimes.length
|
responseTimes.reduce((sum, time) => sum + time, 0) / responseTimes.length
|
||||||
);
|
);
|
||||||
@@ -73,14 +73,20 @@ export const HistogramResponseTime = ({
|
|||||||
<Stack
|
<Stack
|
||||||
justifyContent="center"
|
justifyContent="center"
|
||||||
alignItems={statsPosition === "left" ? "flex-end" : "flex-start"}
|
alignItems={statsPosition === "left" ? "flex-end" : "flex-start"}
|
||||||
minWidth={70}
|
width={110}
|
||||||
pr={statsPosition === "left" ? theme.spacing(8) : 0}
|
pr={statsPosition === "left" ? theme.spacing(8) : 0}
|
||||||
pl={statsPosition === "right" ? theme.spacing(8) : 0}
|
pl={statsPosition === "right" ? theme.spacing(8) : 0}
|
||||||
>
|
>
|
||||||
<Typography variant="body2">
|
<Typography
|
||||||
|
variant="body2"
|
||||||
|
noWrap
|
||||||
|
>
|
||||||
{t("common.charts.histogram.avg", { value: stats.avg })}
|
{t("common.charts.histogram.avg", { value: stats.avg })}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography variant="body2">
|
<Typography
|
||||||
|
variant="body2"
|
||||||
|
noWrap
|
||||||
|
>
|
||||||
{t("common.charts.histogram.max", { value: stats.max })}
|
{t("common.charts.histogram.max", { value: stats.max })}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
Reference in new issue
Block a user