Skip to content

Commit

Permalink
Minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
yinggeh committed Aug 6, 2024
1 parent 8eba2f0 commit 6f97f6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ci/L0_backend_vllm/metrics_test/vllm_metrics_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion src/utils/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 6f97f6f

Please sign in to comment.