JMeter load test async api - jmeter

I make a post call to an api, and don't need to log the response (post to google cloud pubsub), but after that i need to measure time it takes for the data to be processed and appear in another GET request (need to keep hitting it unless the response changes).
I also need to measure the performance under load. I tried JMeter but could not figure out a way to get what I wanted. Is there a way to do this in Jmeter? or some other tool that will let me do what i want

You can put your "another GET request" under a While Controller so JMeter will keep sending this request unless it will match some defined condition
You can put the whole sequence of requests under the Transaction Controller - this way JMeter will measure end-to-end duration of the whole scenario

Related

In Jmeter, A perquisite sampler request should be a part of transaction controller or not?

Usecase:
User searches a product and validates the response time
User validates response time in pagination functionality of searched result.
To check pagination, we need to search. Should this be part of second test or jmeter doesn't require previous request like UI, can we skip this and only test the pagination request?
As per JMeter project main page:
JMeter is not a browser, it works at protocol level. As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does (it's possible to view the response as HTML etc., but the timings are not included in any samples, and only one sample in one thread is ever displayed at a time).
So if there are no dynamic parameters which store client state like ViewState or associated Cookies then you should be able to test the pagination without executing the "main" search request and only perform the correlation to see if there are more pages left, get the number of the current page, etc.
With regards to whether to put it under the Transaction Controller or not - it's totally up to you, Transaction Controller doesn't have any logic when it comes to "continuation" of the previous request, it just sums up the elapsed time of its children and reports the total amount taken.

Calculate the time for Sync in Two micro service using Jmeter

I have Scripts Two API:
Post API
Get API
I need to calculate The time have to sync between First API and Second API and Calculate the Time its take to sync , In simply way I need to hit the Get API until I get Success response and Calculate the time for all these request Until Success for These hits , is there a way to do that using Jmeter ?
Organize your Test Plan as follows:
Transaction Controller - to measure the duration of the whole requests sequence
While Controller - to loop the "First API" unless you get Success
Post API
PostProcessor - to get "success" criteria
Get API

Jmeter - wait for a specific response and collect total response time

our application is testing file upload and I'm curious if I can make Jmeter wait for a specific response and then report collective time.
What I have now is:
whileLoop()
-- HTTP Sampler
-- JSON Extractor
JSON Extracor pulls out a specific field and if it's not null then the loop stops.
The problem is that JMeter doesn't report response time as a sum of all the responses (response times) it had to make and that is what I'm looking for. Is there a way to implement this?
You can put this code inside a Transaction Controller .
You should get what you want.

Jmeter, delay http request with many extracted urls

i have a issue with to many calls to the server.
I have extracted several urls with the "regex extractor".
In the next step, a "http request" calls these urls by ${extractet-urls}
But all requests after the 8th url gets a error 500 response from the server.
I tried to input several timers between, before and everywhere else, but it hasn't an impact.
So my question is:
how can i delay in this single http request which calls all the extracted urls?
Thanks for your help :)
After the requeat you can add sampler ->Java Request. Then change classname to SleepTest and it'll wait 1 second (configurable)
Add a Constant Timer as a child of the HTTP Request sampler (see Scoping Rules for details) and provide desired delay there (in milliseconds). It will cause the relevant thread to "sleep" for the defined amount of milliseconds before executing the HTTP Request. See A Comprehensive Guide to Using JMeter Timers to learn more about using Timers in JMeter tests.
Another option could be using Test Action sampler to create a delay, it doesn't generate sample result so you won't see it in .jtl results file.
The final approach is depending on what you're trying to achieve and how your test is designed.
Alternatively, you can add a Thread Group and define a ramp up time, then put the request inside this group. The ramp up time takes the startup overload too.

How to measure the Test Fragment response time in jMeter?

My jMeter script performs visiting the Workout history page of the website.
While leading there the app sends 8 api requests. We put them into one Test Fragment but while running scripts in jMeter I get the response time of each HTTP Request.
Is there any possibility to get the response time of the whole Test Fragment?
My Test Fragment screenshot
It is simple. You just add a Transaction Controller in the Test Fragment. Move all the HTTP requests under the Transaction Controller.
If you are looking for only the total time of all the requests, then check the Generate parent sample checkbox.
you could definitely do this in beanshell, start a timer and then calculate the end time.
Also you might try something like the JC#gc package of extra plugins for something like responses over time.

Resources