-
Notifications
You must be signed in to change notification settings - Fork 2
Fy/flexible rps #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add support for floating-point requests per second (RPS) values in the trace generator, making the load testing more flexible for low-throughput scenarios. Changes include: - Update type hints from `int` to `Union[int, float]` for RPS parameter - Cast total_requests to int when calculating from float RPS - Change CLI option type from int to float with default value 1.0 - Update validation error message to reflect new type requirement - Add comprehensive test cases for float RPS values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for floating-point RPS values in the trace generator, allowing more granular load testing scenarios. Key changes include:
- Updating SyntheticTraceGenerator to accept Union[int, float] for RPS and ensuring proper conversion in request count calculation.
- Modifying CLI options and argument types to handle float RPS values.
- Adding comprehensive tests to validate the float RPS behavior.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tracestorm/trace_generator.py | Updated type annotations and validation for RPS; added conversion logic for float values. |
| tracestorm/cli.py | Adjusted CLI options to accept float RPS and updated related type imports. |
| tests/test_trace_generator.py | Added tests to cover synthetic trace generation with float RPS values. |
| tests/test_cli.py | Added tests to verify CLI behavior with float RPS values. |
| tracestorm/main.py | The entire main file has been removed. Please verify if this deletion was intentional. |
Comments suppressed due to low confidence (1)
tracestorm/main.py:1
- The file 'tracestorm/main.py' has been entirely removed; please confirm if this deletion was intentional as it may disrupt the CLI and overall application entry point.
Entire file removed
tracestorm/trace_generator.py
Outdated
| total_requests = int(self.rps * self.duration) | ||
| total_duration_ms = self.duration * 1000 |
Copilot
AI
Apr 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Casting the product of rps and duration to int floors the resulting value, which may not reflect the intended rounding behavior for fractional RPS values. Consider using an alternative rounding method if preserving the fractional part's impact is desired.
| total_requests = int(self.rps * self.duration) | |
| total_duration_ms = self.duration * 1000 | |
| total_requests = round(self.rps * self.duration) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for floating-point RPS values in the trace generator and CLI, allowing more granular load testing while maintaining backward compatibility. Key changes include updating the SyntheticTraceGenerator and CLI options to accept float RPS values, enhancing test coverage to validate the new behavior, and removing the main.py file.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tracestorm/trace_generator.py | Updated parameter types and error messages in SyntheticTraceGenerator for float RPS support. |
| tracestorm/main.py | Removed the file—ensure this change is intentional and that references to the main entry point are updated accordingly. |
| tracestorm/cli.py | Adjusted CLI options and create_trace_generator signature to accept float RPS values. |
| tests/test_trace_generator.py | Added tests verifying the behavior with float RPS values. |
| tests/test_cli.py | Enhanced CLI tests to cover scenarios with float RPS values. |
Comments suppressed due to low confidence (1)
tracestorm/main.py:1
- The removal of tracestorm/main.py is significant; please confirm that this change is intentional and that any dependencies or references to this entry point are updated accordingly.
<entire file removed>
XuehengWang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Summary
This PR adds support for floating-point RPS (requests per second) values in the trace generator, enabling more granular control over load testing scenarios.
Changes
SyntheticTraceGeneratorto accept float RPS valuesImpact