This repository provides an end-to-end performance testing framework that utilizes a Kubernetes-managed environment integrating JMeter, Maven, Jenkins, InfluxDB, and Grafana. It supports distributed load testing, real-time data visualization, and automated test execution pipelines.
- Maven Project: Uses
jmeter-maven-pluginto run performance tests. - Jenkins: Automates test execution and generates HTML reports.
- InfluxDB: Stores test result data in real-time.
- Grafana: Visualizes performance metrics using InfluxDB as a data source.
- JMeter Server: Generates load and enables distributed testing.
- Kubernetes: Orchestrates services like Jenkins, InfluxDB, Grafana, and JMeter slaves.
Each component runs as a separate deployment in the Kubernetes cluster using YAML configuration files located at:
/environment/jmeter-kubernetes/jmeter-kubernetes
kubectl -n kubernauts get po # List all pods
kubectl -n kubernauts exec -ti <pod-name> -- /bin/bash # Access pod shell
kubectl -n kubernauts cp <local-file> <pod>:/path # Copy file to pod
kubectl -n kubernauts get pod -o wide # Get pod IPs
kubectl -n kubernauts expose deployment jenkins --type=LoadBalancer --name=jenkins
kubectl -n kubernauts rollout restart deploy # Restart all pods
kubectl -n kubernauts apply -f jmeter_slaves_deploy.yamlWe use the jmeter-maven-plugin to run our load tests. A new JMeter instance is created using:
mvn clean install<testFilesIncluded> <!-- Path to .jmx file -->
<propertiesUser> <!-- user.properties -->
<propertiesJMeter> <!-- jmeter.properties -->
<propertiesGlobal> <!-- global.properties -->
<jmeterExtensions> <!-- external plugins -->
<propertiesSystem> <!-- system properties -->
<remoteConfig> <!-- slave IPs -->users: Number of threadsrampUp: Time to ramp up usersloop: Loop countduration: Test durationpath: JMX file namecsv: CSV filenameurl: Application base URLremoteIP: IP addresses of slave serversfolder: Folder path for test files
mvn clean install -Dusers=120 -DrampUp=2 -Dloop=1 -Dduration=600 -Dcsv=Syllabus_Data \
-Dpath=Syllabus_Api_Suite.jmx -Durl=uat-qa.com \
-DremoteIP=192.168.29.51 -Dfolder=StudentGenerated reports:
- HTML:
target/jmeter/reports - CSV:
target/jmeter/results
Jenkins runs the Maven test job and generates HTML reports.
Important: Extract Jenkins pod IP from Kubernetes and set it to
java.rmi.server.hostnamein<propertiesSystem>withinpom.xml.
During job configuration:
- Set parameters corresponding to Maven runtime parameters.
- Use
Goals and optionsto triggermvn clean install.
The Jenkins job pulls the latest code and triggers the test. On success, HTML reports are emailed to recipients.
📁 Check job: Teacher-Syllabus-Performance-Suite for reference.
InfluxDB stores test result metrics in real-time. These results are sent using JMeter's Backend Listener.
📁 Check: Backend Listener in Integrated_Syllabus_Suite.jmx
Grafana connects to InfluxDB and displays metrics such as:
- Avg / Max / Min response times
- Percentiles (90/95/99)
- Success and failure counts
📁 Check dashboard: emk_test_load_latest
JMeter slaves are used for distributed load testing. Jenkins acts as the master node.
IPs of JMeter slave pods are passed via
remoteIPin the Maven command.
- Connect via FTP (FileZilla) to EC2.
- Create a folder
CSVon EC2 and upload all CSVs from:src/test/resources/ResourceData/ - SSH into EC2 and run:
kubectl -n kubernauts cp CSV/ jmeter-slaves-<pod-id>:/jmeter/apache-jmeter-5.4.1/bin/
If the CSVs aren't available at runtime, tests will fail.
- JMeter Distributed Testing Documentation
- Check
pom.xmlfor full Maven configuration details.
Happy Testing! 🚀