am running test in duration based scenario with jmeter 5.4.1, at the end of the script, test is getting stop prematurely without executing some of the calls in the last iteration, please help me to make sure all the calls executed in the last iteration, i have tried loop,duration controller nothing seems. to be prominent
Example: i have home, login, search,select item & logout, duration of 5 min with 1 user
Test execution : Home 10 login 10 search 9 select item 9 logout 9
Test execution : Home 10
login 10
search 9
select item 9
logout 9
If you set duration in the Thread Group or in Runtime Controller it doesn't guarantee that all Sampler will be executed equal number of times, when the duration is reached or exceeded JMeter will start shutting down the threads (virtual users) and the total number of sample results will mainly depend on the application response time.
So if you want to execute everything 10 times only - set number of loops in the Thread Group to 10 and either increase or remove the duration.
Alternatively you can use Concurrency Thread Group configured like:
this way 1 user will execute samplers for 5 minutes as fast as it can but not more than 10 times.
Related
My scenario is , I record a test and it will take 10 second to finish ,after that I put a duration and make it 5 minutes , so my question is , is my test will be take time same as duration ? or the test will be finished in 10 second but the result will display after 5 minutes?
Test will be finished:
When the last Sampler is executed
Or the time set in "Duration" passes
whatever comes the first
If you have only 1 loop on Thread Group level - all the samplers will be executed once, if you have 2 loops - they will be executed twice, etc. The "duration" constraint is applicable at any case.
More information: Getting Started with JMeter - A Basic Tutorial
I have 8 threads in JMeter, which i am executing for every 5 minutes using Task scheduler.
Now i have included 2 threads which want to run for 5 times per day only (ex: at 12am, 5am,10am...)
when the moment comes, the execution shall be 8+2 & remaining time, it shall be only 8 threads.
Is it possible to configure such usecase in Jmeter..
If you're going to use the same .jmx script and want to execute either 8 or 10 "threads" (whatever it is), you can go for:
If Controller - for conditional execution of this or that test elements
__groovy() function to check current time, an example condition which trigger the test at i.e. 5 AM would be:
${__groovy(Calendar.getInstance().get(Calendar.HOUR_OF_DAY) == 5 && Calendar.getInstance().get(Calendar.MINUTE) == 0,)}
Can you help me to explain relationship between time in Runtime Controller and Ramp_up period value of Thread group?
I tested
Number of Thread: 1
Ramp_Up Period: 1
Loop count: 1
Runtime Controller: 5s
->Elapsed time of current running test: 5s
But with case
Number of Thread: 5
Ramp_Up Period: 5
Loop count: 1
Runtime Controller: 5s
->Elapsed time of current running test: 10s
I don't understand why it become 10s.
Could you help me to explain more?
Ramp up is the time to execute all threads, runtime is controlling each thread execution.
In your case, ramp up 5 seconds means last thread will be executed after 5 seconds. Last thread will enter runtime controller which will run 5 seconds of execution. Thus 10 seconds is the maximum of your execution.
Runtime Controller acts according to JMeter Scoping Rules so it defines how long its children are allowed to run.
Normally you should be using it in conjunction with Loop Count = Forever or -1 on either Thread Group or Loop Controller level.
So
if you want the whole test to run for 5 seconds - use "Scheduler" section of the Thread Group
if you want only certain sampler(s) to run for 5 seconds - put them under the Runtime Controller, however the whole test duration will depend on when the last sampler enters the Runtime Controller
Also be aware that JMeter "asks" threads to stop so it might take some extra time to let them gracefully shut down.
I have included 4 Thread groups in one test plan and recorded script for all thread groups . As all ALL thread groups contain login script , so can i record time for first request of login from all the thread groups ? and then another 4 users entering system and login again and time is recorded -> this i have to do for 100 threads :::: first 4 users come then other 4 come and perform login .please tell if anyone could solve my issue .
If I got your scenario right you need to go for the following configuration:
Thread Group (Number of Threads: 4, Loop Count: 25)
HTTP Request sampler which performs login
Synchronizing Timer (Number of Simulated Users to Group By: 4)
This way you will have 100 requests in total, there will be 25 "login" loops when 4 virtual users will perform login at exactly the same moment.
Running a recorded test plan. I have assigned in Thread Group for No of users is 25, Ramp-up period is 25 and Loop Count is 1.
a).Start the test.
b).While the test is running in the upper right-hand corner, the number gets increment 1 by 1 until 9/25. At some level, the number remains constant 9/25 and then shows 8/25. After some time, the number automatically gets decrements by 1, 7/25....0/25.
c). In Database also, i seen the login entry only 9 users.
why my test plan not gets succeeded for the 25 users ? Please suggest me ?
This is because - your test seems to be only 9 seconds long. ie. after 9th second, by the time the 10th thread is created, first thread finishes its execution. so it shows the concurrent user load on the server remains 9.
Remember that each thread/user is executed independently.
Lets assume - your recorded test plan takes 5 seconds to complete for an user/thread.
So, in your case,
second 1: user/thread 1 gets created & execution starts
second 2: user/thread 1 execution in-progress, user/thread 2 gets created & execution starts
second 3: user/thread 1 & 2 execution in-progress, user/thread 3 gets created & execution starts
second 4: user/thread 1,2 & 3 execution in-progress, user/thread 4 gets created & execution starts
second 5: user/thread 1,2,3 & 4 execution in-progress, user/thread 5 gets created & execution starts
second 6: user/thread 1 finished execution (5 seconds). user/thread 2,3,4 & 5 in progress. user/thread 6 gets created & execution starts
If you see, after 6th second, concurrent thread will be 5 because thread 1 already finished its execution.
If you need to see all the 25 users in 25 seconds (25/25) - then your test be taking more than 25 seconds.
(from your question - looks like your test is only 9 seconds long. so you can not expect 25 / 25 with 1 loop count)
Do the following:
Click the checkbox 'Forever' in the Loop count
Click the checkbox 'Scheduler'
Set the duration 60 seconds.
Run the test now - you will see 25 users in 25 seconds - the test will stop after 60 seconds. Scheduler will keep threads execute continuously for 60 seconds.
Hope it is clear.
25 users in thread group doesn't always mean that you'll be having 25 concurrent requests.
There are several options on how you can implement your load scenario:
Ultimate Thread Group (available via JMeter Plugins) lets you specify number of users to start with, ramp up period, time to hold the load, ramp down period, etc. It looks like to be the easiest option to proceed with.
Synchronizing Timer - to release all threads at the same time, i.e. 25 requests at the same moment.
Constant Throughput Timer - to set the desired load, i.e. 25 requests per second.