-
Notifications
You must be signed in to change notification settings - Fork 12
feat: Add jitter to load test setup #612
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
base: develop
Are you sure you want to change the base?
Conversation
This commit introduces a new 'jitter' feature to the load test configuration, allowing for more realistic load simulations. A new 'jitter' property can be added to the test case configuration, which applies random variations to the number of users or arrival rate over time. The jitter is calculated using a Gaussian distribution and is seeded for reproducibility. The implementation ensures that supporting points in a flexible load profile remain unchanged. Unit tests have been added to validate the new functionality. Fixes #545
|
That is once again a Jules test. So we have to carefully review the suggestion and learn how much is useful or not. Don't merge that thing right away. |
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 introduces a jitter feature to load test configurations to enable more realistic load simulations. The jitter applies random variations to user count or arrival rate using a Gaussian distribution with configurable amplitude and seeded randomization for reproducibility.
- Adds jitter configuration property support to test case load profiles
- Implements Gaussian-based jitter calculation with value clamping
- Preserves supporting points in flexible load profiles while applying jitter to intermediate points
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| LoadFunctionUtils.java | Implements core jitter application logic with interpolation and Gaussian distribution |
| TestLoadProfileConfiguration.java | Adds jitter property parsing and applies jitter to load functions |
| TestCaseLoadProfileConfiguration.java | Adds jitter field and getter/setter to configuration data model |
| LoadFunctionUtilsTest.java | Comprehensive unit tests validating jitter functionality and edge cases |
| build.properties | Updates Chrome executable path (unrelated configuration change) |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| final double jitter = jitterPermil / 1000.0; | ||
|
|
||
| // nextGaussian() has a mean of 0 and a standard deviation of 1. | ||
| // Clamp it to the range [-1, 1] to avoid extreme values and adhere to the hint in the issue. |
Copilot
AI
Oct 6, 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.
The comment mentions 'the hint in the issue' but this reference is unclear and not helpful for future maintainers. Consider replacing with a more specific explanation of why clamping to [-1, 1] is necessary.
| // Clamp it to the range [-1, 1] to avoid extreme values and adhere to the hint in the issue. | |
| // Clamp the value to the range [-1, 1] to prevent rare but extreme outliers from the Gaussian distribution, | |
| // which could otherwise cause unrealistic or excessive deviations in the load function. |
| // Clamp the new value to be between 0 and 2 * baseValue | ||
| newValue = Math.max(0, newValue); | ||
| newValue = Math.min(newValue, baseValue * 2); |
Copilot
AI
Oct 6, 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.
The rationale for clamping the upper bound to 2 * baseValue is not documented. This seems like an arbitrary constraint that should be explained or made configurable.
| { | ||
| 0, 100 | ||
| } | ||
| }; // 10% |
Copilot
AI
Oct 6, 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.
The comment '10%' is incorrect. The jitter value is 100, which represents 10% in per mil (100/1000), but this could be confusing. Consider clarifying the comment or using a more obvious value.
| }; // 10% | |
| }; // 10% (100 per mil) |
| * Returns the jitter as two-dimensional array of non-negative integral values whereas the 1st dimension specifies | ||
| * the time offset in seconds and the 2nd dimension specifies the jitter in per mil at the given time offset. | ||
| * | ||
| * @return the jitter |
Copilot
AI
Oct 6, 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.
The javadoc states 'non-negative integral values' but doesn't mention that null is also a valid return value, which should be documented for API clarity.
| * Returns the jitter as two-dimensional array of non-negative integral values whereas the 1st dimension specifies | |
| * the time offset in seconds and the 2nd dimension specifies the jitter in per mil at the given time offset. | |
| * | |
| * @return the jitter | |
| * Returns the jitter as a two-dimensional array of non-negative integral values whereas the 1st dimension specifies | |
| * the time offset in seconds and the 2nd dimension specifies the jitter in per mil at the given time offset. | |
| * <p> | |
| * May return {@code null} if no jitter is configured. | |
| * | |
| * @return the jitter, or {@code null} if not configured |
This commit introduces a new 'jitter' feature to the load test configuration, allowing for more realistic load simulations.
A new 'jitter' property can be added to the test case configuration, which applies random variations to the number of users or arrival rate over time.
The jitter is calculated using a Gaussian distribution and is seeded for reproducibility.
The implementation ensures that supporting points in a flexible load profile remain unchanged.
Unit tests have been added to validate the new functionality.
Fixes #545