21
Introduction to JMeter Magus Chen [email protected] http://magustest.com/blog

Introduction to jmeter

Embed Size (px)

DESCRIPTION

Introduction to jmeter

Citation preview

Page 1: Introduction to jmeter

Introduction to JMeterMagus Chen

[email protected]://magustest.com/blog

Page 2: Introduction to jmeter

● Performance testing

● What is JMeter

● JMeter basic elements

● Jmeter Plugins

● Example

Agenda

Page 3: Introduction to jmeter

● Performance testing is in general testing performed to

determine how a system performs in terms of responsiveness

and stability under a particular workload.

Performance Testing

Page 4: Introduction to jmeter

● Load Testing○ Load testing is the simplest form of performance testing. A load test

is usually conducted to understand the behaviour of the system under

a specific expected load.

● Stress testing○ Stress testing is normally used to understand the upper limits of

capacity within the system. This kind of test is done to determine the

system's robustness in terms of extreme load

Performance Testing

Page 5: Introduction to jmeter

● Performance Goals○ Concurrency/throughput

■ Transactions per second the application under test can

handle

○ Server response time

■ Amount of time the application under test takes to

process a request after it has received.

Performance Testing

Page 6: Introduction to jmeter

● Apache JMeter is an Apache project that can be used as a load

testing tool for analyzing and measuring the performance of a

variety of services, with a focus on web applications.

What is JMeter

Page 7: Introduction to jmeter

● Test Plan

● Thread Group

● Sampler

● Assertion

● Listener

● Logic Controller

● Timer

● Config Element

● Pre-Processor / Post-Processor

JMeter basic elements

Page 8: Introduction to jmeter

JMeter basic elements

Page 9: Introduction to jmeter

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, logic conrollers,

sample generating controllers, listeners, timers,

assertions, and configuration elements.

Test Plan

Page 10: Introduction to jmeter

Thread group elements are the beginning points of

any test plan. All controllers and samplers must be

under a thread group.

Thread Group

Page 11: Introduction to jmeter

Samplers tell JMeter to send requests to a server and

wait for a response. They are processed in the order

they appear in the tree.

Sampler

Page 12: Introduction to jmeter

Assertions allow you to assert facts about responses

received from the server being tested. Using an

assertion, you can essentially "test" that your

application is returning the results you expect it to.

Assertion

Page 13: Introduction to jmeter

Listeners provide access to the information JMeter

gathers about the test cases while JMeter runs.

Listener

Page 14: Introduction to jmeter

Logic Controllers let you customize the logic that

JMeter uses to decide when to send requests. Logic

Controllers can change the order of requests coming

from their child elements. They can modify the

requests themselves, cause JMeter to repeat

requests, etc.

Logic Controller

Page 15: Introduction to jmeter

The timer will cause JMeter to delay a certain

amount of time before each sampler which is in its

scope .

Timer

Page 16: Introduction to jmeter

A configuration element works closely with a

Sampler. Although it does not send requests (except

for HTTP Proxy Server ), it can add to or modify

requests.

Config Element

Page 17: Introduction to jmeter

● A Pre-Processor executes some action prior to a

Sampler Request being made

● A Post-Processor executes some action after a

Sampler Request has been made

Pre-Processor / Post-Processor

Page 18: Introduction to jmeter

1. Config Element

2. Pre-Processor

3. Timer

4. Sampler

5. Post-Processor

6. Assertion

7. Listener

Execution Order

Page 19: Introduction to jmeter

● A plugin of Jmeter, lots of great features○ Stepping Thread Group

○ PerfMon Metrics Collector

○ Response Times vs Threads

○ Response Times Distribution

○ Parameterized Controller

Jmeter Plugins

Page 20: Introduction to jmeter

● 30 login user threads○ Ramp up: Start 3 threads every 10 seconds○ Hold for 300 seconds○ Stop 2 threads every 5 seconds

● 10 guest threads○ Ramp up: Start 1 thread every 10 seconds○ Hold for 300 seconds○ Stop 1 thread every 5 seconds

Example

Page 21: Introduction to jmeter

Example

Target Page Sample Average response time Throughtput

Guest Start page 4796 149 10

Start page 10892 247 23