fix: calculate conservative SLO percentiles

This commit is contained in:
Josh Creek
2026-08-31 21:08:49 +01:00
parent bc7136b2cb
commit 58e8a5c523
2 changed files with 14 additions and 1 deletions
+6
View File
@@ -25,3 +25,9 @@ func TestEvaluateSLODoesNotInventFailureForEmptyOptionalWindows(t *testing.T) {
t.Fatalf("empty window violations = %+v", violations)
}
}
func TestPercentileUsesConservativeNearestRankForSmallWindows(t *testing.T) {
if got := percentile([]time.Duration{time.Millisecond, 101 * time.Millisecond}, .95); got != 101*time.Millisecond {
t.Fatalf("p95 underreported small window: %s", got)
}
}