From 6f97f6f9097bb8be59e9882ba442c13994aeefc9 Mon Sep 17 00:00:00 2001 From: Yingge He Date: Tue, 6 Aug 2024 15:15:20 -0700 Subject: [PATCH] Minor update --- ci/L0_backend_vllm/metrics_test/vllm_metrics_test.py | 4 ++-- src/utils/metrics.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ci/L0_backend_vllm/metrics_test/vllm_metrics_test.py b/ci/L0_backend_vllm/metrics_test/vllm_metrics_test.py index ed231f32..9c69ccab 100644 --- a/ci/L0_backend_vllm/metrics_test/vllm_metrics_test.py +++ b/ci/L0_backend_vllm/metrics_test/vllm_metrics_test.py @@ -58,7 +58,7 @@ def get_metrics(self): r.raise_for_status() # Regular expression to match the pattern - pattern = r"^(vllm:.*){.*} (\d+)$" + pattern = r"^(vllm:[^ {]+)(?:{.*})? ([0-9.-]+)$" vllm_dict = {} # Find all matches in the text @@ -71,7 +71,7 @@ def get_metrics(self): return vllm_dict def test_vllm_metrics(self): - # Supported vLLM metrics + # All vLLM metrics from tritonserver expected_metrics_dict = { "vllm:prompt_tokens_total": 0, "vllm:generation_tokens_total": 0, diff --git a/src/utils/metrics.py b/src/utils/metrics.py index ff78ddf4..24ce4eae 100644 --- a/src/utils/metrics.py +++ b/src/utils/metrics.py @@ -91,7 +91,8 @@ def _log_counter(self, counter, data: Union[int, float]) -> None: Returns: None """ - counter.increment(data) + if data != 0: + counter.increment(data) def log(self, stats: VllmStats) -> None: """Logs tracked stats to triton metrics server every iteration.