Skip to content

feat: add resetOnEachIteration option to DslCounter#325

Open
prateekgupta-1 wants to merge 2 commits into
abstracta:masterfrom
prateekgupta-1:feat/dsl-counter-reset
Open

feat: add resetOnEachIteration option to DslCounter#325
prateekgupta-1 wants to merge 2 commits into
abstracta:masterfrom
prateekgupta-1:feat/dsl-counter-reset

Conversation

@prateekgupta-1
Copy link
Copy Markdown

Description

This PR introduces the resetOnEachIteration(boolean) API method to DslCounter.

Currently, DslCounter wraps JMeter's native CounterConfig but does not expose its built-in capability to reset the counter on each Thread Group iteration. Adding this option allows users to cleanly reset sequence variables on loop boundaries without needing custom JSR223 pre-processors.

To improve user experience and prevent common configuration errors, calling .resetOnEachIteration(true) will also automatically enable .perThread(true), as JMeter requires per-thread tracking for this feature to work.

Changes

  • Added the resetOnEachIteration(boolean) method to DslCounter.
  • Mapped the property to the underlying CounterConfig.setResetOnThreadGroupIteration() for both test execution and GUI generation.
  • Updated the CodeBuilder to support generating this new method from JMX files.
  • Added a unit test in DslCounterTest to verify the counter reset behaviour.
  • Updated the user guide to include the new feature.

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.

1 participant