Install and Configure JMeter
Abdelrahman Anwar
Senior DevOps Engineer at e& UAE | Cloud Solutions Architect with Kubernetes expertise
I'm not a test engineer but sometimes you got a task to do a load and performance test on servers that you are created.
Anyway let's first know what is the JMeter
The?Apache JMeter??application is open source software, a 100% pure Java application designed to load test functional behavior and measure performance. It was originally designed for testing Web Applications but has since expanded to other test functions.
Advantages of JMeter
Disadvantages of JMeter
In this article we will learn how to install JMeter on windows, Linux and Kubernetes
we also will learn how to create script, test the script and monitor the results using Grafana
Open the following link to download binaries of JMeter
just unzip the file and also you need to install Java JDK because it's required to run JMeter
2. Configure JMeter Distribute on windows/Linux
you will prepare multi VMs and install JMeter on these machines then you will edit on the file jmeter.properties under bin folder and add all the slave servers at the line remote_hosts on Master VM only
you need to change the line server.rmi.ssl.disable from false to true in all slave machines
after finish the configuration you need to open jmeter-server on all slave machines
on the master server open jmeter.bat
you need to open Thread Group to start load testing
you need to create listeners to views the results of threads
Let’s discuss the objects of Aggregate listeners
How to Generate the script
there are two ways you can create a script automatically
let's create a JMeter Script Record
After you create Test Recorder you find the following page?
You will see in the global settings the JMeter listen on port 8888 and you can change the port as you like.
In the test plan creation at target controller, you can choose the target you want JMeter add the recording for now you can choose test plan.
In the request filtering at URL Pattern to Exclude you can add suggested excludes to avoid record not needed record.
So, you need to do two things so JMeter can recording?
All you need to open Firefox for example then open setting and network settings then add the configuration.
After that you need to install JMeter certification on the Firefox?
After you run the JMeter recording you will find that you can’t access to any websites
View the certificate and download Pem file?
Then import the certificate to the browser the you will find the browser is working
Please make sure after you finish recording disable the proxy setting so you can use your browser.
You can use it as extension in Google Chrome you can download the extension?at the following link
how i can test jmeter
there are two you can test your thread
领英推荐
How to monitor JMeter using Grafana
First you need to install InfluxDB and its writer plugin
You can install the InfluxDB through the following link
You can install the InfluxDB-Writer through the following link and add the jar file in JmeterPATH/lib/ext
You can install the InfluxDB CLI though the following link
After install InfluxDB run the Influx.exe through powershell and browse it by localhost:8086
After adding the configuration you need to create a token access?
After generating save the token in the text file
Then create a database mapping this step should be used by Influx CLI
List the Database Influx v1 dbrp list –org For_Demo –token ------
Create mapping influx.exe v1 create –org-id -------?--bucket-id -------?--db -----?-rp ----- --token --------
Create User and Password for DB Access influx.exe v1 auth create –read-bucket ---- --write-bucket ---- --username --- --password --- --token -------
Open Grafana to integrate with InfluxDB through localhost:3000
Add datasource?
Now you need to import the dashboard?
Add the 1152 in the import via Grafana.com?
Then add the name of dashboard and choose the database
Start you load testing but before you need to add backend listener to the thread group and add influxdb configuration
Install JMeter and InfluxDB in Kubernetes
Follow the steps as below :
cd jmeter-kubernetes/
chmod +x jmeter_cluster_create.sh dashboard.sh start_test.sh
./jmeter_cluster_create.sh
Before complete the installation change image of INfluxDB from influx:latest to influx:1.16.0-alpine
./dashboard.sh
./start_test.sh
Then enter you jmx file
Note it’s better to the script using blazemeter
you need to open Grafana portal through IP-ADDRESS:NODEPORT
and import the json file GrafanaJMeterTemplate.json you will find it in the directory that you are cloned .
I HOPE THIS ARTICLE HELP YOU IN YOUR CAREER ??
THANKS FOR READING
Cloud DevOps TL | People Lead | Deloitte Innovation Hub | Ex PwC | PMI-ACP | 3X Azure Expert
2 年Great