Performance testing – jmeter real-time pressure test results collection

Write the directory title here

  • foreword
  • 1. Composition of the pressure measurement and monitoring platform
  • 2. Performance monitoring platform deployment – InfluxDB
  • 3. Performance monitoring platform deployment – JMeter
  • 4. Deployment of performance monitoring platform – Grafana
  • 5. Deployment of performance monitoring platform – operation and result display


Test report .vs. Pressure monitoring
The “pain” caused by JMeter’s native test report

? Not real-time
? The data in the report is the average value of the test period
? Appearance issues

Advantages of the stress monitoring platform

? Real-time display of JMeter pressure measurement data
? The data range is optional
? The interface is more friendly

1. Composition of stress testing monitoring platform

? JMeter: pressure measurement tool, generate pressure measurement data
? InfluxDB: Open source time series database, especially suitable for processing and analyzing resource monitoring data
data, used to store pressure measurement data
? Grafana: a measurement analysis and visualization icon display tool that can support different types of
Data source, used to display the data stored in InfluxDB in the form of charts

2. Performance monitoring platform deployment – InfluxDB

Deployment method: Docker deployment
1. Prepare in advance:
? Install Docker
? Download the influxDB image: docker pull influxdb:1.8

2. Start the influxDB container
Name the new influxDB container jmeterdb, execute the docker create container command

docker run -d -p 8086:8086 -p 8083:8083 --name=jmeterdb

Execute the following command to enter the container

docker exec –it jmeterdb bash

3. Create a jmeter database inside the container to collect the pressure measurement data sent by JMeter

Execute the influx command to enter the command console

root@1b2e93bb7534:/# influx
Connected to http://localhost:8086 version 1.8.10
InfluxDB shell version: 1.8.10

4. Execute SQL statement to create jmeter database: create database jmeter;

> create database jmeter;
> show databases;
name: databases
> use jmeter;
Using database jmeter

5. After creating the jmeter database, execute the following command to verify that the database has been created successfully:
show databases;

> show databases;
name: databases

3. Performance monitoring platform deployment – JMeter

1. Add the Backend Listener component in JMeter
Backend Listener component, used to collect data and send it to influxdb

Select InfluxdbBackendListenerClient in Backend Listener implementation (Note
Note: you must use jmeter 5.0 or above, otherwise you need to install a plug-in separately to see this component)

? Fill in the actual influxdb hostname in influxdbURL
? Fill in baidu in application
? Fill in Baidu Testing in testTitle
? Fill in 50;90;95;99 in percentiles
? Set summaryOnly to false (to let influxdb collect more detailed information)
? The rest of the configuration remains unchanged

Configuration reference diagram

2. Run JMeter, and then check whether the data has been received in influxdb
Use the query statement in the influxdb command console to check whether the data has been received

> select * from jmeter;
name: jmeter
time application avg count countError endedT hit max maxAT meanAT min minAT pct50.0 pct90.0 pct95.0 pct99.0 rb responseCode responseMessage sb startedT statut transaction
---- ------------ --- ----- ---------- ------ --- --- ----- ------ --- ----- ------- ------- ------- ------- -- ----- ------ --------------- -- -------- ------ -----------
1684502522446000000 baidu 0 0 0 0 0 internal
1684502523664000000 baidu 42 5 0 5 94 25 30 94 94 94 12485 575 all all
1684502523667000000 baidu 42 5 94 25 30 94 94 94 12485 575 all Baidu Request
1684502523668000000 baidu 42 5 94 25 30 94 94 94 ok Baidu Request
1684502523669000000 baidu 5 3 2 1

4. Performance monitoring platform deployment – Grafana

1. Prepare in advance
Deployment method: Docker deployment
Download image: docker pull grafana/grafana
Start the image:

docker run -d -p 3000:3000 --name=jmeterGraf

2. Visit Grafana’s console link to verify that it is running properly
Default username/password: admin/admin, please skip changing password after login

3. Add a data source in Grafana
? Select Add data source
? Find InfluxDB
? Click to select the DB

4. Configure InfluxDB data source
Enter the URL: http://[hostname or IP]:8086
Database : jmeter
The rest of the parameters keep the default values

5. Click the Save & amp; Test button, and confirm that the return message prompts for correct confirmation information

6. Import JMeter Dashboard in Grafana
Enter the Home Dashboard page, select Import

Open the prepared URL:
Click the Load button to import

7. Select InfluxDB in the DB name
Click the Import button to complete the Dashboard import

8. Open the newly imported JMeter Dashboard to view the results

5. Performance monitoring platform deployment – operation and result display

In JMeter, adjust the number of threads to 10, 20, 30 respectively;
The measurement time is 20 seconds
Apply pressure test to the system separately, and then you can see the running in the Grafana panel