Hi Dimitri and Lisa,

Thank you so much for your input, we'll take these options into consideration.

Kind regards,

Rita Sousa
Senior Quality Manager

T: +351214460090<tel:+351214460090>  M: +351916333973<tel:+351916333973>


From: Lisa Waugh <[email protected]>
Sent: Thursday, 8 September 2022 17:57
To: JMeter Users List <[email protected]>; Rita Sousa 
<[email protected]>
Subject: RE: Failing tests based on the average time of a specific request

External Email: Do not click links or open attachments unless you know the 
content is safe.

I agree with Dmitri, use Taurus as a wrapper.  It will easily do what you want 
and is easy to implement.

Regards,

Lisa JM Waugh
Test Engineer
CIO Software & Development Experience
1 704 907 7008 Mobile
1 720 342 5373 Office
[email protected]<mailto:[email protected]>

IBM



From: Dmitri T <[email protected]<mailto:[email protected]>>
Date: Thursday, September 8, 2022 at 11:36 AM
To: JMeter Users List <[email protected]<mailto:[email protected]>>, 
Rita Sousa <[email protected]<mailto:[email protected]>>
Subject: [EXTERNAL] Re: Failing tests based on the average time of a specific 
request
It's definitely not possible with any built-in component, I can think of the 
following options: Read the .jtl results file in the tearDown Thread Group with 
JSR223 Sampler, calculate the average response time and fail this sampler (you 
might
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
ZjQcmQRYFpfptBannerEnd
It's definitely not possible with any built-in component, I can think of the 
following options:

  1.  Read the .jtl results file in the tearDown Thread Group with JSR223 
Sampler<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.blazemeter.com%2Fblog%2Fapache-groovy&data=05%7C01%7CRita.Sousa%40unit4.com%7C825aa1aac9f9432b199108da91bb1bfb%7Cee137cc45d4343cf9da5f75728b8d21f%7C0%7C0%7C637982530076256248%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2BBRsNEcsgNQAY%2BTiBf3GjxTiE5efRU7faS57bSWPlLk%3D&reserved=0>,
 calculate the average response time and fail this sampler (you might need to 
set jmeter.save.saveservice.autoflush property to true)
  2.  Use AutoStop Listener plugin and then in the pipeline compare the 
anticipated duration with the actual duration failing the test if the actual 
was shorter
  3.  You can consider switching to running your tests using 
Taurus<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgettaurus.org%2F&data=05%7C01%7CRita.Sousa%40unit4.com%7C825aa1aac9f9432b199108da91bb1bfb%7Cee137cc45d4343cf9da5f75728b8d21f%7C0%7C0%7C637982530076412476%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=sOFlLoSmjRyoWQdGcjh3mm5ZElIYezNZ0PacE9fQ2To%3D&reserved=0>
 tool as a wrapper, it provides Pass/Fail Criteria 
subsystem<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgettaurus.org%2Fdocs%2FPassFail%2F&data=05%7C01%7CRita.Sousa%40unit4.com%7C825aa1aac9f9432b199108da91bb1bfb%7Cee137cc45d4343cf9da5f75728b8d21f%7C0%7C0%7C637982530076412476%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2FVBe8l0n5LSjJcsvzhRsV9NdM6qK1mNv6YiXmb2TIdc%3D&reserved=0>
 which can return non-zero exit status code if the defined criteria are not met 
so it's kind of continuous integration friendly

Rita Sousa wrote:
Hi all,

I'm developing some performance tests for a product in my company.
Until now I have been using duration assertions to do this, where I want the 
test to fail when a specific request takes more than a certain amount of time.
This was achieved by putting the duration assertion directly below the request 
I need.

Now the requirements have changed, where I want a test to fail only if the 
average of time is more than the assertion.
In my case I use 20 users, so the test will run 20 times, and I would like to 
fail/pass the test only after the 20 users have finished and I can check the 
average time for that specific request.

Manually, I can do that looking at a Summary or Aggregate report, but I have 
all tests running in a pipeline and I would like to have JMeter fail/pass the 
test using this criteria on its own.
I looked at BeanShell and Java scripting, but I can't seem to access the 
results in the Summary Report to achieve my goal, even after looking at the 
JMeter API.
I'm not sure if I'm missing something or if this simply isn't possible.

Is there something I'm missing?
Or is there a different solution that I'm not getting at?

I appreciate any help in advance!

Kind regards,

Rita Sousa
Senior Quality Manager

T: +351214460090<tel:+351214460090>  M: +351916333973<tel:+351916333973>

My working hours: 8:00 am to 2:00 pm - Lisbon time

[cid:[email protected]]

UNIT4 Portugal Unipessoal LDA
Rua Dr. António Loureiro Borges, 9 - 11º, 1495-131, Algés - Lisbon, Portugal

This message and any attachment(s) are intended only for the use of the named 
recipient and may contain information that is privileged, confidential or 
otherwise exempt from disclosure under applicable law. If you are not the 
intended recipient, please notify the sender by return e-mail and delete this 
message from your system. Do not disclose the contents of this document to any 
other persons. Violation of this notice may be unlawful. Please note that 
internet communications are not secure and e-mails are susceptible to change. 
Thank you for your cooperation.



Reply via email to