Merge pull request #3648 from bluewave-labs/fix/histogram-response-time

fix: histogram-response-times
This commit is contained in:
Alexander Holliday authored and GitHub committed 2026-05-12 09:52:49 -07:00
commit c1fc537479
1 file changed
+8 -7
@@ -9,6 +9,8 @@ import {
ResponsiveContainer, ResponsiveContainer,
Text, Text,
} from "recharts"; } from "recharts";
import type { TooltipProps } from "recharts";
import type { NameType, ValueType } from "recharts/types/component/DefaultTooltipContent";
import Typography from "@mui/material/Typography"; import Typography from "@mui/material/Typography";
import { useSelector } from "react-redux"; import { useSelector } from "react-redux";
@@ -18,13 +20,14 @@ import {
tooltipDateFormatLookup, tooltipDateFormatLookup,
} from "@/Utils/TimeUtils"; } from "@/Utils/TimeUtils";
import { useTheme } from "@mui/material/styles"; import { useTheme } from "@mui/material/styles";
import type { Theme } from "@mui/material/styles";
import type { GroupedCheck } from "@/Types/Check"; import type { GroupedCheck } from "@/Types/Check";
import type { RootState } from "@/Types/state"; import type { RootState } from "@/Types/state";
type XTickProps = { type XTickProps = {
x: number; x: number;
y: number; y: number;
payload: { value: any }; payload: { value: string };
range: string; range: string;
}; };
@@ -46,12 +49,9 @@ export const XTick = ({ x, y, payload, range }: XTickProps) => {
); );
}; };
type ResponseTimeToolTipProps = { type ResponseTimeToolTipProps = TooltipProps<ValueType, NameType> & {
active?: boolean | undefined;
payload?: any[];
label?: string | number;
range: string; range: string;
theme: any; theme: Theme;
uiTimezone: string; uiTimezone: string;
}; };
@@ -68,7 +68,8 @@ const ResponseTimeToolTip = ({
if (!active) return null; if (!active) return null;
const format = tooltipDateFormatLookup(range); const format = tooltipDateFormatLookup(range);
const responseTime = Math.floor(payload?.[0]?.payload?.avgResponseTime || 0); console.log(payload);
const responseTime = Math.floor(payload[0]?.payload?.originalAvgResponseTime || 0);
return ( return (
<BaseBox sx={{ py: theme.spacing(2), px: theme.spacing(4) }}> <BaseBox sx={{ py: theme.spacing(2), px: theme.spacing(4) }}>
<Typography>{formatDateWithTz(String(label), format, uiTimezone)}</Typography> <Typography>{formatDateWithTz(String(label), format, uiTimezone)}</Typography>