Home > Enterprise >  Determine that 95% of all the requests took no longer than 1 second and automatically stop the test
Determine that 95% of all the requests took no longer than 1 second and automatically stop the test

Time:10-17

I want to run a stress test by continuously increasing load until the response times become unacceptable. The condition that I need to check against is that 95% of all the requests take no longer than 1 second.

  1. Can I determine this dynamically at runtime and if yes, how?
  2. How can I stop the test when this condition is achieved?

I looked at the AutoStop Listener plugin, but it does not seem to have what I need for checking this condition.

CodePudding user response:

The easiest is going for Taurus framework which provides flexible and powerful Pass/Fail Criteria subsystem

Example Taurus YAML file:

execution:
- scenario: simple

scenarios:
  simple:
    script: /path/to/your/test.jmx

reporting:
- module: passfail
  criteria:
  - p95.0>1s, stop as failed  

In case if 95 percentile of all requests will exceed 1 second Taurus will stop the test and return non-zero exit status code which is kind of scripting/CI friendly approach.

In JMeter it is also possible with some JSR223 Scripting, you could periodically read the .jtl results file, calculate the percentile, check it against anticipated value, etc.

CodePudding user response:

For stopping test if one sampler was above 1 second use Duration Assertion with 1000 ms

tests that each response was received within a given amount of time

You can stop test if assertion failed:

In Thread group select Stop Test/Stop Test Now under Action to be taken after a sampler error

Determines what happens if a sampler error occurs, either because the sample itself failed or an assertion failed

  • Related