Performance Testing Using Apache JMeter

  1. Load testing
  2. Stress testing

Getting Started

JMeter Installation

  1. Oracle Java or OpenJDK (version 6 and above)
  2. Apache JMeter
yum localinstall jdk-8u152-linux-x64.rpm
sudo apt-get install oracle-java8-installer

Creating Your Test Plan

  1. Thread Groups
  2. Logic controllers
  3. Sample generating controllers
  4. Listeners
  5. Timers
  6. Assertions
  7. Configuration elements

Test Plan Elements

Configuration Elements

  1. HTTP requests default used for HTTP requests such as server name, IP, port number etc.
  2. HTTP cookie manager
  3. Variables defined by the user to store data such as usernames and passwords

Thread Groups

  1. Define the threads for tests
  2. Define the ramp-up time
  3. Define the number of test runs

Controllers

  1. Samplers
  2. Logical controllers

Listeners

  1. Graph results listener — access to response times
  2. View results in tree listener — displays in basic HTML and XML the sampler requests and responses
  3. Summary reports — maintains test reports for all requests in tables
  4. Real-time graph — is a line graph indicating the response time evolution for individual requests in a test

Timers

Postprocessors

Building Your First Test Plan

Step 1: Add a Thread Group

  1. Right-click on Test Plan
  2. Select Add
  3. Select Threads (Users)
  4. Select Thread Group
  1. Number of Threads (users): defines how many users JMeter will attempt to simulate. In this case, it was set to 50.
  2. Ramp-Up Period (in seconds): indicates the time through which JMeter distributes the start of the threads. In this case, it was set to 10.
  3. Loop Count: This defines the number of times tests are executed. This case study uses 1.

Step 2: Add an HTTP Request Defaults

  1. Select a Thread Group
  2. Right-click and select Add
  3. Select Config Element
  4. Select HTTP Request Defaults

Step 3: Enable HTTP Cookie Manager

  1. Select Thread Group
  2. Right click on the mouse and select Add
  3. Select Config Element
  4. Click HTTP Cookie Manager

Step 4: Include an HTTP Request Sampler

  1. Select Thread Group
  2. Mover over the option Add
  3. Move over the option Sampler
  4. Select HTTP Request

Step 5: Adding View Results in Table Listener

  1. Right-click the Thread Group
  2. Select Add
  3. Select Listener
  4. Select View Results in Table

Step 6: Run Your First Test Plan

What Your Results Mean

  1. Latency: indicates the time lapse between JMeter requests and initial server response
  2. Sample Time: time lapse in milliseconds for the full server request

Load Increase

Conclusion

--

--

--

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Java Heap Dump analysis case study

MongoDB

✨special ✨ repository that you can use to add a README.md to your GitHub profile.

How to make a Reddit ticker scraper

5 Skills Needed to Become a Technical PM

Key Points from Software Engineering At Google By Titus Winters, Tom Manshreck & Hyrum Wright

How to mount the Storage units automatically for Linux(Debian) servers

AWS Command Line Interface (CLI)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

More from Medium

Kafka Connect

Consume AVRO Messages from Kafka without schema

How to Connect Elastic Sink Connector with Kafka

Using Debezium Source Connector and JDBC Sink with Kafka Connect on AWS RDS PostgreSQL