JMeter is an Apache Jakarta project, which is open source pure Java desktop software and is used to measure performance of variety of services and load test functional behavior and with a focus on web applications. JMeter can be used for web application testing and various servers testing like database using JDBC, Mail, JMS, LDAP, etc. It is developed in such a way that we can write our own plug-ins to extend the capabilities of JMeter. It was originally designed for testing Web Applications, but has since expanded to other test functions.
Additionally, JMeter can help you regression test your application by letting you create test scripts with assertions to validate that your application is returning the results you expect. For maximum flexibility, JMeter lets you create these assertions using regular expressions.
Stefano Mazzocchi of the Apache Software Foundation was the original developer of JMeter. First, it was written primarily to test the performance of Apache JServ (a project that has since been replaced by the Apache Tomcat project). Again JMeter was redesigned to enhance the GUI and to add functional-testing capabilities.
What can we do with JMeter
Apache JMeter may be used to test performance both on static and dynamic resources (files, Servlets, Perl scripts, Java Objects, Data Bases and Queries, FTP Servers and more).
JMeter being a highly robust, scalable, and portable application makes it a suitable testing tool for today’s non-proprietary, fast-changing, and market-driven application development process. Anyone with software testing experience or knowledge at any level will find JMeter easy to learn and use. One doesn’t need programming expertise to realize the potential use of JMeter, but having it surely helps.
JMeter is used to monitor servers of database server, web server, and any other type of service (ftp, ..etc).
Sometimes, it can also be configured and used to provide monitoring solutions and also used to make a graphical and GUI friendly breakdown of performance. Tests for JMeter are created visually and have a tree structure in the editing test. You can run the tests from the application window and from the command line, which in turn is useful if you run them on a schedule, for example, at night.
It can be used to simulate a heavy load on a server, network or object to test its strength or to analyze overall performance under different load types. You can use it to make a graphical analysis of performance or to test your server/script/object behavior under heavy concurrent load.
Apache JMeter features include:
• JMeter has complete portability and 100% Java purity.
• JMeter can load and performance test many different server types like Web – HTTP, HTTPS, SOAP, database via JDBC, LDAP, JMS, mail-SMTP(S), POP3(S) and IMAP(S), and native commands or shell scripts.
• Its full multithreading framework allows concurrent sampling by many threads and simultaneous sampling of different functions by separate thread groups.
• Its careful GUI design allows faster operation and more precise timings.
• Caching and offline analysis/replaying of test results.
• JMeter is highly extensible with pluggable Samplers allow unlimited testing capabilities, several load statistics may be chosen with pluggable timers, data analysis and visualization plug-ins allow great extensibility as well as personalization, functions can be used to provide dynamic input to a test or provide data manipulation, scriptable Samplers (BeanShell is fully supported; and there is a sampler which supports BSF-compatible languages).
How JMeter works
JMeter stimulates a group of users sending requests to a target server and returns statistics that show the performance of the target server/application through graphical diagrams.
JMeter testing tools or basic elements are as follows:
1) Test plan.
2) Thread group.
3) Controllers and Sampler.
7) Configuration element.
8) Pre-processor elements.
9) Post-processor elements.
1. Test Plan: 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 controllers, sample generating controllers, listeners, timers, assertions, and configuration elements.
2. Thread Group: Thread group elements are the beginning points of any test plan. All controllers and samplers must be under a thread group. Listeners may be placed directly under the test plan, in which case they will apply to all the thread groups. The controls for a thread group allow you to set the number of threads, ramp-up period, and number of times to execute the test.
3. Controllers and Sampler: JMeter has two types of Controllers. They are Samplers Controllers and Logical Controllers.
Samplers Controllers: Samplers tell JMeter to send requests to a server.
Logical Controllers: Logical Controllers let you customize the logic that JMeter uses to decide when to send requests.
4. Listeners: A listener is a component that shows the results of the samples the results can be shown in a tree, tables, graphs or simply written to a log file.
5. Timers: JMeter thread sends requests without pausing between each request by default. The timer will cause JMeter to delay a certain amount of time before each request that thread makes.
6. Assertions: Assertions will allow you to assert facts about responses received from the server being tested.
7. Configuration tool: 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.
8. Pre-processor elements: A pre-processor executes some action prior to a Sampler Request being made.
9. Post-processor elements: A Post-processor executes action after a sampler request has been made.
JMeter plug-in has lots of great features:
• Stepping thread group.
• Perform on metrics collector.
• Response times vs threads.
• Response times distribution.
• Parameterized controller.