feat: Add basic performance tests of list_experiments and fetch_metrics#71
Merged
feat: Add basic performance tests of list_experiments and fetch_metrics#71
Conversation
513021e to
435cbce
Compare
gabrys
suggested changes
Sep 26, 2025
| description: Timeout tolerance in as float; e.g. 1.2 means 20% tolerance | ||
| required: false | ||
| default: 1.1 | ||
| push: |
Contributor
There was a problem hiding this comment.
TODO: Drop the on-push trigger from perf workflow
6446dff to
1e81b59
Compare
gabrys
reviewed
Sep 30, 2025
Comment on lines
26
to
77
| @@ -74,7 +74,7 @@ def fetch_metrics( | |||
| restricted_attributes = validation.restrict_attribute_filter_type(attributes, type_in={"float_series"}) | |||
|
|
|||
| valid_context = validate_context(context or get_context()) | |||
| client = get_client(context=valid_context) | |||
| client = _client.get_client(context=valid_context) | |||
Member
Author
There was a problem hiding this comment.
Related & required. I'm currently mocking get_client in perf tests in order to inject the x-perf-request header.
Comment on lines
100
to
101
| min_val = random.uniform(MIN_NUMERIC_VALUE, MAX_NUMERIC_VALUE) | ||
| max_val = random.uniform(min_val, MAX_NUMERIC_VALUE) |
Contributor
There was a problem hiding this comment.
Suggested change
| min_val = random.uniform(MIN_NUMERIC_VALUE, MAX_NUMERIC_VALUE) | |
| max_val = random.uniform(min_val, MAX_NUMERIC_VALUE) | |
| min_val, max_val = sorted(random.uniform(MIN_NUMERIC_VALUE, MAX_NUMERIC_VALUE) for _ in (1, 2)) |
| proto_attr.float_series_properties.max = max_val | ||
| proto_attr.float_series_properties.last = random.uniform(min_val, max_val) | ||
| proto_attr.float_series_properties.average = random.uniform(min_val, max_val) | ||
| proto_attr.float_series_properties.variance = random.uniform(MIN_VARIANCE, MAX_NUMERIC_VALUE) |
Contributor
There was a problem hiding this comment.
Suggested change
| proto_attr.float_series_properties.variance = random.uniform(MIN_VARIANCE, MAX_NUMERIC_VALUE) | |
| proto_attr.float_series_properties.variance = random.uniform(MIN_VARIANCE, MAX_VARIANCE) |
tests/performance/backend/endpoints/get_multiple_float_series_values.py
Outdated
Show resolved
Hide resolved
Comment on lines
101
to
107
| initial_step = 1 if after_step is None else (after_step + 1) | ||
| total_remaining_steps = series_cardinality - (initial_step - 1) | ||
| steps_in_current_request = min(total_remaining_steps, max_values) | ||
| max_step = initial_step + steps_in_current_request - 1 | ||
| step_range = range(int(initial_step), int(max_step) + 1) | ||
|
|
||
| return [(1600000000 + step, step, random.uniform(-1e6, 1e6)) for step in step_range] |
Contributor
There was a problem hiding this comment.
Suggested change
| initial_step = 1 if after_step is None else (after_step + 1) | |
| total_remaining_steps = series_cardinality - (initial_step - 1) | |
| steps_in_current_request = min(total_remaining_steps, max_values) | |
| max_step = initial_step + steps_in_current_request - 1 | |
| step_range = range(int(initial_step), int(max_step) + 1) | |
| return [(1600000000 + step, step, random.uniform(-1e6, 1e6)) for step in step_range] | |
| initial_step = 1 if after_step is None else (after_step + 1) | |
| initial_timestamp = 1600000000 # some time in the year 2020 | |
| total_remaining_steps = series_cardinality - (initial_step - 1) | |
| steps_in_current_request = min(total_remaining_steps, max_values) | |
| max_step = initial_step + steps_in_current_request - 1 | |
| step_range = range(int(initial_step), int(max_step) + 1) | |
| return [(initial_timestamp + step, step, random.uniform(-1e6, 1e6)) for step in step_range] |
7150aaf to
0087890
Compare
gabrys
approved these changes
Oct 1, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Contributes to PY-257
Completes PY-258
Completes PY-264