Reputation: 231
Is there any way I can add the summary report results which are generated at the end of the test in JMETER to the database ? I have created a table in in database. In this table I want to store the summary results. I am using Mysql database. How can I do this ?
Thankyou.
Upvotes: 2
Views: 6912
Reputation: 168002
You can do it as follows:
c:\jmeter\results.csv
Add JDBC Connection Configuration and provide:
results
jdbc:mysql://localhost:3306/YOUR_DATABASE_NAME_HERE
com.mysql.jdbc.Driver
Add JDBC Sampler and configure it as follows:
results
Update Statement
load data local infile 'c:\jmeter\results.csv' into table YOUR_TABLE_NAME_HERE fields terminated by ',' enclosed by '"' lines terminated by '\n';
This way you will be able to get results inserted automatically.
References:
Just in case if you don't know how to create a table for results with query like:
create table test (timeStamp varchar(255),elapsed varchar(255),label varchar(255),responseCode varchar(255),responseMessage varchar(255),threadName varchar(255),dataType varchar(255),success varchar(255),bytes varchar(255),grpThreads varchar(255),allThreads varchar(255),Latency varchar(255) );
See MySQL CREATE TABLE Syntax documentation for more information.
Upvotes: 8
Reputation: 15370
JMeter is open source. You can even create your own listener to store the results in the DB as and when a sampler is finished. Check this to get an idea.
If you want the results while running the test, I think BeanShell Listener
can help you here. basically you place the beanshell code to log the results in the DB.
If you want the results to be uploaded after the test, Summary Report
listener can be configured to log the results in a CSV file. After the test - you can either upload manually to the MySQL DB, create custom script to upload programmatically.
Upvotes: 1