perf: remove duplicate ids in ExpMetricNames
api
#9848
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ticket
https://hpe-aiatscale.slack.com/archives/CLCE8D998/p1724182588030219
Description
Remove duplicate ids to improve API performance.
In a certain environment that has relatively lots of run data (50k~),
v1/experiments/metrics-stream/metric-names
takes some time. For example,https://gcloud.determined.ai/api/v1/experiments/metrics-stream/metric-names?ids=1&ids=1&ids=1&ids=1&ids=1&ids=1&ids=1&ids=1&ids=1&ids=1&ids=1&ids=1&ids=1&ids=1&ids=1&ids=1&ids=2&ids=3&ids=4&ids=5
takes 6s. It would take longer if there are more run data or moreids
query parameters.This PR is to improve the API response speed performance by removing the duplicate
ids
. (Sometimes the client (web frontend or user) call the API with duplicate ids)After this fix, the above API call takes around 1.8s, so 3 times faster than before. We can do some more improvement around the API, but this is the first step.
Before
After
Test Plan
ExpMetricNames
api with duplicate ids, and check if duplicated ids are removed in the API functionChecklist
docs/release-notes/
See Release Note for details.