25,19 €
Learn how to get the most out of JMeter, improve the productivity of your apps, and integrate JMeter with your Agile and DevOps processes.
Key FeaturesGain insights into preparing test environments and selecting the correct use cases to load testLearn to analyze a load test with Backend Listener, HTML Report Dashboard, and View Results TreeExplore how to integrate JMeter in the software factoryBook Description
Load tests help identify the maximum number of requests a software system can handle. One popular open source tool for load testing is JMeter. By leveraging the features and capabilities of JMeter, you can perform extensive load testing and fix issues in your application before they become problematic.
This book is written by JMeter developers and begins by discussing the whole process, including recording a script, setting it up, and launching it, enabling you to almost immediately start load testing. You'll learn the best practices that you must follow while designing test cases. You'll also explore the different protocols offered by JMeter through various real-world examples. Finally, you'll see how to integrate JMeter into the DevOps approach and create professional reports. You'll discover ways to use the eco-system of JMeter to integrate new protocols, enrich its monitoring, and leverage its power through the use of the cloud.
By the end of this book, you'll know all that's needed to perform comprehensive load testing on your applications by using all the best practices and features of JMeter.
What you will learnExplore various JMeter concepts, including Timers scope and Assertions scopeDiscover the types of test protocols and load tests that JMeter supportsDesign a realistic test scenario using various tips and best practicesPrepare your test environment with injectors and the system under testLearn and apply good practices when recording a scriptIntegrate JMeter with Jenkins using MavenWho this book is for
This book contains all the valuable information you need in one place and is a must for everybody who is seriously working with JMeter. It might be a little condensed for absolute beginners, but this book is the best you can find if you already have some performance testing experience and want to get further. In particular, it would be invaluable to developers who want to expand their JMeter knowledge into advanced topics or switch to JMeter from other load testing tools.
Antonio Gomes Rodrigues has been an expert in the field of application performance for more than 10 years. Antonio has significant experience working with load testing tools like JMeter and LoadRunner. He is currently a committer and a PMC member of the JMeter project within the Apache Software Foundation. Bruno Demion, better known as Milamber, is a French computer scientist. Since December 2003, he has been working with JMeter to perform load tests in various missions and training courses. He contributes to the JMeter project, in particular on the translation into French of the graphical interface, corrections of anomalies as well as some behaviors (proxy HTTPS, new results tree, icon bar, and so on). He is currently a committer, PMC member and the PMC Chair of the Apache JMeter project within the Apache Software Foundation. Philippe Mouawad is a technical expert and architect in J2E and web environments in the company Ubik-Ingenierie. He has been using JMeter since 2009. He contributes to the JMeter-Plugins (Redis DataSet, Graphs Generator Listener, and various patches) project. He is currently a committer and a PMC member of the JMeter project within the Apache Software Foundation. He is also a lead developer of the Ubik Load Pack solution.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 238
Veröffentlichungsjahr: 2019
Master performance testing with JMeter
Antonio Gomes Rodrigues
Bruno Demion (Milamber)
Philippe Mouawad
Copyright © 2019 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Authors: Antonio Gomes Rodrigues, Bruno Demion (Milamber), and Philippe Mouawad
Managing Editor: Anush Kumar Mehalavarunan
Acquisitions Editor: Bridget Neale
Production Editor: Samita Warang
Editorial Board: David Barnes, Mayank Bhardwaj, Ewan Buckingham, Simon Cox, Mahesh Dhyani, Taabish Khan, Manasa Kumar, Alex Mazonowicz, Pramod Menon, Douglas Paterson, Dominic Pereira, Shiny Poojary, Erol Staveley, Ankita Thakur, and Jonathan Wray
First Published: August 2019
Production Reference: 3200919
ISBN: 978-1-83921-764-7
Published by Packt Publishing Ltd.
Livery Place, 35 Livery Street
Birmingham B3 2PB, UK
This section briefly introduces the authors and what the book covers.
An important event, directly related to this book, happened recently and probably went unnoticed. It appears that Apache JMeter has become the most popular load testing tool. In 2014, I was preparing a presentation about load testing tools and the criteria for their selection. One criterion was the existence of an ecosystem (documents, expertise, people, services, and so on). It may be not the defining factor, but it is an important factor to consider. To evaluate such ecosystems, in the absence of more sophisticated data, I used the number of web pages returned by Google and the number of jobs that Monster finds that mention each product.
LoadRunner (then an HP product) clearly held first place in both categories, with JMeter following not too far behind. Silk Performer (then owned by Borland) trailed far behind in third place. But now, in 2018, JMeter appears to be well ahead of LoadRunner (now owned by Micro Focus) in both the number of documents and the number of jobs mentioning it, apparently becoming the most popular load testing tool. Of course, it doesn't mean that JMeter became the best tool for every task, but its popularity, in addition to being an open-source tool, definitely earns it a high place in the list of options to consider. It is also very important for an open-source project to attract people who will work to improve it, thus ensuring the future development of the product.
Another interesting trend is that JMeter scripts have become a de facto standard, and many SaaS tools are built on top of JMeter or at least support JMeter scripts. These tools complement JMeter in many important ways and elevate its functionality and services to a new level, allowing it to compete with commercial products in more sophisticated environments.
Several books about JMeter have been published before, but this one is the first by JMeter contributors who know it inside out and are renowned experts in this area. JMeter is not a trivial product. It has a lot of functionality, but this can be implemented in many different ways and it is not always easy to figure out the best way to do it. While, as we have already mentioned, there is an enormous number of posts on the internet discussing different aspects of JMeter, the problem is that most of them are for beginners. And while there is more advanced stuff too, if you want to use it, you'd better know exactly what you're looking for as it may be hard to find it by searching just for generic terms. This is where this book will be invaluable in establishing a framework of knowledge and familiarity with the basic concepts, so you will at least understand what you should be looking for.
This book, with all the aforementioned valuable information in one place, is a must for anybody who is working seriously with JMeter. It may be a little too condensed for absolute beginners (although, as already mentioned, there are lots of introductory materials on the internet that can help here), but it is the best resource that you can find for JMeter if you already have some performance-testing experience and need to go further. In particular, it will be invaluable to people who want to expand their JMeter knowledge into advanced topics or switch to JMeter from other load testing tools.
In particular, JMeter has many integrations with other popular tools and a large number of plugins. It is quite possible that somebody has already solved the problem you are confronting, so you may save a lot of effort by simply reusing their solution. It is fortunate that this book is not limited to the core JMeter functionality and discusses available components and integrations when appropriate. While it is impossible to cover everything that is available in detail, the advantage of this book is that it puts everything into a system, allowing the reader to understand the relations between different parts and technologies.
Load testing is an important part of the performance-engineering process. However, the industry is changing and load testing needs to adjust to these changes. A stereotypical, last-minute performance check is not enough anymore. Performance testing should be interwoven into the development process, starting early and continuing throughout the whole life cycle of the product. The importance of this transformation is stressed in the title of the book itself, From Load Testing to DevOps, moving from standalone load testing as a mere step at the end of the software development cycle, to performance testing fully integrated into DevOps. And while we are not fully there yet, the Chapter 13, Integration of JMeter in the DevOps Tool Chain dives directly into what can be done right now.
DevOps, putting together the development and operations sides, is supposed to drastically improve feedback from production to development, and the free flow of performance information in both directions. So, a holistic approach to performance should be one of its main advantages. Unfortunately, it doesn't look like such a holistic approach happens often. Rather, it looks like DevOps teams just drop the more sophisticated parts of performance engineering (and performance testing usually gets into that category) and rely on a more reactive approach to performance issues, concentrating more on quick fixes for issues than on their prevention. Still, load testing is a very important method of risk mitigation and can't be fully replaced by other performance-engineering activities. Let's have a quick look at the benefits delivered by load testing.
First, there are always the risks of crashing a system or experiencing performance issues under heavy load, and the only way to mitigate them is to actually test the system. Even stellar performance in production and a highly scalable architecture don't guarantee that it won't crash under a slightly heavier load.
It is important to note that load testing doesn't completely guarantee that the system won't crash: this would be the case if, for example, the real-life workload was different from what was tested. So, you need to monitor the production system to verify that your test workload is close enough. That said, load tests do considerably reduce the risk if they are carried out correctly (and, of course, can be completely useless and misleading if they are not).
Another important benefit of load testing is in verifying how changes affect multi-user performance. The impact of changes on multi-user performance is generally not proportional to what is observed with single-user performance and can often be counterintuitive. Sometimes, improving single-user performance can lead to a degradation of multiuser performance. The more complex the system, the more exotic the multiuser performance problems that can occur are.
Another value of load testing is to provide a reliable and reproducible way to apply a multiuser load necessary for performance optimization and troubleshooting. You apply exactly the same workload and see if the change makes a difference. In most cases, you cannot do this in production when the workload changes, so you never know if the result is due to a change in the code or a change in the workload (except, perhaps, the rather rare case of very homogeneous and manageable workloads, where you can apply a very precisely measured portion of the actual workload). And, of course, a reproducible workload greatly simplifies the debugging and checking of multiuser problems.
In addition, given current trends in system self-regulation (such as auto-scaling or load-dependent service level changes), load tests are required to verify this functionality. You must apply a heavy load to see how auto-scaling will work. Load testing thus becomes a means of testing the functionality of the system, blurring the traditional division between functional and non-functional testing.
You will find further examples of different types of performance tests and their links to different aspects of DevOps in the book. Although the book does not focus on the theoretical aspects of performance testing, it provides sufficient theoretical information to understand the concepts discussed and their practical applications in JMeter. Practical examples of integrating performance testing with DevOps are all the more important as this is a rather new field of expertise and is probably the main challenge of performance testing at the moment.
This book leads the reader through the basics of working with today's most popular load testing tool, JMeter, through more advanced aspects of the tool, and performance testing in general, through to its complete integration into DevOps.
Alexander Podelko Bio
Over the last 20 years, Alex Podelko has supported major performance initiatives for Oracle, Hyperion, Aetna, and Intel in different roles, including as a performance tester, a performance analyst, a performance architect, and a performance engineer. Currently, he is a consulting member of technical staff at Oracle, responsible for the performance testing and tuning of Hyperion (that is, Enterprise Performance Management and Business Intelligence) products. Before specializing in performance, Alex led software development for Rodnik Software. Having more than 30 years of overall experience in the software industry, he holds a Ph.D. in computer science from Gubkin University and an MBA from Bellevue University.
Alex periodically talks and writes about performance-related topics, advocating tearing down silo walls between different groups of performance professionals. He currently serves as a board director for the Computer Measurement Group (CMG), a worldwide organization of performance and capacity management professionals.
Antonio Gomes Rodrigues
Antonio Gomes Rodrigues is an expert in the field of application performance for more than 10 years.
His missions led him to work:
On the performance of high traffic websitesOn the performance of an application for brokersOn the performance of rich clients, cloud applications, WEB applications, and so onWith various profilers: JProfiler, Yourkit, PerfView, and so onWith various APM: Dynatrace, AppDynamics, Introscope, NewRelic, and so onWith various load testing tools: JMeter, LoadRunner, and so onIn various missions: load tests, implementation of performance strategies, training, performance audits, troubleshooting, and so onHe shares his knowledge of application performance at conferences, on his blog (http://arodrigues.developpez.com/) and during technical book reviews.
He is currently a committer and a PMC member of the JMeter project (http://jmeter.apache.org/) within the Apache Software Foundation (http://www.apache.org/foundation/how-it-works.html#what).
Bruno Demion (Milamber)
Bruno Demion, better known in the JMeter community under the pseudonym Milamber is a French computer scientist living in Morocco since 2002, currently living in Temara (near Rabat).
He works in a technology consulting company, as a partner, architect and senior technical expert on web and cloud technologies.
Thanks to his work and passion, IT, Milamber has strong skills in the field of performance, troubleshooting, IT security as well as technical architectures for web and cloud solutions.
Since December 2003, he has been working with JMeter to perform load tests in various performance missions and also gives training on this topic. He contributes as much as possible to the JMeter project on his free time, especially on the French translation of the graphical interface, bug fixes and some changes (proxy https, new results tree, icon bar, and so on).
He is currently a committer and a PMC member of the JMeter project (http://jmeter.apache.org/) within the Apache Software Foundation (http://www.apache.org/foundation/how-it-works.html#what). He is also an official ASF member (http://www.apache.org/foundation/how-it-works.html#roles). His Apache ID is milamber (http://people.apache.org/~milamber/).
Milamber also has a personal blog (http://blog.milamberspace.net/) with many articles and tutorials about JMeter, some of which inspired this book.
Philippe Mouawad
Philippe Mouawad is a technical expert and architect in JEE and Web environments within the company Ubik-Ingenierie. He has been using JMeter since 2009 as part of performance improvements missions, load testing of intranet or e-commerce websites and training on JMeter.
He has been contributing to JMeter since 2009, first through patches and then as a committer and member of Project Management Committee at Apache. Among his main contributions are the CSS selector Extractor, the Boundary Extractor, the Backend Listener (allowing to interface among others Graphite, InfluxDB or ElasticSearch), part of the Web reporting feature and the optimization of the performances of the core and its stabilization and various ergonomic improvements, to his credit more than 400 bugs/improvements.
He also contributes to the JMeter-Plugins (https://jmeter-plugins.org/) project, among his contributions are Redis DataSet, Graphs Generator Listener and various patches to different plugins.
He also manages the JMeter Maven Plugin (https://github.com/jmeter-maven-plugin/jmeter-maven-plugin) project, he has been managing it since version 2.3.0 ensuring its compatibility with last JMeter releases and improving its dependencies management and reporting mechanism.
He is currently a committer and a PMC member of the JMeter project (https://jmeter.apache.org/) within the Apache Software Foundation (http://www.apache.org/foundation/how-it-works.html#what). His Apache ID is pmouawad (http://people.apache.org/~pmouawad/).
He is also a lead developer of the Ubik Load Pack (https://ubikloadpack.com) solution, a set of Enterprise Plugins which provides support for protocols that are not natively supported by JMeter. Finally, he contributes to the Ubik-Ingenierie blog (https://www.ubik-ingenierie.com/blog/).
Felix Schumacher
Felix is a committer to the JMeter project since October 2014 and a PMC member since February 2015. He is also a committer on Apache Tomcat. He has a diploma in mathematics but found working in IT more appealing. Since he became a developer for JMeter, he has been active in all fields, from bug fixing to designing multiple enhancements, tests, documentation, and quality improvements.
This book contains all the valuable information you need in one place and is a must for everybody who is seriously working with JMeter. It might be a little condensed for absolute beginners, but this book is the best you can find if you already have some performance testing experience and want to get further. In particular, it would be invaluable to developers who want to expand their JMeter knowledge into advanced topics or switch to JMeter from other load testing tools.
This book explains concepts through real-world examples. You will find examples of different types of performance tests and their links to different aspects of DevOps. You will also be provided with sufficient theoretical information to understand the concepts discussed and their practical applications in JMeter.
In no particular order.
Thanks to Vladimir Sitnikov for his feedback.
Thanks to Mark Tomlinson for his feedback.
No part of the contents of this book may be reproduced or transmitted in any form or by any means without the written permission of the authors.
Apache, Apache JMeter, JMeter, the Apache feather, and the Apache JMeter logo are registered trademarks of the Apache Software Foundation (ASF).
Dynatrace and PurePath are registered trademarks of Dynatrace.
UbikLoadPack is a registered trademark of Ubik-Ingénierie.
Tricentis Flood is a registered trademark of Tricentis.
OctoPerf is a registered trademark of OctoPerf.
BlazeMeter is a registered trademark of CA Technologies.
Byteman is a registered trademark of Red Hat.
JProfiler is a registered trademark of ej-technologies GmbH.
Firefox is a registered trademark of Mozilla.
Spring is a registered trademark of Pivotal Software. NetBeans is a registered trademark of Oracle Corporation.
Apache Netbeans is a registered trademark of the ASF.
Oracle and MySQL are registered trademarks of Oracle Corporation.
Apache ActiveMQ and Apache ActiveMQ Artemis are trademarks of the ASF.
Apache Ant and Apache Maven are registered trademarks of the ASF.
JMeter Plugins is a registered trademark of Andrey Pokhilko.
RedLine13 is a registered trademark of RedLine13.
With JMeter, you can quickly run your first load test. This chapter will show you how to set up a simple test case with JMeter and its HTTP(S) Test Script Recorder element.
Here are the steps to set up our test:
Launch JMeter and prepare the recording of our scriptConfigure the browser to use the HTTP(S) Test Script Recorder of JMeterRecord the scriptCustomize our script (add assertions, rename transactions, add think time…)Validate our script with a single userConfigure the load test (define the number of users, number of iterations, warm-up duration, and load test duration…)Run and analyze the load testWith this trick, we will share these two fields in every element HTTP Request Defaults and JMeter will not put them in each HTTP Request during recording.
During the load test, you should avoid having the injector (JMeter) on the same server as the application under test.
Otherwise, the injected load will be impacted by the application's bad performance, and the application could be impacted by the injector's bad performance.
Our tree is ready; we must now start the proxy server of JMeter.
But before doing that, let's look at the HTTP(S) Test Script Recorder element.
For the name of recorded transactions, we have two options in Recorder:Transaction name, which allows you to fully name them as you wish.
Prefix, which will just prepend the prefix to the default name given by JMeter, which is usually the URL path.
JMeter is now ready to record our navigation session.
