How to set limit for particular no. of sample in jmeter - api

example ,i want JMeter to run for 100 samples only on 100 thread.

Each JMeter thread (virtual user) executes Samplers upside down for the defined number of iterations.
If you have 1 Sampler, 100 users and 1 iteration - you will have 100 executions
If you have 1 Sampler, 100 users and 2 iterations - you will have 200 executions
If you have 1 Sampler, 200 users and 2 iterations - you will have 400 executions
If you have 2 Samplers, 200 users and 2 iterations - you will have 800 executions
etc
The number of users and iterations can be set in the Thread Group.
If you want to execute a particular sampler only by the 1st user - go for If Controller and use __threadNum() function to determine the number of the current user
If you want to execute a particular sampler i.e. 5 times and others 100 times - go for Throughput Controller

Related

Batch is taking 7-15 minutes to processing 50k records

I am trying to fetch 50k records using SAP Query connector and send it to S3. but it is taking 7 minutes to process 50 k records in batch.It is taking time at the time at loading phase for instance. I have put S3 to aggregator. Still facing issue and also for next 50k records batch is taking 15 to 16 minutes and next records 30minutes. Can anyone help.
enter image description here

LinkedIn Shares API - Pagination not working properly

Shares API call has some issues regarding the records returned with pagination. I passed different numbers as count but it didn't return exact number of records in element attribute.
Eg:
API call with count 10 - returns 10 or less amount of records
API call with count 50 - returns 45 records
API call with count 100 - returns 70 records
API call with count 120 - returns Bad request(400) error
What is the reason for this issue? Is there a maximum limit for count parameter? Could you please assist on this issue?

how to send 10000 http request for every 20 seconds using JMETER

What should be the ramp up time when i need to send 10k request[each request has 6http subsequent calls], I need to send 1 request per minute. and i need to send one request for every 20seconds
Your post contains 4 questions which are mutually exclusive so I provide a generic answer:
If you want to send X requests at exactly the same moment:
Add X thread (virtual users) to Thread Group
Add Synchronizing Timer to the request and set Number of Simultaneous Users to Group by to X
If you want to send 1 request per minute - add Constant Throughput Timer to your request and set Target Throughput to 1
If you want to send 1 request each 20 seconds - the same approach as for point 2 but Target Throughput will be 3
Ramp-up is the time period for starting virtual users, normally normal people use it for gradual load increase, for example if you have 10 users and 10 seconds ramp-up JMeter will start 1 user each second, if you have 10 users and 20 seconds ramp-up JMeter will start each user each 2 seconds, etc.

Looping a rotation into Excel cells

