Skip to content

Commit

Permalink
[Model Monitoring] Fix querying invocations metric by itself (#5652)
Browse files Browse the repository at this point in the history
* [Datastore] Fix querying invocations metric by itself

[ML-6606](https://iguazio.atlassian.net/browse/ML-6606)

* Fix check in system test

* Fix the fix

* Revert "Fix the fix"

This reverts commit 400383d.
  • Loading branch information
gtopper committed May 29, 2024
1 parent 4436666 commit 8629217
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
19 changes: 10 additions & 9 deletions server/api/api/endpoints/model_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,16 +521,17 @@ async def get_model_endpoint_monitoring_metrics_values(
)
)
)
coroutines.append(
run_in_threadpool(
tsdb_connector.read_metrics_data,
endpoint_id=params.endpoint_id,
start=params.start,
end=params.end,
metrics=metrics_without_invocations,
type=type,
if metrics_without_invocations:
coroutines.append(
run_in_threadpool(
tsdb_connector.read_metrics_data,
endpoint_id=params.endpoint_id,
start=params.start,
end=params.end,
metrics=metrics_without_invocations,
type=type,
)
)
)

metrics_values = []
for result in await asyncio.gather(*coroutines):
Expand Down
2 changes: 1 addition & 1 deletion tests/system/model_monitoring/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def _test_api_get_metrics(
if type == "metrics":
expected_results.add("invocations")

assert get_app_results == getattr(app_data, type)
assert get_app_results == expected_results
assert app_results_full_names, f"No {type}"
return app_results_full_names

Expand Down

0 comments on commit 8629217

Please sign in to comment.