Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Master Apache JMeter - From Load Testing to DevOps

You're reading from  Master Apache JMeter - From Load Testing to DevOps

Product type Book
Published in Aug 2019
Publisher
ISBN-13 9781839217647
Pages 468 pages
Edition 1st Edition
Languages
Authors (3):
Antonio Gomes Rodrigues Antonio Gomes Rodrigues
Profile icon Antonio Gomes Rodrigues
Bruno Demion (Milamber) Bruno Demion (Milamber)
Profile icon Bruno Demion (Milamber)
Philippe Mouawad Philippe Mouawad
Profile icon Philippe Mouawad
View More author details

Table of Contents (14) Chapters

About the Book 1. Quick Start with JMeter 2. JMeter Overview 3. Designing a Test Case 4. Important Concepts in JMeter 5. Preparing the Test Environment (Injectors and Tested Systems) 6. Being Productive with JMeter 7. Load Testing a Website 8. Load Testing Web Services 9. Load Testing a Database Server 10. Load Testing Message-Oriented Middleware (MOM) via JMS 11. Performing a Load Test 12. Visualizing and Analyzing the Load Testing Results 13. Integration of JMeter in the DevOps Tool Chain

Setup Our Load Test and Launch It

  1. To set up our load test, select the Thread Group element in order to change the following values:

    Number of Threads (users): 10

    Ramp-Up Period (in seconds): 10

    Loop Count: 100

    This gives 10 virtual users (VU) who arrive in 10 seconds (1 per second), and each one will make 100 executions of the query sequence.

    Figure 1.27: Load test parameters
    Figure 1.27: Load test parameters

    Caution

    Several strategies for setting the load test exists. This point will be discussed deeply in Chapter 2, JMeter Overview.

  2. We could run our load test directly from the JMeter GUI, but this is not recommended as it would not be optimal for performances of injection (although, in our case, with only 10 users, it shouldn't be a problem).
  3. When load testing, it is advisable to monitor the injectors (servers where JMeter runs) at least during the first test at full load to validate the correct behavior of the injectors.

    This ensures that if we get bad response times, the cause is the application being tested and not JMeter.

    Note that this is not specific to JMeter but should be done regardless of the tool you use.

    Note

    An easy and quick solution to monitor JMeter can be to use the Servers Performance Monitoring plugin from the JMeter Plugins (https://jmeter-plugins.org/wiki/PerfMon/).

  4. So, let's use best practices directly and run our test from the command line in CLI mode (also called Non-GUI mode in JMeter).
  5. But before that, to follow our test in real time, we will add the Backend Listener element to enable live monitoring of the progress of the test with Grafana (https://grafana.com/).
  6. To do this, right-click on Test Plan -> Add -> Listener -> Backend Listener:
    Figure 1.28: Add Backend Listener
    Figure 1.28: Add Backend Listener
  7. Let's configure it to send the test results to our InfluxDB database (https://www.influxdata.com/):
Figure 1.29: Backend Listener configuration
Figure 1.29: Backend Listener configuration

Note

In the samplersRegex field, we can use a regular expression to keep only the queries that were recorded by the HTTP(S) Test Script Recorder element (thanks to Prefix: field).

You have been reading a chapter from
Master Apache JMeter - From Load Testing to DevOps
Published in: Aug 2019 Publisher: ISBN-13: 9781839217647
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}