Ultimate Guide to Load Testing and Performance Monitoring with JMeter, InfluxDB, and Grafana

Shrihari Haridas
6 min readAug 4, 2024

--

  1. Introduction (What we cover in this blog)

In this blog, we’ll explore the powerful combination of JMeter, InfluxDB, and Grafana for effective load testing and performance monitoring. We’ll start with an introduction to each tool: JMeter for generating load tests, InfluxDB for storing performance metrics, and Grafana for visualizing data in real-time. We’ll discuss why using these tools together creates a comprehensive solution for monitoring application performance, providing real-time insights, and enabling historical analysis.

The blog will guide you through the installation and configuration process for each tool, followed by detailed steps to integrate them seamlessly. You’ll learn how to set up JMeter to send data to InfluxDB, configure InfluxDB to store this data, and create Grafana dashboards to visualize the performance metrics.

Finally, we’ll cover running load tests with JMeter, monitoring performance in real-time with Grafana, and analyzing the results to identify and address performance bottlenecks. By the end of this guide, you’ll be equipped to implement this robust performance testing and monitoring setup to ensure your applications run smoothly and efficiently.

2. What is Jmeter

Apache JMeter is an Apache project that can be used as a load testing tool for analyzing and measuring the performance of a variety of services, with a focus on web applications.

3. What is InfluxDB

InfluxDB is an open-source time series database developed by the company InfluxData. It is written in the Go programming language for storage and retrieval of time series data in fields such as operations monitoring, application metrics, Internet of Things sensor data, and real-time analytics

4. What is Grafana

Grafana is a multi-platform open source analytics and interactive visualization web application. It provides charts, graphs, and alerts for the web when connected to supported data sources

5. Also, please note that these installations are being done on a Windows machine only.

6. How to intsall InfluxDB on windows

A. Download Zip file on InfluxDB from below link

https://dl.influxdata.com/influxdb/releases/influxdb2-2.6.1-windows-amd64.zip

B. Extract Zip file in C:\Program Files

C. Open InfluxDB Folder i.e. influxdb2_windows_amd64

D. Then you can open windows command prompt and go to that location and type influxd.exe

E. Hence your InfluxDB is start you can check localhost:8086

F. Configure Initial setup of InfluxDB

G. Then go to Bucket here you can see your bucket when you setup influxdb

H. Then go to API Token and create Full Access Token (Admin Token)

I. Save this token

etdDIVHNPLQSWE1TsWwXawfFftVnoVBiJEcpFVtBxxVtLNiA1sR9ldnDSyQiUriJIBp0oCXyMIRwIY3rsMmOpA==

J. Then again click on Create Custom Token

K. and click on bucket and give permission on your bucket “Read & Write”

L. Save this token again

ADSQNCLXpw7KEfpor8gMECaPysGbWKXAq78BKzp7ZwygQdt32OnkNfqBdwmWICfS11NgzJx-7eCKoqVQw_CAw==

M. Last go to about section because we need that details while creating database

7. How to Install InfluxDB-Client

https://dl.influxdata.com/influxdb/releases/influxdb2-client-2.6.1-windows-amd64.zip

A. Extract on C:\program Files

B. Open Window CMD and go to InfluxDB-Client

Basically for accessing database in InfluxDB we use client

C. Type below command for see your bucket in InfluxDB

influx v1 dbrp list --org Test --token etdDIVHNPLQSWE1TsWwXawfFftVnoVBiJEcpFVtBxxVtLNiA1sR9ldnDSyQiUriJIBp0oCXyMIRwIY3rsMmOpA==

— org is your name of organization name, — token → admin token

D. After that create a one database

influx.exe v1 dbrp create --org-id d79c514fab0b4f47 --bucket-id 4d3ac4f6a961a161 --db Demo-db --rp Demo-rp --token etdDIVHNPLQSWE1TsWwXawfFftVnoVBiJEcpFVtBxxVtLNiA1sR9ldnDSyQiUriJIBp0oCXyMIRwIY3rsMmOpA== 

— org-id → your organization ID, — bucket-id → want to create a database from bucket, — db→ name of database, — rp→ retention policy, — token→admin token

E. then we need to create database user for that first check is any user exist or not

influx.exe v1 auth list --token etdDIVHNPLQSWE1TsWwXawfFftVnoVBiJEcpFVtBxxVtLNiA1sR9ldnDSyQiUriJIBp0oCXyMIRwIY3rsMmOpA==

F. If no user exit follow the next command

influx.exe v1 auth create --read-bucket 4d3ac4f6a961a161 --write-bucket 4d3ac4f6a961a161 --username demon --password demo1234@ --token etdDIVHNPLQSWE1TsWwXawfFftVnoVBiJEcpFVtBxxVtLNiA1sR9ldnDSyQiUriJIBp0oCXyMIRwIY3rsMmOpA== --org-id d79c514fab0b4f47

— read-bucket & — write-bucket→ Newly created bucket id or database i.e. step 5, — user-name→ give user name according to you, — password→ your choice, — token → admin token, — org-id → your organization id

8. How to install Grafana on windows

https://dl.grafana.com/enterprise/release/grafana-enterprise-9.3.6.windows-amd64.zip

A. Unzip Grafana folder in any location

B. Go to Grafana location and then go to \conf folder

C. then copy the content of sample.ini and create a new file name as custom.ini and paste the content on it and just save

D. then go one folder back and go to \bin folder

E. and click on grafana-server.exe file hence your grafana get started

F. hit localhost:3000

G. default login id and password is “admin & admin”

H. Go to Setting ⇒ data source ⇒ add data source ⇒ InfluxDB

I. Then add header, header Name ⇒ Token & Value is ⇒ Custom API Token which we generated

J. Configured following setting as per image

K. Then go to Dashboard option ⇒ Import Dashboard

L. Then type “1152” and click load you will see following output

M. Then you will see dashboard

9. How to Install JMeter on Windows.

A. Download Zip file of JMeter from ⇒

https://dlcdn.apache.org//jmeter/binaries/apache-jmeter-5.6.3.zip

B. Extract the JMeter.Zip file into C:\Program Files

C. Then Go to C:\Program Files\apache-jmeter\bin\

D. and click JMeter (windows batch file) your JMeter is open

E. Give name to Test Plan ⇒ Right click on Demo ⇒ Add ⇒ Thread (Users) ⇒ Thread Group ⇒ Give name to thread group and follow the settings

F. Then Right Click on Thread Group ⇒ Add ⇒ Sampler ⇒ Http request ⇒ give name

G. Here I will use apache or any opensource website along with port number and sub-pages

H. Then again click on Grafana Demo ⇒ Add ⇒ Listener ⇒ Backend Listener

I. Select Backend Listener implementation ⇒ JMeter BackendListener Client option and enter following details

J. Again click on Grafana Demo ⇒ Listener ⇒ View Result Tree

K. Finally Run the test and you can see the result on grafana dashboard

--

--

Shrihari Haridas
Shrihari Haridas

Written by Shrihari Haridas

Hello everyone, I am Shrihari Haridas I am a Cloud & DevOps Engineer, I work with most of DevOps Tools like, Jenkins, Git, Docker, etc.!& for Cloud AWS

Responses (1)