Download - Performance Testing With Jmeter
![Page 1: Performance Testing With Jmeter](https://reader033.vdocuments.us/reader033/viewer/2022061410/554fb782b4c9050e7d8b4659/html5/thumbnails/1.jpg)
Performance Testingwith JMeter
Adam Goucher
http://adam.goucher.ca
![Page 2: Performance Testing With Jmeter](https://reader033.vdocuments.us/reader033/viewer/2022061410/554fb782b4c9050e7d8b4659/html5/thumbnails/2.jpg)
Lecture Objective
Give students an introduction to performance testing concepts and implementation using JMeter.
![Page 3: Performance Testing With Jmeter](https://reader033.vdocuments.us/reader033/viewer/2022061410/554fb782b4c9050e7d8b4659/html5/thumbnails/3.jpg)
Definitions
![Page 4: Performance Testing With Jmeter](https://reader033.vdocuments.us/reader033/viewer/2022061410/554fb782b4c9050e7d8b4659/html5/thumbnails/4.jpg)
Performance Testing
Performance testing determines or validates the speed of the AUT (X per T)
![Page 5: Performance Testing With Jmeter](https://reader033.vdocuments.us/reader033/viewer/2022061410/554fb782b4c9050e7d8b4659/html5/thumbnails/5.jpg)
Load Testing
Load testing identifies the maximum operating capacity of an application as well as any bottlenecks that might interfere with its operating at capacity
(Or, when does it blow up?)
![Page 6: Performance Testing With Jmeter](https://reader033.vdocuments.us/reader033/viewer/2022061410/554fb782b4c9050e7d8b4659/html5/thumbnails/6.jpg)
Stress Testing
Stress testing is focused on determining an application’s robustness, availability, and reliability under extreme conditions
• heavy loads
• high concurrency
• limited computational resources
![Page 7: Performance Testing With Jmeter](https://reader033.vdocuments.us/reader033/viewer/2022061410/554fb782b4c9050e7d8b4659/html5/thumbnails/7.jpg)
Scalability
Scalability testing determines or validates whether adding another Y resource (database, memory, disk, CPU, etc) increases speed of X proportionally
![Page 8: Performance Testing With Jmeter](https://reader033.vdocuments.us/reader033/viewer/2022061410/554fb782b4c9050e7d8b4659/html5/thumbnails/8.jpg)
Pre-testing Activities
![Page 9: Performance Testing With Jmeter](https://reader033.vdocuments.us/reader033/viewer/2022061410/554fb782b4c9050e7d8b4659/html5/thumbnails/9.jpg)
Design Review
The cheapest performance issues to address are ones that are never put into the code.
Testers should review the application design to see if there are any obvious potential performance problems.
![Page 10: Performance Testing With Jmeter](https://reader033.vdocuments.us/reader033/viewer/2022061410/554fb782b4c9050e7d8b4659/html5/thumbnails/10.jpg)
Environment Prep - Network
Performance testing is often a network intensive activity which can affect others in the organization
Testing should be done on a separate, segregated network.
![Page 11: Performance Testing With Jmeter](https://reader033.vdocuments.us/reader033/viewer/2022061410/554fb782b4c9050e7d8b4659/html5/thumbnails/11.jpg)
Environment Prep - Hardware
Depending on what your goals are for your testing, different hardware is appropriate for both the AUT and load generators.
Testers should acquire and configure the correct hardware.
![Page 12: Performance Testing With Jmeter](https://reader033.vdocuments.us/reader033/viewer/2022061410/554fb782b4c9050e7d8b4659/html5/thumbnails/12.jpg)
Environment Prep - Software
Generating load is not as easy as it sounds.
Testers should acquire or create load generators and configure them for their desired goal
![Page 13: Performance Testing With Jmeter](https://reader033.vdocuments.us/reader033/viewer/2022061410/554fb782b4c9050e7d8b4659/html5/thumbnails/13.jpg)
Mission
Performance testing without a Mission is just throwing load at a server to see what is going to happen.
Testers should determine Why they are doing their testing.
![Page 14: Performance Testing With Jmeter](https://reader033.vdocuments.us/reader033/viewer/2022061410/554fb782b4c9050e7d8b4659/html5/thumbnails/14.jpg)
Audience
Determining who you are generating numbers for, will largely dictate what you do
• Development
• Marketing
• Operations
![Page 15: Performance Testing With Jmeter](https://reader033.vdocuments.us/reader033/viewer/2022061410/554fb782b4c9050e7d8b4659/html5/thumbnails/15.jpg)
Metrics
Performance testing is all about numbers and metrics.
Testers should determine which metrics they are concerned about and how to get them.
![Page 16: Performance Testing With Jmeter](https://reader033.vdocuments.us/reader033/viewer/2022061410/554fb782b4c9050e7d8b4659/html5/thumbnails/16.jpg)
Give Warning
Let anyone who might be affected by your testing advance warning.
![Page 17: Performance Testing With Jmeter](https://reader033.vdocuments.us/reader033/viewer/2022061410/554fb782b4c9050e7d8b4659/html5/thumbnails/17.jpg)
Generic Testing Steps
1. Create / Record Test
2. Add measurement hooks
3. Data drive script
4. Add logging
5. Build workload profile
6. Execute test
![Page 18: Performance Testing With Jmeter](https://reader033.vdocuments.us/reader033/viewer/2022061410/554fb782b4c9050e7d8b4659/html5/thumbnails/18.jpg)
JMeter
![Page 19: Performance Testing With Jmeter](https://reader033.vdocuments.us/reader033/viewer/2022061410/554fb782b4c9050e7d8b4659/html5/thumbnails/19.jpg)
JMeter
JMeter is a free, open-source performance measurement tool written in Java
![Page 20: Performance Testing With Jmeter](https://reader033.vdocuments.us/reader033/viewer/2022061410/554fb782b4c9050e7d8b4659/html5/thumbnails/20.jpg)
Thread Groups
The Thread Group is the basic element of a JMeter Test Plan
Each thread represents a user setting a thread group to 1000 simulates 1000 users
![Page 21: Performance Testing With Jmeter](https://reader033.vdocuments.us/reader033/viewer/2022061410/554fb782b4c9050e7d8b4659/html5/thumbnails/21.jpg)
Samplers
Samplers do the actual work in JMeter and interact with the server you are loading
There are a number Samplers in JMeter by default. For web testing, use ‘HTTP Request'
![Page 22: Performance Testing With Jmeter](https://reader033.vdocuments.us/reader033/viewer/2022061410/554fb782b4c9050e7d8b4659/html5/thumbnails/22.jpg)
Listeners
The information produced by Samplers is consumed by Listeners
Popular listeners are:
• Graph Results
• View Results Tree
• Simple Data Writer
![Page 23: Performance Testing With Jmeter](https://reader033.vdocuments.us/reader033/viewer/2022061410/554fb782b4c9050e7d8b4659/html5/thumbnails/23.jpg)
Logic Controllers
Logic Controllers determine the order that Samplers are processed
More complex scripts will make use of• Loops• Interleave• Random• If
![Page 24: Performance Testing With Jmeter](https://reader033.vdocuments.us/reader033/viewer/2022061410/554fb782b4c9050e7d8b4659/html5/thumbnails/24.jpg)
Assertions
A test isn’t a test unless it checks something. Assertions are what do the checking
For web applications, these are the useful ones
• Response• Duration• HTML Assertion
![Page 25: Performance Testing With Jmeter](https://reader033.vdocuments.us/reader033/viewer/2022061410/554fb782b4c9050e7d8b4659/html5/thumbnails/25.jpg)
Configuration Elements
Configuration Elements set default values for other parts of the Test Plan as well as configure variables
• CSV Data Set Config allows you do to DDT within JMeter
• HTTP Cookie Manager will automatically intercept and sent cookies with requests
• HTTP Request Defaults saves you time when doing lots of HTTP Samplers
![Page 26: Performance Testing With Jmeter](https://reader033.vdocuments.us/reader033/viewer/2022061410/554fb782b4c9050e7d8b4659/html5/thumbnails/26.jpg)
Variables
In JMeter, you can reference variables as such
${VARIABLE}
![Page 27: Performance Testing With Jmeter](https://reader033.vdocuments.us/reader033/viewer/2022061410/554fb782b4c9050e7d8b4659/html5/thumbnails/27.jpg)
Batch
JMeter can run in a non-gui mode to save resources on the load generating machines
![Page 28: Performance Testing With Jmeter](https://reader033.vdocuments.us/reader033/viewer/2022061410/554fb782b4c9050e7d8b4659/html5/thumbnails/28.jpg)
Recording
There is a way to record tests (as in LoadRunner) but I find it easier to build scripts one element at a time