I have a database of users (with a number assignment) and an Excel listing of items that I am successfully pulling into two arrays. One array of users, the other of items from Excel (tasks). I am trying to think of the logic to represent this scenario:
A user in the DB can exist with a number 0-5. Basically this represents how many days off they are in the week, and help break up how many items in the Excel range each person can get so as to proportion correctly items (before I was using a Boolean indicator to indicate to either include or exclude). For example:
User | Present #
-------------------
Jared | 0 'present daily
John | 0 'present daily
Mary | 1 'off 1 day
Tom | 5 'off rotation entirely
Question is: what is the best way to relate this to how many items they should be getting overall?
I would expect Jared and John to get the most, Mary a bit less, and Tom would never be included. Let's say I have 50 items.
One way I have thought is, while looping the names into Excel, count each time I start back at the top of the array as a "pass" (while assigning into Excel cells).
Anyone with a 0 is never skipped through each pass
Anyone with a 1 is skipped every 4th pass
Anyone with a 2 is skipped every 3rd pass
Anyone with a 3 is skipped every 2nd pass
Anyone with a 4 is skipped every other pass
Anyone with a 5 is never included (easy)
For my example, Jared and John would always be used, Mary would be skipped every fourth pass, and Tom would never be used.
Does this make sense?
What is the best way to catch looping through an array every Nth time?
Am I going about this in the correct manner?
To avoid a lot of looping and the delays this might cause, I’d suggest calculating a ‘demand factor’.
There are 50 items (in the example) to be distributed according to availabilities. The availabilities are shown as 0 present daily to 5 off rotation entirely, but it is easier to work with these the other way around: ‘off rotation’ has no resources available so 0 and ‘presently daily’ has all weekdays (?) available, so 5.
The User | Present # table would then become:
Jared 5
John 5
Mary 4
Tom 0
14
So 14 person-days are available to cover 50 items, an average of 3.57 items per person-day. Presuming an item can’t be split that is 3 items per person-day and 8 over. The ‘3 each’ can be allocated in one pass by multiplying the (revised) table values by INT(item_total/table-total). So for Jared and John the result is 5x3 = 15 and for Mary 4x3 = 12.
That though only accounts for 42, so 8 have yet to be allocated. 3,3,2 ‘extras’ is obvious (resulting in 18,18,14) but programming that not so easy. I’d suggest where there is any residual from the INT formula then use its result +1 (ie here 4 rather than 3) accept preliminary results of 20,20,16,0 (6 too many) then loop through each user knocking 1 off (where possible) until 6 have been knocked off.
This doesn't entirely make sense since you appear to be assigning weekly tasks, one per day:
Anyone with a 0 is never skipped through each pass
Anyone with a 1 is skipped every 4th pass
Anyone with a 2 is skipped every 3rd pass
Anyone with a 3 is skipped every 2nd pass
Anyone with a 4 is skipped every other pass
Anyone with a 5 is never included (easy)
However, presuming the above, you skip users when their individual TaskAssignmentsAttempted Mod (6 - Present#) = 0.
Perhaps you need:
Anyone with a 0 is never skipped
Anyone with a 1 is skipped once every 5 passes
Anyone with a 2 is skipped twice every 5 passes
Anyone with a 3 is skipped 3 times every 5 passes
Anyone with a 4 is skipped 4 times every 5 passes
Anyone with a 5 is always skipped.
Presuming the above, you skip users when their individual 5 - Present# is less than their individual TaskAssignmentsAttempted Mod 5.
With either of these, you need to track the number of times that each user has an assignment attempt (successful or not), as well as the actual assignments.

Running multiple Thread Groups sequentially in JMeter

I have a Test plan in which there are multiple Thread Groups.
I want to run all of the Thread Groups sequentially.
Thread Groups are as below:
Thread Group1
Thread Group2
Thread Group3
. . .
Thread GroupN
I've read in different blogs and articles on the internet, people claiming that the thread groups will run in the order they are defined but apparently they are not in my case. Thread Group4 runs before Thread Group1. Thread Group4 is generating a report which is wrong because it runs before Thread Group1.
How do I ensure the ordering of my Thread Groups?
Also, I need to implement the following scenarios:
Run a single request multiple time by a single user (Single user should create 1000 accounts from a single HTTP request).
Run a multiple requests multiple times by multiple users simultaneously (Multiple users should create 1000 accounts simultaneously from a single HTTP request).
How to do so?
PS: Please read and understand the query carefully before replying.
Concerning consecutive execution of thread groups in test plan: simple check Run Test Group consecutively check-box on the Test Plan configuration screen:
Use e.g. Loop Controller for this:
Thread Group
Number of Threads = 1
Loop Count = 1
...
Loop Controller
Loop Count = N
HTTP Request
...
or even schema without Loop Controller but not so flexible:
Thread Group
Number of Threads = 1
Loop Count = N
...
HTTP Request
...
Use Number of Threads property of standard Thread Group for this together with Ramp-Up Period property:
Thread Group
Number of Threads = N
Ramp-Up Period = 0
Loop Count = 1
...
HTTP Request
...
This will start N simultaneous threads executing same scenario.
Check the Run Thread Groups consecutively (i.e. run groups one at a time) in the Test Plan.
Refer this link. This asks you to check the check box in the main Test Plan
Run Thread Groups consecutively (i.e. one at a time)
http://www.mahsumakbas.net/run-jmeter-thread-groups-consecutively/
Just add more thread groups in your test plan.
In test plan properties -> tick Run Test Group consecutively for step by step execution of thread groups.
Here is the simple solution which I found for Running multiple Thread Groups in particular order:
Check the option "Run Thread Groups consecutively" under "Test Plan"
Order your "Thread Group/s" in the order you want to be executed using drag and drop approach
Regarding Alies Belik answer, there is another way than running thread group consecutively
which is to use Setup Thread Group for the first part.
Regarding setting ramp-up period, it is better to set a value > 0,
which is more realistic one as depending on the number of threads
to start it could delay there startup, the more you have the more it takes time to start.