learning j meter in 60 minutes
DESCRIPTION
Learn how to use Apache JMeter in less than 60 minutes. The best open source tool to test API and performance of mobile and web applicationsTRANSCRIPT
@alongir 785 Castro Street, Mountain View, CA 94041|1.855.445.2285|[email protected]
Learning JMeter in 60 Minutes
@alongir 785 Castro Street, Mountain View, CA 94041|1.855.445.2285|[email protected]
Alon Girmonsky About Me
• Hands-On Developer for the Past 20 Years • Expertise – Large-Scale Web and Mobile Applications – IP & Internet
• Founder & CEO of BlazeMeter – A Load Testing Platform as a Service – 100% Compatible with Apache JMeter
USERS
50,000
TESTS
500,000
@alongir 785 Castro Street, Mountain View, CA 94041|1.855.445.2285|[email protected]
Comprehensive scripting at your fingertips
Any Script, Any Scenario
• HTTP / HTTPS • Login / Signup • Form POSTing / Credit card transactions • Web services • Parameters extraction • Mobile • MSSQL, Oracle SQL, MySQL • Multiple user profiles
» Any script » Any scenario » Any protocol
100% Apache JMeter Compatible
@alongir 785 Castro Street, Mountain View, CA 94041|1.855.445.2285|[email protected]
Download the Latest Release of JMeter
How to Install JMeter?
• http://jmeter.apache.org/
@alongir 785 Castro Street, Mountain View, CA 94041|1.855.445.2285|[email protected]
The Thread Group
• What is this? - A group of virtual users where each distinct user will follow a certain business process
The Thread Group Properties: Property Description No of Threads
The maximum number of threads that will run concurrently at the end of the ramp up period
Ramp up The period is will take the load to ramp up from “idle” to maximum load
Iterations The number of iteration each thread will execute
Duration The duration of the test from start to end
The Thread The sequence of events that comprise the simulated business process
@alongir 785 Castro Street, Mountain View, CA 94041|1.855.445.2285|[email protected]
The Thread Group
@alongir 785 Castro Street, Mountain View, CA 94041|1.855.445.2285|[email protected]
The Sampler
• What is this? - The actual request object with its properties Supported Protocols: • HTTP • FTP • LDAP • MSSQL, MySQL, Oracle SQL • Mongo DB • SOAP/XML-RPC • Generic
• SMTP • oAuth • Rest • TCP • UDP • Many many more
@alongir 785 Castro Street, Mountain View, CA 94041|1.855.445.2285|[email protected]
The Sampler
@alongir 785 Castro Street, Mountain View, CA 94041|1.855.445.2285|[email protected]
The Listener
• What is this? - A fancy name for a report • Type of Listeners
– Aggregated – Detailed
• Use for debugging only • Consume a lot of memory • Use when you want to build custom reports (e.g. for errors only)
@alongir 785 Castro Street, Mountain View, CA 94041|1.855.445.2285|[email protected]
The Timer
• What is this? - A fancy name for delay or think time Type of Timers: • Constant • Constant Throughput
dd
@alongir 785 Castro Street, Mountain View, CA 94041|1.855.445.2285|[email protected]
Timers belong to a scope- We need to understand this
The Timer
• Timers (as other controllers/elements) work in scope • Once put in scope, applies to every element in the scope • If scope is of one element, applies only to that element Upper Scope
Child Scope
@alongir 785 Castro Street, Mountain View, CA 94041|1.855.445.2285|[email protected]
Record Using a Proxy
• A good way to start a script • Don’t forget to clean and parametrize
@alongir 785 Castro Street, Mountain View, CA 94041|1.855.445.2285|[email protected]
Record Using a Chrome Extension
@alongir 785 Castro Street, Mountain View, CA 94041|1.855.445.2285|[email protected]
Creating a Script Using a List of URLs
@alongir 785 Castro Street, Mountain View, CA 94041|1.855.445.2285|[email protected]
Necessary for Every Test
Test Defaults
Header
@alongir 785 Castro Street, Mountain View, CA 94041|1.855.445.2285|[email protected]
Getting your hands dirty with Apache JMeter
Practice: Writing Your First Script
Goal • Create a test simulating a gradual ramp up of up to 10 users against these two
pages: – http:// .. – http:// ..
How to go about it: • Use a proxy to record • Clean and label • Add the defaults • Add listeners and delays • Run • Analyze the results
175 Varick Street NY, NY 10013|1.855.445.2285|[email protected]
Advanced Scripting Concepts
@alongir 785 Castro Street, Mountain View, CA 94041|1.855.445.2285|[email protected]
Single Iteration
Single Iteration Vs Continuous Load
KPI: Number of Unique Users • Simulate a ramp up of unique
users • Low concurrency level For Example: • I want only 25K users visiting my
website over 1 hour
Continuous KPI: Load Level • Keep the load steady • High concurrency level For Example: • I want a constant and steady load
of 25K users visiting my website over 1 hour (I’ll probably end up with 200K users in that hour)
@alongir 785 Castro Street, Mountain View, CA 94041|1.855.445.2285|[email protected]
Assertions
• Define Proprietary Errors • Communicate Events
@alongir 785 Castro Street, Mountain View, CA 94041|1.855.445.2285|[email protected]
The best way to individualize each thread
Using CSV Files
@alongir 785 Castro Street, Mountain View, CA 94041|1.855.445.2285|[email protected]
External Properties
• Pass external properties to the script • Customize same script to support various scenarios Methods • Command line arguments (-J) • Properties file: user.properties
@alongir 785 Castro Street, Mountain View, CA 94041|1.855.445.2285|[email protected]
Extract from a page and use for the next page
Parameter Extraction
@alongir 785 Castro Street, Mountain View, CA 94041|1.855.445.2285|[email protected]
Variables
Variables and Properties
• Usage: ${var} • Scope: unique per thread
Properties • Usage: ${__P(prop)} • Scope: Test • Pass external properties to the
script • Customize same script to support
various scenarios Methods • Command line arguments (-J) • Properties file: user.properties
@alongir 785 Castro Street, Mountain View, CA 94041|1.855.445.2285|[email protected]
The Debug Sampler
Debugging
• The developer’s best friend
@alongir 785 Castro Street, Mountain View, CA 94041|1.855.445.2285|[email protected]
Getting your hands dirty with Apache JMeter
Practice: Writing Your Second Script
Goal • Create a test simulating a gradual ramp up of up to 10 users logging in to:
– http:// .. How to go about it: • Use a proxy to record • Use RexEx to parameterize • Clean, label, add defaults, listeners and delays • Add a CSV file with user names and passwords • Use assertions to validate responses • Run • Analyze the results
@alongir 785 Castro Street, Mountain View, CA 94041|1.855.445.2285|[email protected]
Performance 1-on-1
@alongir 785 Castro Street, Mountain View, CA 94041|1.855.445.2285|[email protected]
The Load Sensitivity Point What to look for?
@alongir 785 Castro Street, Mountain View, CA 94041|1.855.445.2285|[email protected]
Load Performance Types
Perfect Time
Sensitive
Bad
@alongir 785 Castro Street, Mountain View, CA 94041|1.855.445.2285|[email protected]
Load Performance Types
Perfect
The Perfect Load
Time
@alongir 785 Castro Street, Mountain View, CA 94041|1.855.445.2285|[email protected]
Load Performance Types
Sensitive
Sensitive to Load
Time
@alongir 785 Castro Street, Mountain View, CA 94041|1.855.445.2285|[email protected]
Load Performance Types
Bad
Bad Performance
Time
@alongir 785 Castro Street, Mountain View, CA 94041|1.855.445.2285|[email protected]
Load Performance Types
Perfect
Here They Are Again
Time
Sensitive
Bad
@alongir 785 Castro Street, Mountain View, CA 94041|1.855.445.2285|[email protected]
Thank you for your time!
Jolt Awards 2013: The Best Testing Tools
Thank you for attending. We’ll send out an email with the recording and the deck.
Q & A For more information about Performance Testing and JMeter: http://BlazeMeter.com/blog/ [email protected] @BlazeMeter