Skip to content

Add relative percentile degradation and error count ceiling criteria to AutoStop listener - #883

Merged
undera merged 4 commits into
undera:masterfrom
hilalsidhic:mhilal/auto-stop-relative-window
Sep 2, 2026
Merged

Add relative percentile degradation and error count ceiling criteria to AutoStop listener#883
undera merged 4 commits into
undera:masterfrom
hilalsidhic:mhilal/auto-stop-relative-window

Conversation

@hilalsidhic

Copy link
Copy Markdown
Contributor

Description

As discussed in #880, this PR adds the missing criteria to the Auto-Stop Listener (jpgc-autostop):

  1. Relative Window-to-Window Percentile Degradation:

    • Compares the percentile latency of the current observation window ($P_n$) against the baseline percentile of the previous window.
    • Automatically shuts down the test if the relative growth percentage exceeds the configured threshold.
    • Fields: Percentile rank (e.g. 90), max growth % (e.g. 50%), observation window in seconds (e.g. 5s).
  2. Per-Window Absolute Error Count Ceiling:

    • Automatically shuts down the test if the absolute count of failed samples within a duration window exceeds a set threshold.
    • Fields: Max allowed error count, window duration in seconds.
  3. GUI Checkboxes & Layout:

    • Added checkboxes to the left of all 6 criteria to allow users to selectively enable/disable individual conditions without deleting their values.
    • Standardized spacing and alignment across all condition rows.
  4. Input Safety & Error Handling:

    • Fixed latent NumberFormatException when fields are left blank or unconfigured.
  5. Examples & Unit Tests:

    • Added 11 unit tests in AutoStopTest covering threshold breaches, window resets, and disabled states.
    • Added two sample .jmx test plans under examples/:
      • AutoStopExample_Percentile.jmx
      • AutoStopExample_ErrCount.jmx

Verification

  • mvn clean test package runs with 0 failures, 0 errors across all 40 tests.
  • Verified in JMeter GUI with live execution and chart rendering.

@undera undera left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks — this targets the right place, and the build is green here too (40 tests, 0 failures). I confirmed the intended percentile path works: rank 90, threshold 50%, 100ms -> 1000ms stops the test as designed.

Two blockers before this can go in, both left as inline comments:

  1. relWindowStatCalc.addSample() runs on the per-sample path without synchronization, in a NoThreadClone listener shared across all threads.
  2. A blank percentile rank does not disable the new criterion — it runs it against P0 and can stop the test. The test that covers that configuration asserts nothing and its comment claims the opposite.

The rest of the inline notes are smaller: three assert-free tests, an undeclared change to the existing percentile fallback, the removed custom-validation row, and some wording and guard mismatches.

One doc item not tied to a line: site/dat/wiki/AutoStop.md still says "Currently 3 criteria available". It was already behind by one (percentile), and this makes six — good moment to bring it up to date, including the window semantics for both new criteria.

Version bump and the marketplace versions entry I will handle at release time; no need to touch those here.

Comment thread plugins/autostop/src/main/java/kg/apc/jmeter/reporters/AutoStop.java Outdated
Comment thread plugins/autostop/src/main/java/kg/apc/jmeter/reporters/AutoStop.java Outdated
Comment thread plugins/autostop/src/test/java/kg/apc/jmeter/reporters/AutoStopTest.java Outdated
Comment thread plugins/autostop/src/main/java/kg/apc/jmeter/reporters/AutoStop.java Outdated
Comment thread plugins/autostop/src/main/java/kg/apc/jmeter/reporters/AutoStop.java Outdated
Comment thread plugins/autostop/src/main/java/kg/apc/jmeter/reporters/JAutoStopPanel.java Outdated
Comment thread plugins/autostop/src/main/java/kg/apc/jmeter/reporters/JAutoStopPanel.java Outdated
Comment thread plugins/autostop/src/test/java/kg/apc/jmeter/reporters/AutoStopTest.java Outdated
…ation and error count checks according to review comments
@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.96899% with 93 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.00%. Comparing base (09d23ae) to head (802c77a).
⚠️ Report is 133 commits behind head on master.

Files with missing lines Patch % Lines
...rc/main/java/kg/apc/jmeter/reporters/AutoStop.java 65.38% 30 Missing and 24 partials ⚠️
...n/java/kg/apc/jmeter/reporters/JAutoStopPanel.java 83.11% 7 Missing and 32 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #883      +/-   ##
============================================
+ Coverage     68.90%   69.00%   +0.10%     
- Complexity     2629     2702      +73     
============================================
  Files           230      233       +3     
  Lines         15965    16399     +434     
  Branches       1638     1710      +72     
============================================
+ Hits          11000    11316     +316     
- Misses         4146     4214      +68     
- Partials        819      869      +50     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@undera
undera merged commit 60d2311 into undera:master Sep 2, 2026
4 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.

2 participants