From c8d06424faaf31575e70ce13a81c2830661b18da Mon Sep 17 00:00:00 2001 From: "minke.yu" Date: Sun, 18 Oct 2026 09:53:17 +0800 Subject: [PATCH] =?UTF-8?q?gateway=20metrics:=20T25b=20test=20fix=20?= =?UTF-8?q?=E2=80=94=20le=20buckets=20are=20cumulative?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sgl-model-gateway/src/observability/metrics.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sgl-model-gateway/src/observability/metrics.rs b/sgl-model-gateway/src/observability/metrics.rs index ae15ab456f..4c81a4d042 100644 --- a/sgl-model-gateway/src/observability/metrics.rs +++ b/sgl-model-gateway/src/observability/metrics.rs @@ -1622,14 +1622,15 @@ mod tests { out.contains("smg_g9i_class_ttft_seconds_bucket{class=\"hot\",le=\"+Inf\"} 5"), "+Inf bucket counts all 5:\n{out}" ); - // lookup_depth: 7 -> le=10; 120 -> le=200. + // lookup_depth: 7 -> le=10; both samples (7, 120) <= 200 + // (Prometheus buckets are cumulative). assert!( out.contains("smg_g9i_shadow_prefix_lookup_depth_bucket{le=\"10\"} 1"), "depth 7 lands in le=10:\n{out}" ); assert!( - out.contains("smg_g9i_shadow_prefix_lookup_depth_bucket{le=\"200\"} 1"), - "depth 120 lands in le=200:\n{out}" + out.contains("smg_g9i_shadow_prefix_lookup_depth_bucket{le=\"200\"} 2"), + "both depths land at or below le=200 (cumulative):\n{out}" ); assert!( out.contains("smg_g9i_shadow_prefix_lookup_depth_count 2"),