Rps is very low compare to given number of users - performance

I am new in load testing , For understanding the statistics generated by locust , I give very low load to an API, See my below snapshot, there is only 1 user run against given API and it finish its process within milliseconds but my RPS is showing 0 . I am expecting RPS value as 1 because the request able to finish within one second.
Test Result

See my code below and please note that I am not giving any wait_time in my code and it is a very simple code which I wrote.
Main code
config file

Related

How to keep certain thread delay between requests and store correlation id for all the request during load test

May i know how to achieve this scenario in JMeter.
Requirement 1 : Request 1 should execute for 15 mins, once 15 mins crossed request 2 should execute and request 1 to be stopped.
Requirement 2 : In request 1, we need to capture all dynamic value and store it some place and same dynamic value we should use it as request body for request 2. We like to run large numbers of users. Not sure, how to store all the response in some files or other alternatives.
Ex : Request 1 - > Trigger -> Store response somewhere(15 min run & 100 iteration) - stopped
Request 2 - > Trigger after 15 min - Execute request with above 100 iteration response)
Either take a look at Runtime Controller, using this guy you can choose how long its child(ren) will be run or just put your requests 1 and 2 into separate Thread Groups
If you want to store full responses into a file take a look at:
Post-Processors to capture the required part of the response into a JMeter Variable
Sample Variables property to tell JMeter to save this variable into .jtl results file
Flexible File Writer if you want to write the values into a separate file

Jmeter request and report validation

My Requirement is to execute 10 request per second for 5 minutes. The configuration I have used is
Thread Group Properties:
number of threads : 600
ramp up period : 60
Loop count : 5,
Add Sampler -> Flow Control Action
Select Logical Action on thread as Pause
Duration(milliseconds) :60000
I used the below command to run jmx from command line to generate xls and generate html report.
/jmeter.sh -n -t demo.jmx -l demo.xls -e -o ./report
Need to know if the configuration I have mapped is correct or not?
I have also looked at constant throughput timer and Runtime controller to stop the execution after 5 mins?
I am not able to validate the end result?
You can see what actual throughput your test generated using Transactions Per Second listener or the relevant chart in the HTML Reporting Dashboard
With regards to configuring JMeter for sending 10 requests per second for 5 minutes I would rather recommend going for Concurrency Thread Group and Throughput Shaping Timer combination.
Configurations:

JMeter test works differently from CLI than GUI - why?

I'm creating a small test using JMeter. So far I have one Thread Group that executes an HTTP request, waits for 10 seconds, then executes an other HTTP Request and checks what was returned. If I start 100 such threads with 1 second ramp-up period from the JMeter GUI, it works fine, I get the expected values and the whole test finishes in 22 seconds. However, when I start the very same jmx file from the command line, the test runs for more than 120 seconds and some threads (at the last run, 36 out of the 100) don't get the expected value. This might indicate a bug in the system I test, but I don't understand why the test takes that long time from the CLI and why I get errors from the CLI. What is the difference between running the test from the GUI and from the CLI? Does the CLI run the tests "more parallel"? By the way, this is the command line I'm using:
/home/nar/apache-jmeter-3.3/bin/jmeter -n -t test_transactions.jmx -l test_transactions.out
I'm afraid I cannot share the test plan, but I can share the "outline":
+ Thread Group
+ CSV Data Set Config
+ HTTP Request
| + JSON Extractor
+ Constant timer
+ HTTP Request
| + JSON Extractor
| + Response Assertion
+ View Results Tree
+ Save Responses to a file
+ View Results in Table
+ Summary Report
The Constant timer waits for 10 seconds. The first HTTP Request sends in some data and initiates a computation, the second checks the result.
I think you should disable the following listeners in non gui test:
View Results Tree
Save Responses to a file
View Results in Table
Summary Report
After disable you still have result using -l test_transactions.out which you can later view using GUI mode with Browse button in your Listener
In non GUI you can also generate dashboard report if you want by adding -e -o /path/dashboardfolder
It actually does indicate the bug in the system under test. The reason is that you must run JMeter in non-GUI mode as GUI creates huge overhead in terms of resources consumption, especially when you're using Listeners, especially if one of them is View Results Tree.
So my expectation is that in non-GUI mode you're basically creating more immense load which your application cannot handle. You can check this out using i.e. Active Threads Over Time and Transactions Per Second listeners.

How to save start time of all the individual samples in my jmeter test and use that in JSR223 Listener

Im using influxfb to save the result of my jmeter test.
bellow is the part of code in JSR223 Listener where im in need of your help.
result = new StringBuilder();
result.append("Thro_5,")
.append("label=")
.append(escapeValue(sampleResult.getSampleLabel()))
result.append("count=")
count=sampleResult.getSampleCount();
result.append(count)
result.append(",duration=")
dur1=sampleResult.getStartTime();
result.append(sampleResult.getEndTime()-sampleResult.getStartTime())
*****here code to write data to influxdb*****
I'm trying this code in which i want to know the total duration sample has taken till now to calculate throughput.
a=sampleResult.getEndTime()-sampleResult.getStartTime()
.append(",throughput_=")
.append(totalSamplecount/(a/1000))
Last line in the above code , i.e sampleResult.getStartTime() ,it should be the starting time of a sample in the first loop.
If i have 3 samples in my test ,having loop count 3 ,i want to save the starting time of each sample in the first iteration and use that value in the calculation of throughput of each samples.
Then while i'm in 3rd loop i want to know the total duration it has taken so far from the first iteration.And totalsamplecount/duration
As far as i know sampleResult holds the result of current sample.
I'm stuck in 2 points:
in saving the start time of each samples and use it later for each iteration to calculate the duration.
In saving the total count of individual samples executed till now.

Execute httpSample conditionally JMeter

I need to test a REST method for saving an object. In order to have the ability to save it I need to request an authToken that is updating each 100 seconds.
Right now I have a thread containing both requests , and the login request is executed each time the saving does. How can I make the login execute once at the start of the thread and then each 100 seconds ?
P.S. I've tried separating it in 3 threads , one for the initial login , the other with a loop and a 100 seconds timer and finally the one with the actual test. It does work ,but it seems like a bad solution.
How about:
|-Login
|-Loop n times
|-Save
n being number of times that will be just about less than 100ms?
or
|-If login valid?
| |-NO: Login
|
|-Save
option 3:
ThreadGoup1
|- Login
|- Beanshell update shared token
|- Constant throughput timer
ThreadGroup2
|- Beanshell fetch shared token
|- Save
A constant throughput timer allows you to run at a set throughput. Once every 100 seconds is 0.6 samples per minute, I'm not certain you can do fractions, but even 1 sample a minute should work for you.

Resources