Skip to content

Conversation

@rschwietzke
Copy link
Contributor

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

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
@rschwietzke rschwietzke requested a review from Copilot October 6, 2025 08:36
@rschwietzke rschwietzke added enhancement New feature or request java Pull requests that update Java code PRIORITY: NORMAL labels Oct 6, 2025
@rschwietzke
Copy link
Contributor Author

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.

Copy link
Contributor

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

Copilot AI Oct 6, 2025

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.

Suggested change
// 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.

Copilot uses AI. Check for mistakes.
Comment on lines +495 to +497
// Clamp the new value to be between 0 and 2 * baseValue
newValue = Math.max(0, newValue);
newValue = Math.min(newValue, baseValue * 2);
Copy link

Copilot AI Oct 6, 2025

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.

Copilot uses AI. Check for mistakes.
{
0, 100
}
}; // 10%
Copy link

Copilot AI Oct 6, 2025

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.

Suggested change
}; // 10%
}; // 10% (100 per mil)

Copilot uses AI. Check for mistakes.
Comment on lines +67 to +70
* 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
Copy link

Copilot AI Oct 6, 2025

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.

Suggested change
* 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

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request java Pull requests that update Java code PRIORITY: NORMAL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Apply Jitter to Load Test Setup

2 participants