Skip to content

Commit 6f97f6f

Browse files
committed
Minor update
1 parent 8eba2f0 commit 6f97f6f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

ci/L0_backend_vllm/metrics_test/vllm_metrics_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def get_metrics(self):
5858
r.raise_for_status()
5959

6060
# Regular expression to match the pattern
61-
pattern = r"^(vllm:.*){.*} (\d+)$"
61+
pattern = r"^(vllm:[^ {]+)(?:{.*})? ([0-9.-]+)$"
6262
vllm_dict = {}
6363

6464
# Find all matches in the text
@@ -71,7 +71,7 @@ def get_metrics(self):
7171
return vllm_dict
7272

7373
def test_vllm_metrics(self):
74-
# Supported vLLM metrics
74+
# All vLLM metrics from tritonserver
7575
expected_metrics_dict = {
7676
"vllm:prompt_tokens_total": 0,
7777
"vllm:generation_tokens_total": 0,

src/utils/metrics.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ def _log_counter(self, counter, data: Union[int, float]) -> None:
9191
Returns:
9292
None
9393
"""
94-
counter.increment(data)
94+
if data != 0:
95+
counter.increment(data)
9596

9697
def log(self, stats: VllmStats) -> None:
9798
"""Logs tracked stats to triton metrics server every iteration.

0 commit comments

Comments
 (0)