Wednesday, November 27, 2013

JMeter for Ubuntu

Apache JMeter is a 100% pure Java desktop application designed to load test functional behavior and measure performance. It was originally designed for testing Web Applications but has since expanded to other test functions.

To Install Jmeter on Ubuntu

sudo apt-get install jmeter

To launch Jmeter on Ubuntu
cd /usr/share/jmeter/bin
./jmeter

An excellent tutorial which provides a short introduction into using Apache JMeter for HTTP load testing: http://vimeo.com/3453772


Another article at:http://jmeterbasics.blogspot.com/

Basic Components of JMeter

Test plan: The Test Plan is where the overall settings for a test are specified. A test plan describes a series of steps JMeter will execute when run. A complete test plan will consist of one or more Thread Groups, listeners, timers, assertions, and configuration elements.
The test plan should be saved before running the script however it will ask to save the test plan while running the script.
Workbench: The Workbench is like a working area.
Elements in Workbench:
•HTTP Proxy Server
•HTTP Mirror Server
•Property Display
HTTP Proxy Server will listen to the requests being sent from the web browser to the server. It
automatically creates HTTP Request samplers for each request sent.
Thread Group: A Thread Group defines a pool of users that will execute a particular test case against application. In the Thread Group GUI, configuration related to the number of users simulated (num of threads), the ramp up time (how long it takes to start all the threads), the number of times to perform the test, and optionally, a start and stop time for the test can be controlled.
Sampler: A sampler is something that sends a request to a server. JMeter comes with different types of samplers. The sampler that will be used for testing web application
is HTTP Request. Samplers perform the actual work of JMeter. Each sampler (except Test Action) generates one or more sample results. The sample results have various attributes (success/fail, elapsed time, data size etc) and can be viewed in the various listeners.
Assertion: Assertions are used to perform additional checks on samplers, and are processed after every sampler in the same scope. To ensure that an Assertion is applied only to a particular sampler, add it as a child of the sampler. There are different types of assertions depending on type of expected response and type of check that need to perform.
Logic Controller: Logic Controllers determine the order in which Samplers are processed. It provides a mechanism for controlling the flow of the thread group. Adding a logic controller to a thread group is like adding if-then or dowhile logic to a program.
Listener:
A listener listens to the responses generated by samplers. Listeners can be used
to compile the results of the test run and to check that a sampler generates the expected
response. Most of the listeners perform several roles in addition to "listening" to the test results. They also provide means to view, save, and read saved test results.
Listeners can use a lot of memory if there are a lot of samples. Most of the listeners currently keep a copy of every sample in their scope.