JMeter Integartion with Influx DB and Grafana

 

JMeter Integration with Grafana + Influx DB for Real Time-                                   Monitoring System

Tools required for the set-up

·         Database:  Prometheus or Influx DB.

·         Graphing Tool: Open Source Grafana

·         Testing Tool: Opensource Apache JMeter

Pre requisites

·         Apache JMeter should be installed 

·         JAVA latest version should be configured in the system

·         Windows OS machine

 

                                 Install Influx DB

Step 1: Download Influx DB from below link

https://dl.influxdata.com/influxdb/releases/influxdb-1.8.0_windows_amd64.zip

Step 2: Once the installation is done, open the Zip file and Navigate to influxdb.config file shown in below fig:1.0


                                                          Fig:1.0

      Step 3: Change Config in Influxdb.config as shown in below fig 1.2

                    and  save it


 

                                                Fig:1.2

  Step 4:

·        Launch the Command Prompt (Windows+R; Type cmd)

·        cd C:\Users\Downloads\influxdb-1.7.9_windows_amd64\influxdb-1.7.9–1

·        Type the below command to initiate the DB server and click ‘Enter’
        influxd.exe -config influxdb.conf

                                        Or

      Open influx application as shown in fig1.0

The InfluxDB application shown as below fig 1.3


Fig:1.3

 

Step 5:

·        Open the influx.exe file in fig 1.0 To create DataBase.

·         Run the "SHOW DATABASES" command – this will give you a list of databases.

·         Run the command: "CREATE DATABASE JMeter_Demo" - here "JMeter-Demo" is the database name

·         Run SHOW DATABASES again and you should see your new database listed

·         As shown in fig 1.4


                                                                    Fig 1.4

We all set the InfluxDB.

 

2.JMETER SETUP:

  1. .      .Install JMeter
  2. .       Create a Test Plan
  3. .       Add Thread Group

4.      Here I will be one my existing JMeter Test, we will see how to Configure the Backend Listener to write metrix into influxDB

  1. Add a new backend listener to the thread group. Right Click on a Thread Group -> Add -> Listener -> Backend Listener
  2. Select influxdb.Backend.Listener in Implementation then we get the configurations as shown in below fig 2.0

6.    


                                                            Fig 2.0

     7: Set up config in Backend Listener to integrate with Influx DataBase

Here we set up the Listener in Jmeter

Now, Go for Grafana..

3.GRAFANA INSTALLATION

 

Step 1: click on below link

https://grafana.com/docs/grafana/latest/setup-grafana/installation/windows/

·         select 7.3.7 version and win as shown in fig 3.0

·         and download it


 

                                                        Fig 3.0

 

Step 2: Configure Grafana

·        The Grafana backend has a number of configuration options defined in its config file (usually located at /etc/grafana/grafana.ini on Linux systems).

Step 3: start Grafana Application file, Double click on Grafana-server as shown in         below Fig 3.1


                                                 Fig 3.1

                                       OR

Start Server:

Open cmd from /bin path

Give command “start Grafana-server.exe, as shown fig3.2



                                                            Fig 3.2


Step 4: Open Grafana UI in Browser

1.    As soon as the server initiates, you can launch Grafana in your choice of Browser. The tool listens to the port 3000>> http://localhost:3000/ (Fig 3.3)


                                                               Fig 3.3

Use Credentials: Username: admin /Password: admin

 

Step 5: Add Data Source

1.Go to configurations.

2.Click on Add data source

3.select or search for influx DB as shown in fig 3.4


                                                        Fig 3.5

4. It opens settings

  • ·        Check Name
  • ·        Check URL as per given in fig 1.5 if not paste the url from Jmeter to here.
  • ·        Provide Data Base Name “JMeter_Demo”  in Influx DB Details
  • ·        Select HTTP Methods-> GET
  • ·        After providing details, click on Save and text
  • ·        Select backend time interval 5S

·        AS per shown in below fig 3.6.1 and 3.6.2

·        It should pop up a tiny Connection successful.


                                   

                                                       Fi g 3.6.1 


                                                             Fig 3.6.2

Step 6: create First Grafana Dash Board

1.     Go to create (+)

2.     Click on import

3.     Type Dashboard ID 5496

 Note: We are going to choose Apache JMeter Dashboard using Core InfluxdbBackendListenerClient by Philippe M. copy the dashboard ID: 5496.

4.     Click on load

 Ref the fig 3.7


                                                              Fig 3.7

Step 7: it shows gig 3.8 after load the dashboard

·        Provide name as per you are wish

·        Select General Folder

·        Select the Data Base Name as shown in Fig 1.5(URL)

·        Click on Import( as per shown in Fig 3.8)



                                                              Fig 3.8

Step 8: Open the summary report after you Import the Dashboard



                                                                       Fig 3.9

v     Now we can run our JMeter test and result observed here as a real Time Monitoring system

Note:This is the report generated by me Using JMeter Integration with Grafana and Influx DB


 

 

                                                                      Thank you

Comments