Skip to content

Fix timing issues in samplers - #165

Merged
3dgiordano merged 1 commit into
developmentfrom
FIX-SAMPLERS-TIMING
Aug 24, 2026
Merged

Fix timing issues in samplers#165
3dgiordano merged 1 commit into
developmentfrom
FIX-SAMPLERS-TIMING

Conversation

@3dgiordano

Copy link
Copy Markdown
Collaborator

This pull request introduces support for accurately measuring and configuring how parent samples in the HTTP Async Controller report their duration, aligning with JMeter's Transaction Controller behavior and fixing timing issues with think times and pre/post-processors. It adds a new option to include or exclude timer and processor durations in the generated parent sample, updates the GUI to expose this option, and refines how sample timings are tracked and reported.

New Feature: Parent Sample Timing Configuration

  • Added the option "Include duration of timer and pre-post processors in generated sample" to the HTTP2 Controller, allowing users to choose whether parent samples should include or exclude time spent in timers and processors [1] [2] [3].
  • Updated the GUI (HTTP2ControllerGUI.java) to include a checkbox for this setting, which is only enabled when "Generate Parent Sample" is selected. The checkbox state is synchronized with the controller's configuration [1] [2] [3] [4] [5] [6].

Accurate Sample Timing and Measurement

  • Refactored how the HTTP Async Controller measures and applies parent sample timing: when "include timers" is off, the parent sample duration is set to the span from the first request sent to the last response received, excluding idle time.
  • Ensured that parent sample timing is always set, even when iterations are aborted or cut short, preventing negative or incorrect durations in aggregate reports.

Timing Infrastructure Improvements

  • Introduced a Stamp mechanism in HTTP2FutureResponseListener to accurately track both wall clock and monotonic times for request start and end, improving reliability and correctness of sample timestamps [1] [2].
  • Updated methods to adopt and translate timing information between listeners and sample results, ensuring sample durations are consistent and immune to clock drift [1] [2].

Compatibility and Defaults

  • The new timing option defaults to "off" for the HTTP Async Controller, matching its historical behavior and avoiding breaking changes, while still honoring explicit settings from JMX files or the GUI.
  • Ensured compatibility with JMeter's own Transaction Controller by using the same property name for the timer inclusion setting.

These changes collectively improve the accuracy, configurability, and reliability of parent sample timing in the HTTP Async Controller, addressing longstanding issues with transaction time reporting and aligning behavior with user expectations.

@3dgiordano
3dgiordano merged commit 8608a0c into development Aug 24, 2026
2 checks passed
@3dgiordano
3dgiordano deleted the FIX-SAMPLERS-TIMING branch August 24, 2026 19:43
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