jMeter is an Open Source testing software. It is 100% pure Java application for load and performance testing. jMeter is designed to cover categories of tests like load, functional, performance, regression, etc.
jMeter run produces output in various format like xml, csv etc. This utility has micro-services that would read .csv report and store it into Mongo db provided by user.The result stored in mongo db can be used to compare results between two different runs.
The mircro-services can be run inside docker container or you can also run the servies as standalone on your system.
There are two services:
- uploadcsv
- perfcompareui
upload csv service would display a html form which would take Product Release,Build,Perf Run Date,Application Type and Result CSV as input parameters and would store the the data to mongo db on click of submit button.
perfcompareui service would display a html form which would take Applicaton Type,Baseline Release and Current Release as input parameters and on click of submit button a html page would be displayed which would show comparsion result based on input parameters passed.
-
It is assumed that jmeter result is generated as an JTL format aggregatereport.
-
CSV file can be generated using below cmd.
JMeterPluginsCMD --generate-csv <file_name>.csv --input-jtl <input_jtl_file>.jtl --plugin-type AggregateReport
- python 3.6.0 or above version.
- docker (optional) Refer Install Docker documentation.
- docker-compose
- linux os (optional)
- mongo db
Checkout project code from git.
git clone https://github.com/swiftops/jmeter-performance-report-parser.git
You have to specify your database ip,port,db name and collection name in config.ini file which would be used to establish connection with mongo db.File is located at root directory. example.
[mongo_Params]
mongo_ip = 10.0.2.10
mongo_port = 27017
db_name = perf_db
db_collection = perf_coll
Once you are done with pre-requisite execute below command to start slack microservice.
With custom Mongo database. Create a schema named as perf_db and import the default collection i.e perf_db.json provided in this repository.Run the below command to restore the collection and start the service.
mongoimport --db perf_db --collection perf_coll --file per_db.json --jsonArray
docker build -t <image_name>
docker run --name jmeter_perf_compare -p 5003:5003 -d <image_name>
In order to run this script, need to run below script from command line under project root directory.
python services.py
In order to call above microservices. we just need to hit below URL from the browser
http://<yourip>:5002/uploadcsv
NOTE : Atleast two records should be present in db to generate result.
On successfull start of your micro-service a html page would be displayed as below :
Example:
- Product Release: 4.0.0 (your product release)
- Build: 20 (your release build number)
- Perf Run Date: 20/09/1994 (your jmeter result run date)
- Application Type : Jboss (your application server ,i.e jboss or wildfly)
- Result CSV: click on choose file button and browse to the path were jmeter xml file is present.(for demo purpose xml file is given in jmeter_csv_file_example directory which can be found at root of project.)
http://<yourip>:5002/perfcompareui
On successfull start of your micro-service a html page would be displayed as below :
Example:
- Applicaton Type : Jboss (your application server name)
- Baseline Release : 4.2.0_15 (select your jmeter performance baseline release from available dropdown)
- Current Release : 4.4.0_25 (elect your jmeter performance current release from available dropdown)
On clicking submit button a performance report in form of html page would be displayed which would display comparison result based on Baseline Release and Current Release present if present in db.
Run docker compose file using below cmd:
docker-compose up --build
1.Above command start a mongo db which would have perf_db and perf_coll collection with pre-imported jmeter xml files for your reference.
2.It would also start a docker container which would up the jMeter-Performance-Report-Parser microservices.
To autodeploy your docker container based service on server used below steps
You need to configure Gitlab Runner to execute Gitlab CI/CD Pipeline. See Gitlab Config As soon as you configure runner auto deployment will start as you commited the code in repository. refer .gitlab-ci.yml file.