Skip to content

Conversation

@future-xy
Copy link
Member

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

  • Modified SyntheticTraceGenerator to accept float RPS values
  • Updated CLI to handle float RPS inputs
  • Added comprehensive test coverage
  • Maintained backward compatibility

Impact

  • Enables testing low-throughput scenarios (e.g., 0.5 RPS)
  • Provides more flexibility in test configuration
  • No breaking changes to existing functionality

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

Copilot AI left a 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

Comment on lines 64 to 65
total_requests = int(self.rps * self.duration)
total_duration_ms = self.duration * 1000
Copy link

Copilot AI Apr 25, 2025

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.

Suggested change
total_requests = int(self.rps * self.duration)
total_duration_ms = self.duration * 1000
total_requests = round(self.rps * self.duration)

Copilot uses AI. Check for mistakes.
@future-xy future-xy requested a review from Copilot April 26, 2025 12:40
Copy link

Copilot AI left a 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>

Copy link
Collaborator

@XuehengWang XuehengWang left a comment

Choose a reason for hiding this comment

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

Looks good!

@future-xy future-xy merged commit ff40629 into main May 21, 2025
2 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.

3 participants