Describe the bug
When two or more checks all have the same response time, both normalization helpers return NaN for the chart value.
NormalizeData and NormalizeDataUptimeDetails calculate the p0 and p95 anchors and then divide by max - min. For a constant series those anchors are equal, so the range has zero width. When the result is serialized to JSON, NaN becomes null, leaving chart consumers without a numeric value.
The existing unit tests already characterize this as a known edge case, but intentionally expect the broken result.
To reproduce
NormalizeData(
[{ responseTime: 50 }, { responseTime: 50 }],
10,
100
);
Both normalized responseTime values are NaN.
The same happens to avgResponseTime in NormalizeDataUptimeDetails.
Expected behavior
Constant response-time series should produce a finite chart value while retaining the real value in originalResponseTime or originalAvgResponseTime.
Mapping a zero-width series to rangeMin is consistent with how the minimum anchor is normally mapped and keeps the bars visible without inventing relative variation.
Describe the bug
When two or more checks all have the same response time, both normalization helpers return
NaNfor the chart value.NormalizeDataandNormalizeDataUptimeDetailscalculate the p0 and p95 anchors and then divide bymax - min. For a constant series those anchors are equal, so the range has zero width. When the result is serialized to JSON,NaNbecomesnull, leaving chart consumers without a numeric value.The existing unit tests already characterize this as a known edge case, but intentionally expect the broken result.
To reproduce
Both normalized
responseTimevalues areNaN.The same happens to
avgResponseTimeinNormalizeDataUptimeDetails.Expected behavior
Constant response-time series should produce a finite chart value while retaining the real value in
originalResponseTimeororiginalAvgResponseTime.Mapping a zero-width series to
rangeMinis consistent with how the minimum anchor is normally mapped and keeps the bars visible without inventing relative variation.