Skip to content

Commit 0e00e45

Browse files
committed
Remove unused get_latest_metrics
1 parent 544ff1b commit 0e00e45

File tree

2 files changed

+0
-39
lines changed

2 files changed

+0
-39
lines changed

tests/vec_inf/cli/test_utils.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
convert_boolean_value,
1212
create_table,
1313
get_base_url,
14-
get_latest_metric,
1514
is_server_running,
1615
load_config,
1716
model_health_check,
@@ -150,24 +149,6 @@ def test_create_table_without_header():
150149
assert table.show_header is False
151150

152151

153-
@pytest.mark.parametrize(
154-
"log_lines,expected",
155-
[
156-
(
157-
["2023-01-01 [INFO] Avg prompt throughput: 5.2, Avg token throughput: 3.1"],
158-
{"Avg prompt throughput": "5.2", "Avg token throughput": "3.1"},
159-
),
160-
(["No metrics here"], {}),
161-
([], {}),
162-
(["Invalid metric format"], {}),
163-
],
164-
)
165-
def test_get_latest_metric(log_lines, expected):
166-
"""Test that get_latest_metric returns the latest metric entry."""
167-
result = get_latest_metric(log_lines)
168-
assert result == expected
169-
170-
171152
def test_load_config_default_only():
172153
"""Test loading the actual default configuration file from the filesystem."""
173154
configs = load_config()

vec_inf/cli/_utils.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -160,26 +160,6 @@ def load_config() -> list[ModelConfig]:
160160
]
161161

162162

163-
def get_latest_metric(log_lines: list[str]) -> Union[str, dict[str, str]]:
164-
"""Read the latest metric entry from the log file."""
165-
latest_metric = {}
166-
167-
try:
168-
for line in reversed(log_lines):
169-
if "Avg prompt throughput" in line:
170-
# Parse the metric values from the line
171-
metrics_str = line.split("] ")[1].strip().strip(".")
172-
metrics_list = metrics_str.split(", ")
173-
for metric in metrics_list:
174-
key, value = metric.split(": ")
175-
latest_metric[key] = value
176-
break
177-
except Exception as e:
178-
return f"[red]Error reading log file: {e}[/red]"
179-
180-
return latest_metric
181-
182-
183163
def convert_boolean_value(value: Union[str, int, bool]) -> bool:
184164
"""Convert various input types to boolean strings."""
185165
if isinstance(value, str):

0 commit comments

Comments
 (0)