Book Image

Apache JMeter

By : Emily H. Halili
Book Image

Apache JMeter

By: Emily H. Halili

Overview of this book

<p>A bad response time on a website can drive away visitors and prospective customers. To measure what a website can handle, there should be a way to simulate and analyze different load scenarios&acirc;&euro;&rdquo;this is where a load-testing tool like JMeter comes in. JMeter is a powerful desktop performance tool from the Apache Jakarta project, written in Java, for load-testing web pages, web applications, and other static and dynamic resources including databases, files, Servlets, Perl scripts, Java Objects, FTP Servers, and more.<br /><br />JMeter works by acting as the "client side" of an application, and measures response time. As such, it's one half of the testing arsenal; the other half consists of a tool to watch metrics on the server side, such as thread counts, CPU loads, resource usage, and memory usage. Although it can't behave like a browser to measure rich client-side logic such as JavaScripts or Applets, JMeter certainly measures the performance of the target server from the client's point of view. JMeter is able to capture test results that help you make informed decisions and benchmark your application.<br /><br />This book introduces you to JMeter (version 2.3) and test automation, providing a step-by-step guide to testing with JMeter. You will learn how to measure the performance of a website using JMeter.<br /><br />While it discusses test automation generally, the bulk of this book gives specific, vivid, and easy-to-understand walkthroughs of JMeter's testing tools showing what they can do, and when and how to use them.</p>
Table of Contents (16 chapters)

The Look-How-Easy-to-Use GUI


A typical test plan will consist of one or more Thread Groups, logic controllers, listeners, timers, assertions, and configuration elements:

  • Thread Group—each thread simulates a single user. All elements of a test plan must be under a thread group.

  • Listeners—Provide access to the information gathered by JMeter about the test cases while JMeter runs.

  • Controllers—Samplers tell JMeter to send requests to a server, while Logical Controllers let you customize its logic.

  • Timers—Allow JMeter to delay between each request that a thread makes.

  • Assertions—Allow you to "test" that your application is returning the results you expect it to.

  • Configuration Elements—Working closely with a Sampler, these can add to or modify requests.

The following screenshot lets you see the icons representing these elements:

The user interface has two panels. Once JMeter runs, you will see two elements, Test Plan and WorkBench, as you see in the figure below. A Test Plan describes a series of...