How to count session/checkouts in jMeter - jmeter

jMeter seems to be made to answer the question "how many parallel users can a server handle?"
That of course strongly depends on how fast the users browse the page.
What I would care about is "How many checkouts can the server handle per minute?"
So I've setup a click path that the users follow, from homepage to payment.
I slightly randomize click times (one click every 5-15 s), and use the plugin "jp#gc ultimate thread group" to step up the thread count every minute until the server fails.
What's the best way to get the highest number of checkouts per minute that was reached before the server died? Reporting seems to be all about concurrent users (threads), not taking thread restart i.e. new session into account.

There is Transactions per Second listener which plots throughput for JMeter's Samplers. If you're interested in the end-to-end business transaction - you can put all the associated Samplers under the Transaction Controller and tick both Generate Parent Sample and Include duration of timer and pre-post processors in generated sample so if you want to measure these "click times" duration of 5-15 seconds as well.
Transactions per Second listener can be installed using JMeter Plugins Manager

Related

Jmeter Scenario: Users Login once - pause until all logged in and execute process (based on iterations not time) - processes complete users log out

I'm relatively new to Jmeter but I have a scenario that I've not been able to figure out where I need to perform the following:
All user log in to application with a ramp-up period of 15 seconds between users.
No activity continues until all users log in to application.
Once all users are logged in, perform their set of business activities (will vary depending on business process, and based on iterations, not a time loop).
Once all users are complete business processes, users begin to logout with ramp-down time of 15 seconds between users.
Is this possible to configure my script to execute this way and if so, how? I have tried use of Once only controllers, loop controllers, constant timers, and some various plugins (Custom Thread Groups). I've also viewed various threads and not been able to find this exact scenario, but cannot imagine this is an overly unique test case...
Any recommendations or advice is appreciated.
Thanks!
This is highlighted in question above
Ramp-up period can be easily configured using "normal" Thread Group
To "wait" until all the users are logged in use Synchronizing Timer
Use Loop Controller to run the "business activities" as many times a you want
The same to wait until all the users finish executing their "business activities"
To implement ramp-down you can use JSR223 Timer and the following code:
return (ctx.getThreadNum() + 1) * 15000
where ctx stands for JMeterContext, see JavaDoc for all available functions and Top 8 JMeter Java Classes You Should Be Using with Groovy for more information on this and other JMeter API shorthands available for the JSR223 Test Elements.

How to Baseline a Web application using Jmeter

I want to Baseline my application .It is having two transactions "Place Order" and "Add A Product To Favorites".. Both of these transactions follow the same navigation route mostly. For the - Place Order Business Transaction the steps are Land on Login Page .. Login..Add To Cart..Checkout..Place Order. For the - Add A Product to favorites Business Transaction, the steps are : Land on Login page..Login....Add To Cart...Add to favorites. I want to run Test and see the consistent response time the application gives at a particular throughput. I have the below queries.
If I create Add to Favorites scenario as a Thread Group with 4 samplers and Place Order Scenario with 5 samplers(as given by the steps mentioned ), should I add a throughput Shaping Timer separately for the individual Thread Group and if so what would be the Throughput parameters that I should give like RPS settings.
My application has the following Max response time and avg response time for a normal Load(i.e with no queue wait time since I collected the response times by just running a single thread so that the Wait time component is Zero) .N.B L I have not added the think time for simplicity sake and also the response times are bit too costly since the backend ERPs are legacy systems.
So, the Thread Group that I will create for "Place Order" has http samplers below with their respective response times for a 1 user load:
Land on Login page - 6074 ms (avg 4492 ms)
Login using Credentials - 2549 ms (avg is 631 ms)
Add To Cart - 1553 ms (avg is 304 ms)
Land on Cart page: 47044 ms (Avg: 15901 ms)
Place Order : 19126 ms (avg is 17110 ms)
Logout : 4801 ms (avg is 2706 ms)
Below are my queries:
With the above response timings what is the max throughput i.e Place Order transactions that I can achieve so that I can set that as the TPS parameter in the Throughput shaping graph plugin and then run a load test. Please can somebody explain the calculation process to arrive at that value.
The same samplers (i.e Land on Login Page and Login and add to cart ) is used in multiple Thread Groups like the Place order Business Scenario above and the Add A Product To Favorite Business transaction . So my question is, if different Thread groups are going to pound the same Login Controller Servlet/Add to Cart Servlet (my app is a J2EE app) so how to take that into consideration so that the queue generated for the Login sampler will not affect the TPS to be achieved by place order Business scenario and the other Business scenarios that use the login sampler transaction since we will be running both the Thread groups.(One for Place Order and One thread Group for Add to favorites) while running the Load test
How to set the concurrency for a Thread group; say the Place Order Transaction .I have this question since we need to know the max response time. Hence should I add the entire response times of all the samplers in the Thread group and multiply by the TPS that we calculated and divide by 1000 .Please explain the logic in this case too.
Nobody apart from you can answer, from your numbers we can state that 1 user is capable of executing 1 Place Order request in 19 seconds or 3 Place Order requests per minute. If you add one more user there could be 2 cases:
Response time remains the same. In this case you will be able to execute 6 requests per minute with 2 users, 9 requests per minute with 3 users, etc.
Respons time increases. In this case you will NOT be able to execute 6 request per minute with 2 users due to performance bottleneck.
Check out What is the Relationship Between Users and Hits Per Second? article for more details.
I don't think you should be measuring various business use cases separately, well-behaved load test should represent real-live application usage as close as possible and in reality it is more than possible than one user creates and order while other users are logging in. However if you explicitly need to test order creation separately you can perform login in setUp Thread Group and then pass the authentication context (in majority of cases it is a set of Cookies) to the main Thread Group where the order creation takes place using i.e. Inter-Thread Communication Plugin
You don't need to know response time, you need to provide enough virtual users in order to conduct the required load (given the application is capable of handling it), consider using Concurrency Thread Group which can kick off extra threads if the current amount is not enough for maintaining the desired throughput. It can be connected with the Throughput Shaping Timer via Feedback function.

