I am running a JMeter script for 50 users and for 5 minutes. And I have configured the InfluxDB and Backend listener as shown below:
But when I am checking for data in the influxDB in the table - test1, I am not getting records for the different samplers in the test plan.
All I am getting is records with transaction id as - 'all' and 'internal'
There is at least an issue, change in percentiles the separator from "," to ";"
This is fixed in nightly build if you'd like to test it:
https://jmeter.apache.org/nightly.html
Related
I have a requirement where I have to load 1 million Telephone numbers from database and once that data is retrieved, need to call one REST endpoint using multiple threads. So I will load the data once and once data is loaded, use same dataset to hit rest endpoints concurrently.
I am a newbee to Jmeter and I am not able to figure out how to create thread groups to achieve this.
I would recommend
Using setUp Thread Group to load the data from the database, there add:
JDBC Connection Configuration to specify your database URL, credentials, etc.
JDBC Request Sampler to execute the query and save the results into JMeter Variables
JSR223 Sampler to write the results into a CSV file
Check out How to Retrieve Database Data for API Testing with JMeter article for example implementation.
Using normal Thread Group to create the concurrent requests:
CSV Data Set Config - to load the numbers from the CSV file so each virtual user would use the new number on next iteration
HTTP Request sampler to call your API
How Do that in jmeter by using JDbc or JSr223sampler,after completion of execution generate jtl/CSV results file,to take the results file particular values like samplers,average response time,90 percentage values and convert milli seconds and push to DB,how do the process tell me as soon as possible
Which DB? There is Backend Listener which have a couple of implementations, one of them - InfluxDbBackendListenerClient allows storing all (or specified) metrics into InfluxDB
See How to Use Grafana to Monitor JMeter Non-GUI Results - Part 2 for comprehensive steps on installation and configuration of JMeter and InfluxDB for real-time results storing
We are executing SQL queries on Jmeter JDBC request and able to get proper response on executions. However, our project team would like to see row count of each execution in result reports along with elapsed time, latency etc.
How to get row count for a sql query executed in JDBC request in Jmeter? Also, how to get the row count value appended to columns in Summary report.csv file?
With regards to row count - you already have it. I.e. in the below setup I defined the result variable myVar
When my query is being executed JMeter stores the number of returned rows into myVar_# variable
Now if I want to display the variable within the .jtl results file I need to add the following line to user.properties file:
sample_variables=myVar_#
Next time I run my JMeter test in command-line non-gui mode like:
jmeter -n -t test.jmx -l result.csv
I see the number of rows returned by the SQL query in the myVar_# column:
References:
Sample Variables
Debugging JDBC Sampler Results in JMeter
I have a use case where 10000 users are hitting the API sequentially.
first 1000 users/sec are hitting an API then they hold for 10-15 seconds and again another 2000 users are going to access the api.
Issue is i have an api <path>/user_id/${userId} and i have 10000 user ids stored in a .csv file
how fetch the file for every 1000 users at first set and 2000 users in the next?
I have added CSV Data set Config and i have the .csv file path
Below screenshot is my .csv set config.
Beanshell error
GetUserID API
Ashu
To pick first 1000 userIds for first 1000 threads and and next 2000 userids for next 2000 threads and so on follow this steps
Create a csv file with only userIds(Do not mention the column name in csv).
To the JMeter test plan add a simple thread group and bean shell sampler to the thread group.
Add the following code to the beanshell sampler
above code will add UserIds to JMeter properties.
now to pick userIds use
${__P(user_id_${__longSum(${__threadNum},-1,)})}
I have created a sample test plan to pick only first 10 values from csv for the first minute and pick next 10 for the next minute you can see the screenshot here
I would recommend run the tests in cloud.
Please follow this link to know more
I have a JDBC test suite that I run with JMeter, and I want to run that over many user accounts.
I'm doing that with a CSV dataset that includes all the accountIds I want to test, then I inject the accountId into my SQL queries to run the queries over all of the accounts I want to test (with ${ACCOUNTID}).
It's working great, the queries are actually done over all the accounts I want to test.
However, I would like to know the response time per account. Currently I'm not getting the accountId back in the result, so I can't filter my results by account. Is there a way to get that variable value to the JTL?
You can either run JMeter as follows:
jmeter -Jsample_variables=ACCOUNTID -n -t test.jmx -l result.jtl
Or add the next line to user.properties file to make the change permanent
sample_variables=ACCOUNTID
In both cases you will get an extra column in .jtl results file having ACCOUNTID variable value for each and every request.
More information:
Sample Variables
JMeter Properties Reference
Apache JMeter Properties Customization Guide
You can add variable name to Sampler name so it will aggregate requests per account id. Set Sampler as:
My Sampler ${ACCOUNTID}