Introduction to JMeter Magus Chen firstname.lastname@example.org http://magustest.com/blog
Agenda● Performance testing● What is JMeter● JMeter basic elements● Jmeter Plugins● Example
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.
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
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.
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.
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.
Thread GroupThread group elements are the beginning points ofany test plan. All controllers and samplers must beunder a thread group.
SamplerSamplers tell JMeter to send requests to a server andwait for a response. They are processed in the orderthey appear in the tree.
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.
ListenerListeners provide access to the information JMetergathers about the test cases while JMeter runs.
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.
TimerThe timer will cause JMeter to delay a certainamount of time before each sampler which is in itsscope .
Config ElementA configuration element works closely with aSampler. Although it does not send requests (exceptfor HTTP Proxy Server ), it can add to or modifyrequests.
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