Skip to content

feat: Add basic performance tests of list_experiments and fetch_metrics#71

Merged
pitercl merged 7 commits intomainfrom
pl/client-e2e-perf-tests
Oct 1, 2025
Merged

feat: Add basic performance tests of list_experiments and fetch_metrics#71
pitercl merged 7 commits intomainfrom
pl/client-e2e-perf-tests

Conversation

@pitercl
Copy link
Member

@pitercl pitercl commented Sep 23, 2025

Contributes to PY-257
Completes PY-258
Completes PY-264

@pitercl pitercl force-pushed the pl/client-e2e-perf-tests branch 10 times, most recently from 513021e to 435cbce Compare September 26, 2025 10:28
description: Timeout tolerance in as float; e.g. 1.2 means 20% tolerance
required: false
default: 1.1
push:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Drop the on-push trigger from perf workflow

@pitercl pitercl force-pushed the pl/client-e2e-perf-tests branch from 6446dff to 1e81b59 Compare September 26, 2025 20:51
@linear
Copy link

linear bot commented Sep 30, 2025

@linear
Copy link

linear bot commented 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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert? Unrelated?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

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]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]

@pitercl pitercl force-pushed the pl/client-e2e-perf-tests branch from 7150aaf to 0087890 Compare September 30, 2025 15:14
@pitercl pitercl marked this pull request as ready for review October 1, 2025 13:51
@pitercl pitercl added this pull request to the merge queue Oct 1, 2025
Merged via the queue into main with commit 0a2942c Oct 1, 2025
22 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants