I am new to JMeter. I am working with it the last month. The problem that i am facing is with the graph that shows the active threats over time. What i want to achieve is a linear graph that will show that every 2 seconds a new threat is entering the application and do whatever it needs to do. My set up is as follow:
I can not add loop count to infinite as each user is executing different tasks that can be executed only once. It can not reuse the data and hit the services/tasks again with the use of the same user.
The process is:
Login
Get Requests
Post requests
If i execute my scenario i am getting the following graph:
What i need to do in order to get something like the below:
You're dealing with the Listener which means that it will plot the first data point only when first sampler reports its metrics.
If your first request takes 10 seconds you will see the first dot in the Active Threads Over Time chart at 10 seconds when 3 users are online already.
So if you want to see "smooth" arrival of virtual users you need to add a "synthetic" sampler with a couple of milliseconds response time before your other samplers (for example a Dummy Sampler will be a perfect match), this way listeners will take it as the starting point
Demo:
Related
I have a long-running job that normally takes an entire day to accomplish. There are some logs at the start and finish of the process.
When I use the AWS SDK 'GetLogEvents' to retrieve the log stream with the next forward token, I made hundreds of calls with no event data before reaching the finish.
https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_GetLogEvents.html
The log events limit per request is 100 items
I consider putting the API call in a loop with an event data exists condition. However, it may result in rate limiting for the CloudWatch API (25 requests/s). So I want to find a better approach
I am conducting a stress testing for a web application but I am quite confused how should I design the test cycle. So I have a test script with few controllers for example homepage, login, product catalogue and a uniform random timer. But How long and how many time should I run the the stress test to make a proper decision. Also for example I am using ultimate thread group for testing and how many user should add each time and how long the ramp up, hold time and shutting time can be for a proper result? Thanks in advance!
Stress test is about finding the boundaries of your application, the simplified approach is:
Design your test to simulate real user(s) activities with 100% accuracy, JMeter should produce the same requests as the real browser, you can cross check the requests sent by JMeter with "Network" tab of your browser developer tools
Start with 1 virtual user
Gradually increase the load
Look into correlation of increasing load (i.e. Active Threads Over Time listener or equivalent) with the other performance metrics, the main ones are response time (i.e. Response Times Over Time or equivalent) and number of hits per second (i.e. Transactions Per Second or equivalent)
On well behaved system when you increase the number of users the number of hits per second should increase proportionally, response time should remain the same, no errors should occur.
However if your system under test has limited hardware/scaling capabilities at certain point of time you will face the situation when the number of virtual users will be growing and the number of hits per second will remain the same or go down or errors will start occurring. This means that you found the bottleneck
I'm testing a web app using jmeter for load test and I getting a hard time on how can I set properly how many threads, ramp-up and loops will I use in order to get a large number of rps. Anyway, I want to check if my server can keep up to 500rps. Does anyone here can help me how can I set it properly. Thanks.
The number of requests per unit of time is called Throughput and mainly depends on two factors:
Number of active threads
Your application response time
The first one is obvious - more threads -> more requests per second. However JMeter will wait for response from the previous thread before starting the next request so application response time matters as well.
So the recommendations are:
Set number of threads in the Thread Group to the number of anticipated users of your system.
Set ramp-up period accordingly to the number of threads so the load will increase (and decrease) gradually, this way you will be able to correlate increasing/decreasing load with the changing response time and throughput
Instead of loops it might be a better idea to set desired test duration using Scheduler section of the Thread Group.
Run your test and observe the actual throughput using i.e. Server Hits Per Second listener or Transactions per second chart of the HTML Reporting Dashboard. If it matches your expectations - you are done, if not - you will need to increase the number of virtual users.
You can use ConcurrencyThreadGroup plugin , Specifically see how to Produce Desired RPS:
Threads pool size can be calculated like RPS * <max response time> / 1000. The more rate desired the more threads you will need. The more response time service have the more threads you will need.
For example, if your service response time may be 2.5sec and target
rps is 1230, you have to have 1230 * 2500 / 1000 = 3075 threads.
After recording the login page script and playback.its giving warning and not allow to login in application..
I have to use wait command for waiting few second for doing all process ..
How can i use wait command for page load
Following approaches are possible:
1) using Test Action (Add >> Sampler >> Test Action).
Its advantage is the following: interval value can be passed as parameter that can be obtained either from file, either generated.
2) One can also look through fixed delay between the search samples whatever response time of the Sample
Actual difference between first approach and second one:
you don't vary pause time depending on response time while webpage proposes a variable pause time to make a request every 30s. With a test action note that if you use transaction controller you won't be able to exclude time taken from response time.
Also one should remember that timers are processed before each sampler in the scope in which they are found; if there are several timers in the same scope, all the timers will be processed before each sampler.
Pay attention to Execution order (section 4.9) of Timers in jMeter.
Throughput Constant Timer usage example.
I would like to know if there is a JMeter listener that displays the total time that a test has been running for.
Although this plugin shows elapsed time/total duration time along the x-axis, it gives this value in seconds but I would like the value in milliseconds.
Please tell me how can i get the total duration/elapsed time of testing in millisecond?
Thanks in advance.
The short answer to the question (which has been clarified based on comments) is no, AFAIK there is no listener that displays, to the screen, the total time that the test has been running for in milliseconds.
If you want this value, however, you would simply have to subtract the first timestamp from the last timestamp in the results file. This would give - more or less - the total number of milliseconds that the test ran for. I say more or less because the start and end points are subjective, some people might say the start point is the first request, others would say it is when JMeter is initiated - these can be different times.
If you really must have the value inside of the GUI then you could use the setup and teardown thread groups and a simple beanshell calculation to work out the time. Again, this is subject to interpretation as the setup TG will fire before the test has started. Not much before but a few milliseconds to be sure.
Note that starting from next version of Apache JMeter (> 2.7), there will be a new listener called Response Time Graph listener that will give you what you need.
This version is available now as nightly build:
http://jmeter.apache.org/nightly.html