Introduction to jmeter

4,994 views

Published on

Introduction to jmeter

Published in: Technology
2 Comments
4 Likes
Statistics
Notes
No Downloads
Views
Total views
4,994
On SlideShare
0
From Embeds
0
Number of Embeds
13
Actions
Shares
0
Downloads
295
Comments
2
Likes
4
Embeds 0
No embeds

No notes for slide

Introduction to jmeter

  1. 1. Introduction to JMeter Magus Chen maguschen@gmail.com http://magustest.com/blog
  2. 2. Agenda● Performance testing● What is JMeter● JMeter basic elements● Jmeter Plugins● Example
  3. 3. Performance Testing● Performance testing is in general testing performed to determine how a system performs in terms of responsiveness and stability under a particular workload.
  4. 4. Performance Testing● 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 systems robustness in terms of extreme load
  5. 5. Performance Testing● 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.
  6. 6. What is 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.
  7. 7. JMeter basic elements● Test Plan● Thread Group● Sampler● Assertion● Listener● Logic Controller● Timer● Config Element● Pre-Processor / Post-Processor
  8. 8. JMeter basic elements
  9. 9. Test PlanA test plan describes a series of steps JMeter willexecute when run. A complete test plan will consistof one or more Thread Groups, logic conrollers,sample generating controllers, listeners, timers,assertions, and configuration elements.
  10. 10. Thread GroupThread group elements are the beginning points ofany test plan. All controllers and samplers must beunder a thread group.
  11. 11. SamplerSamplers tell JMeter to send requests to a server andwait for a response. They are processed in the orderthey appear in the tree.
  12. 12. AssertionAssertions allow you to assert facts about responsesreceived from the server being tested. Using anassertion, you can essentially "test" that yourapplication is returning the results you expect it to.
  13. 13. ListenerListeners provide access to the information JMetergathers about the test cases while JMeter runs.
  14. 14. Logic ControllerLogic Controllers let you customize the logic thatJMeter uses to decide when to send requests. LogicControllers can change the order of requests comingfrom their child elements. They can modify therequests themselves, cause JMeter to repeatrequests, etc.
  15. 15. TimerThe timer will cause JMeter to delay a certainamount of time before each sampler which is in itsscope .
  16. 16. Config ElementA configuration element works closely with aSampler. Although it does not send requests (exceptfor HTTP Proxy Server ), it can add to or modifyrequests.
  17. 17. Pre-Processor / Post-Processor● 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
  18. 18. Execution Order1. Config Element2. Pre-Processor3. Timer4. Sampler5. Post-Processor6. Assertion7. Listener
  19. 19. Jmeter Plugins● A plugin of Jmeter, lots of great features ○ Stepping Thread Group ○ PerfMon Metrics Collector ○ Response Times vs Threads ○ Response Times Distribution ○ Parameterized Controller
  20. 20. Example● 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
  21. 21. ExampleTarget Page Sample Average response time ThroughtputGuest Start page 4796 149 10Start page 10892 247 23

×