Load testing with apache-JMeter
What is Load testing...?
Load testing is the process of putting demand on a software system or computing device and measuring its response.
Why..?
Load testing is performed to determine a system's behavior under both normal and anticipated peak load conditions.
Load test frameworks
To perform a load test on a system, there are some tools that we need to be a little familiar with.
The following tools have been used to build the load test framework.
- Github - To maintain the repository of the Load test project
- Jmeter - To craft load test script as required
- Taurus - To the convenience of maintaining the configurations of the load tests
- Jenkins - To run Load tests at a scheduled time/ on-demand
- Blazemeter - To record the request and export it as a .jmx file / To view test reports
Install Blazemeter
The requests of the process that need to be tested should be recorded. For that use the chrome extension for Blazemeter.
B. Install Jmeter
Install the JMeter binary. you can download it here
To launch Jmeter,
cd to the downloaded folder
Run ./bin/jmeter.sh
JMeter
Open your terminal and go to the bin folder of the apache-JMeter, where you have extracted the downloaded JMeter zip file (compressed file).
Use the following command in your terminal to open the GUI (Graphical User Interface) of Apache JMeter.
Disable the non-relevant requests for your load test, from the list of the requests given.
Add a listener to your test to check the response(s) for the request(s) that you are running.
Once you verify the requests are working properly, go to the “HTTP Header manager” and replace the Authorization token with the Basic token you generated via Postman and Save.
Run the request(s) once again and verify that they are working properly.
C. Install Taurus
Install taurus
For Mac:
brew install bzt
brew upgrade bzt
For Linux:
sudo apt-get install python3 default-jre-headless python3-tk python3-pip python3-dev libxml2-dev libxslt-dev zlib1g-dev net-tools
sudo python3 -m pip install bzt
To run .yml files,
bzt <file name>
To extract the id from the response,
Open the file in Jmeter
Go to the request whose response gives the id
Add Regular Expression Extractor in Post-processes
Fill in as required, according to the format of the response.
The load test can either be run using Jmeter or Taurus.
When run by Taurus it gives a BlazeMeter report when defined in the yml file (The jmx file downloaded by blazemeter is run using a yml file).
To run the file using Taurus,
bzt <file name>
After running the file using taurus it will give url
Postman
Copy any request to your instance from the browser (More tools > Developer tools > Network), as a cURL request and import it to Postman.
Change the authorization type of the request to “Basic Auth” and set the Username to the logged in user of the system and the Password with the API Token generated for the system
I got wonderful information from this blog. I enjoyed your blog... the way you presented is really awesome... Thanks for sharing with us...If someone wants to know about load testing services this is the right place for you.
ReplyDeleteThanks
ReplyDeleteAmazing article provided by the author. Know about what is okr here.
ReplyDelete