(ui): Fix QueueSizeMetricsChart

This commit is contained in:
Ken Hibino
2021-12-01 19:06:51 -08:00
parent f304d97e11
commit c8cbc49122
2 changed files with 18 additions and 1 deletions

View File

@@ -140,6 +140,8 @@ function MetricsView(props: Props) {
}
}, [pollInterval, getMetricsAsync, durationSec, endTimeSec, endTimeOption]);
const now = currentUnixtime();
return (
<Container maxWidth="lg" className={classes.container}>
<Grid container spacing={3}>
@@ -322,7 +324,15 @@ function MetricsView(props: Props) {
</Grid>
<Grid item xs={12}>
<Typography>Queue Size</Typography>
<QueueSizeMetricsChart data={data?.data.result || []} />
<QueueSizeMetricsChart
data={data?.data.result || []}
endTime={endTimeOption === "real_time" ? now : endTimeSec}
startTime={
endTimeOption === "real_time"
? now - durationSec
: endTimeSec - durationSec
}
/>
</Grid>
</Grid>
<Grid item xs={12}>