diff --git a/client/src/Components/common/charts/HeatmapResponseTimeTooltip.tsx b/client/src/Components/common/charts/HeatmapResponseTimeTooltip.tsx index dc36ee5d9..8bc651c8c 100644 --- a/client/src/Components/common/charts/HeatmapResponseTimeTooltip.tsx +++ b/client/src/Components/common/charts/HeatmapResponseTimeTooltip.tsx @@ -58,7 +58,7 @@ export const HeatmapResponseTimeTooltip = ({ {t("common.labels.responseTime")}:{" "} - {check?.originalResponseTime?.toFixed() ?? "-"} ms + {check?.originalResponseTime?.toFixed() ?? "N/A"} ms Status:{" "} diff --git a/server/src/utils/dataUtils.ts b/server/src/utils/dataUtils.ts index 3c86c911e..f6d877a35 100755 --- a/server/src/utils/dataUtils.ts +++ b/server/src/utils/dataUtils.ts @@ -45,7 +45,7 @@ export const NormalizeData = (checks: T[], rangeMin: const min = calculatePercentile(checks, 0); const max = calculatePercentile(checks, 95); const normalizedChecks = checks.map((check) => { - const originalResponseTime = check.responseTime; + const originalResponseTime = typeof check.responseTime === "number" ? check.responseTime : 0; let normalizedResponseTime = rangeMin + ((check.responseTime - min) * (rangeMax - rangeMin)) / (max - min); normalizedResponseTime = Math.max(rangeMin, Math.min(rangeMax, normalizedResponseTime)); @@ -59,7 +59,8 @@ export const NormalizeData = (checks: T[], rangeMin: return normalizedChecks; } else { return checks.map((check) => { - return { ...check, originalResponseTime: check.responseTime }; + const originalResponseTime = typeof check.responseTime === "number" ? check.responseTime : 0; + return { ...check, originalResponseTime: originalResponseTime }; }); } };