Load distribution of transaction in JMeter

During load testing can we achieve different transaction rate in same flow?
For example: I have a e-commerce web based application to do the load testing and I have to design the test in order to achieve TPH as below.
a. Transaction A: Login (100 transaction/hour)
b. Transaction B: Search Product (500 transaction/hour)
c. Transaction C: Payment (300 transaction/hour)
d. Transaction D: Logout (100 transaction/hour)
Could you please help me with Jmeter element configuration also?
You can use this component from jmeter-plugins 3rd party project:
https://jmeter-plugins.org/wiki/ThroughputShapingTimer/
It allows you to control throughput which. is what you're looking for here.
Your testing doesn't assume much load as 1000 requests per hour is less than 1 request each 3 seconds which is easily achievable either manually or using Selenium browser-based tests.
If for some reason you need to proceed with JMeter take a look at Constant Throughput Timer which can limit requests execution rate to the desired value.
Example configuration:
Add Constant Throughput Timer as a child of the Login sampler.
Add 1.66 to the "Target Throughput" input (100 requests per hour / 60 minutes in hour)
Switch "Calculate Throughput based on" dropdown to i.e. all active threads in current thread group so the throughput setting could be shared across all threads

How to control no. of requests per user in Jmeter

I am doing load testing for one ecommerce website. I am using Ultimate thread group.
Now I want to send per user only 1 request. So for ex: If 500 users then only 500 request should send. How can I achieve it using Ultimate thread group?
Why I want above because I am doing whole process like login, select product, add to cart and checkout. So it should do everything only once per user.
Your test design is a little bit flaky as given each user does login, select product, add to cart and checkout you will have at least 4 requests per user which gives 2000 requests in total (doesn't include embedded resources calls). You can use Transaction Controller to group these requests into one "workflow" however it won't limit actual amount of requests.
If you need to run your workflow by each user only once you may run into a situation when either load will be less than 500 concurrent users or test duration will be less than 30/60 minutes, see JMeter Test Results: Why the Actual Users Number is Lower than Expected
If you add more iterations each user will be executing your workflow more than once
Normally web test plan should look as follows:
Given each user executes test scenario steps and acting like a real user
Gradually increase the number of users unless application response time becomes too high or errors start occurring, whatever comes the first
Analyze results, identify the bottleneck, report your findings
Lets say the duration of the test is 1 hour. First user completes the workflow you had mentioned in the first 10 mins itself. What should happen after the workflow for the user? Should the thread be idle for the remaining 50 mins?
I think you should use the regular Thread Group with 500 threads and loop count as 1. Ultimate Thread Group is for duration based tests. You could use Once Only Controller as a workaround inside to do the action only once for the user. But it is an ugly approach.
You can use Throughput Controller.
The Throughput Controller allows the user to control how often it is executed. There are two modes:
percent execution
total executions
Percent executions
causes the controller to execute a certain percentage of the iterations through the test plan.
Total executions
causes the controller to stop executing after a certain number of executions have occurred.
Like the Once Only Controller, this setting is reset when a parent Loop Controller restarts.

jmeter calculate page load time, the which type of thread to be used to observe the maximum load in which server is stable

I am new to jmeter and scripted for login authentication. Project requirement is to see the load for 10K concurrent users.
Script is working fine but to enhance I need suggestions on how to do the following thigs:
How can I see that how much time/average time the server takes to load a page.
which thread grp (studied Ultimate thread group but it is not very clear to me), should be used to see the maximum load the server can sustain in a particular time, for that rampup time need to be adjusted (correct me if I am wrong).
Please tell how to adjust the rampup time with respect to users/waiting time etc., in short how to do incremental/proportional observation to see the server performance(there is no Gateway error etc)
If you're looking for your server capacity boundaries I would rather stick to "requests per second" rather than to "concurrent users" as users may work with different applications in a different way.
For instance, if it is image gallery - the majority of users will be browsing images and do this rather frequently, for instance request next image i.e. each 2 seconds. Given image load time 1 second it will be an image per 3 seconds - 20 images per minute. In this case 10000 users will create the load of 3333 requests per second.
If your site is articles collection, users will need some more time to read an article, i.e. 2 minutes. In that case 10000 users will create 83 requests per second load.
JMeter provides Constant Throughput Timer out of the box, you can set desired target throughput in requests per minute using it. And once you're already aware of JMeter Plugins project, it offers Throughput Shaping Timer - more advanced test element with extended functionality.
If you go "throughput" way, no matter which Thread Group you choose as the load will be orchestrated by aforementioned timers.
See What is the Relationship Between Users and Hits Per Second? article for more detailed explanation.
Once you design your test scenario run it in non-GUI mode (as JMeter's GUI is very resource intensive) as:
jmeter -n -t /path/to/your/testplan.jmx -l /path/to/resultsfile.jtl.
When the test finishes, open JMeter GUI, add Aggregate Report listener and inspect min/max/average response times per requests.

Resources