{"id":17,"date":"2014-07-11T09:22:44","date_gmt":"2014-07-11T09:22:44","guid":{"rendered":"http:\/\/blog.gallop.net\/?p=17"},"modified":"2021-02-24T11:27:03","modified_gmt":"2021-02-24T05:57:03","slug":"an-amazing-open-source-performance-testing-tool-jmeter","status":"publish","type":"post","link":"https:\/\/www.cigniti.com\/blog\/an-amazing-open-source-performance-testing-tool-jmeter\/","title":{"rendered":"An Amazing Open-Source Performance Testing Tool – Jmeter"},"content":{"rendered":"
Introduction<\/strong>:<\/p>\n Why opt for expensive commercial tool licensing and maintenance, when free tools are available in the market. All you need to put in is a little bit of planning and effort.<\/p>\n Jmeter<\/strong> is one of the best leading performance testing tools from Apache open source community. With great community support, the tool supports continuous releases, improvement and meets the needs of the testers along with the needs of the business community.<\/p>\n The Apache JMeter™ is 100% pure Java application designed to load test functional behavior and measure performance. Originally designed for testing Web Applications, the tool has expanded to other test functions. Since the application is written in Java, it can be run on any machine, Windows, Linux or Mac.<\/p>\n Apache Jmeter is used to test the performance on static as well as dynamic resources (Files, Web dynamic languages – PHP, Java, ASP.NET, Java Objects, Data Bases and Queries, FTP Servers and more). It is also used to simulate a heavy load on a server, group of servers, network or object to test its strength or to analyze overall performance under different load types. You can also use it to make a graphical analysis of performance or to test your server\/script\/object behavior under heavy concurrent load. The tool\u2019s benefits include: <\/strong> <\/p>\n From the above diagram, it is clear that Listeners and Config elements can be configured at any level, thus defining the scope for them. If the listeners are defined at the Sampler level, they work only for that sampler. If they are defined at the thread group level, they can work with all the samplers under the thread group. If they are defined at the Test Plan level, they are applicable to all the thread groups and all the samplers under the thread groups. Test Plan<\/strong> Thread Group<\/strong> Samplers<\/strong> Config Elements<\/strong> Controllers<\/strong> Assertions<\/strong> Post Processors<\/strong> Timers<\/strong> Listeners<\/strong> The JMeter tool itself has a strong position in the world of performance testing, because it offers professional level features, comparable to commercial tools, and still stays free and open source. However, out-of-the-box JMeter has some weak points, mainly a lack of reporting features and visualizations.<\/p>\n JP@GC targets this weak point and offers several groups of test results visualization plugins. It is a popular third-party plugins set which extends Meter\u2019s functionality with a multiple graphs, new load delivery controllers and other functions that are missing from the original JMeter package. Basically, the JP@GC set contains two types of plugins: graph plugins and JMeter functionality extensions.<\/p>\n Ultimate Thread Group: <\/strong>\u201cUltimate” means there will be no need in further Thread Group plugins.<\/p>\n Stepping Thread Group:<\/strong> JMeter has only one out-of-the-box option for threads (users) scheduling: simple ramp-up. But many users, especially the users with experience on HP LoadRunner are used to a flexible thread scheduling algorithm. Stepping Thread Group adds a thread scheduling similar to LoadRunner.<\/p>\n JP@GC plugin is providing the timeline based graphs which have all names like Over Time, per Second. Timeline graphs visualize the results during the test run, and also can load non-GUI JMeter test results from JTL files. The available timeline data types to plot are: response times, server hits (transactions) per second, response codes, active JMeter thread counts.<\/p>\n Sample Graphs:<\/strong> jp@gc \u2013 Response Time Over Time:<\/strong> This graph will display the average response time in milliseconds for each sampler. jp@gc \u2013 Response Code per Seconds:<\/strong> This graph provides the response code per second. Composite Graph: <\/strong>is a special plugin that does not collect data itself, but uses other timelines as a source. You can aggregate different data in one graph to track correlation between test parameters and examine how response time depends on active threads count. Since PerfMon Metrics Collector has also a timeline type, it can be used as a source for Composite Graph. Target Resource Monitoring:<\/strong>PerfMon Metrics Collector is the most popular component of the jmeter-plugins set. It allows to monitor the resources usage of the target computer within JMeter. It requires a special ServerAgent process to be started at target computer and plots collected data on nice graph.Features:<\/h6>\n
\n\u00bb Ability to load and performance test across many different server\/protocol types:<\/strong><\/p>\n\n
\n\u00bb Complete portability and 100% Java purity.
\n\u00bb Full multithreading framework which enables concurrent sampling by many threads and simultaneous sampling of different functions by separate thread groups.
\n\u00bb A GUI design that allows faster Test Plan building and debugging.
\n\u00bb Caching and offline analysis\/replaying of test results.
\n\u00bb Highly Extensible core. The core in itself offers immense value with<\/p>\n\n
Typical Jmeter Test Plan:<\/h6>\n
\nHowever, this works a little different for the Config elements. Each of the config elements have their own scope which would be explained in detail at the Config Elements section.<\/p>\n
\nA test plan contains the overall settings of the performance test. A test plan can have multiple Config elements, listeners and Thread Groups. The test plan can control the execution (parallel or sequential) of thread groups and can also be used to save the responses.<\/p>\n
\nA thread group is where the number of threads (users), ramp-up rate and the start times of the thread group are defined. All the items under a thread group are executed by multiple threads\/users. A thread group can have multiple samplers, config elements, controllers etc.<\/p>\n
\nThese are the actual requests made from the JMeter tool. These samplers can be a HTTP Request, Web Service request or JDBC request or can be even a java request. For performance testing the web applications using JMeter, each thread group will have several HTTP requests which will be executed by multiple threads concurrently and thus causing the load on the web application.<\/p>\n
\nConfig elements are the ones which can be configured the way the samplers \/thread groups \/ test plan are executed. The most commonly used HTTP config elements are HTTP Cookie Manager, HTTP Cache manager, HTTP Auth Manager. Similarly to run a JDBC sampler, the JDBC config element has to be specified.<\/p>\n
\nControllers are used to control the flow of a thread through the thread group. All the conditions like If, for, while etc. are the examples of Controllers.<\/p>\n
\nAssertions are required to validate the response that is received when a request (a sampler is executed) is made to the application. The assertions can be text assertions, XML assertions, Xpath etc.<\/p>\n
\nOnce a response is received for a particular sampler request, Post processors are used to perform actions. The most commonly used post processor is the regular expression extractor.<\/p>\n
\nTimers are used to delay the execution of the thread or to make the thread wait for the specified time. The commonly used timers are constant timer, Gaussian random timer etc.<\/p>\n
\nListeners are the reporting entity of JMeter which can be configured at the sampler \/ thread group \/test plan level. The most commonly used listeners are View results tree, View results summary and aggregate report.<\/p>\nThird party plugins for Jmeter<\/h4>\n
JC@GC functionality extensions for Jmeter:<\/h6>\n
\n
\n
\n
Timeline – Graphs:<\/h6>\n
\njp@gc \u2013 Hits per Seconds:<\/strong> This graph will display the hits generated by the test plan to the server per second. Hits include child samples from transactions and embedded resources hits.
\n<\/p>\n
\n<\/p>\n
\n<\/p>\n
\n<\/p>\n
\nPerfMon plugin supports collecting an unlimited number of metrics at the same time. It can collect over 75 separate metric types in groups: CPU, Memory, Disk, Network, Swap, TCP statistics, Java JMX metrics. Per-process and system total metrics are supported. In case you need to collect a custom metric that is calculated by your program\/script, you may use the Custom metric type.<\/p>\nRefer to the following link for more details on Jmeter & downloads<\/h6>\n