Methods & Tools Software Development Magazine

Software Development Magazine - Project Management, Programming, Software Testing

Scrum Expert - Articles, tools, videos, news and other resources on Agile, Scrum and Kanban

JMeter Plugins - More Powerful Load Testing with JMeter Plugins

Andrey Pohilko, https://jmeter-plugins.org/

JMeter Plugins at Google Code (JP@GC) is a popular third-party plugins set for JMeter, extending its functionality with a dozen of 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.

Web Site: https://jmeter-plugins.org/
Version Tested: JMeter-Plugins 0.5.2 as of May 14, 2012
License & Pricing: Free & Open Source
Support: Users Mailing List http://groups.google.com/forum/#!forum/jmeter-plugins
Documentation: Online https://jmeter-plugins.org/wiki/Start/

Installation

To add extensions to JMeter, you should simply locate the lib/ext folder under JMeter installation path and extract the JP@GC distribution package contents into it. The latest JP@GC package can be always found at the project page (http://jmeter-plugins.org/).

Restart JMeter to load the installed plugins and look for items named like "jp@gc - ..." in JMeter menus. Use those items as if they are regular JMeter elements.

Documentation

Every JP@GC plugin has an immediate "Help on this plugin" link, opening Wiki page containing description for current extension in Web browser. If you still confused or have some tricky issue - feel free to ask at project support mailing list.

Graph Plugins

The JMeter tool itself has a sound 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.

JP@GC targets this weak point and offers several groups of test results visualization plugins. All of these plugins can be found in Edit => Add => Listener menu of JMeter. Every graph plugin in JP@GC has three tabs: Chart, Rows and Settings. Don't forget to play with controls at Settings tab - there are a lot of look-and-feel settings to get the best view of your data. Also consider right-clicking the graph area, there is popup menu for saving image or CSV data under it.

Target Resource Monitoring

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 (Figure 1).

JMeter Plugins - More Powerful Load Testing with JMeter Plugins

Figure 1 - Target Resource Monitoring Plugin

PerfMon 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.

Timelines

The most numerous graphs in JP@GC are timelines which have all names like "... Over Time" or "... 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.

Composite Graph 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 for instance. Since PerfMon Metrics Collector has also a timeline type, it can be used as a source for Composite Graph, too.

JMeter Plugins - More Powerful Load Testing with JMeter Plugins

Figure 2 - Composite Graph with three different graphs chosen

Distributions

Distribution analysis is vital in performance testing, so JP@GC has a pair of graph plugins for distribution analysis: Response Times Distribution and Response Times Percentiles.

Distribution bar chart is a commonly used analysis technique and JP@GC provides flexible graph with configurable granulation (Figure 3). There is special "Aggregate Mode" switch at settings tab. If aggregate mode is selected, all data rows are merged into single row, showing whole test response times distribution.

Figure 3 - Response Times Distribution visualized

The Percentiles graph is used for advanced results analysis., It allows analyzing not only 50% or 90% line, but all other percentile levels that can be set in external SLA requirements.

Command-Line Tool

Advanced JMeter users rarely perform regular JMeter tests via GUI, they prefer to set up test and run it in non-GUI mode, via command-line. To help users automate their test reporting, JP@GC has a command-line tool that can consume JTL files and produce the same graphs as JMeter GUI plugins. Also it can be used to export graph data to CSV file for further processing. For example, the following command:

JMeterPluginsCMD.bat --generate-png test.png --input-jtl results.jtl --plugin-type ResponseTimesOverTime

will generate the same graph as if results.jtl file would be loaded in Response Times Over Time plugin from JMeter GUI.

Feature Extension Plugins

Visualization is not the only area where JMeter functionality can be efficiently extended. There are also useful additions for load supply, logging, advanced inter-thread parameter passing and many others. Only the key feature extensions will be described in this article, all others are available in project's documentation.

Load Delivery Plugins

The original JMeter package contains only one load supply controller: simple Thread Group. However, many users need solution to configure threads to start by bunches, or to create complex load supply scenario. JP@GC provides two solutions: Stepping Thread Group and Ultimate Thread Group. For those users who use not thread-driven, but request-per-second-driven load testing, there Throughput Shaping Timer plugin.

Stepping Thread Group (STG) allows to set up users activation scenario where threads start with "stepping" schedule. Targeting to be more obvious than original JMeter elements, the preview graph in STG shows expected active threads count (Figure 4).

JMeter Plugins - More Powerful Load Testing with JMeter Plugins

Figure 4 - Stepping Thread Group

Ultimate Thread Group (UTG) also offers threads schedule with preview, it is composed from ramp-up chunks and allows to compose complex cases, like sudden spikes. Every threads chunk has settings for startup delay, ramp-up time, hold time and ramp-down time. The final load will be calculated as a sum of the active threads count of all chunks in a given second.

Throughput Shaping Timer concentrates on request throughput and allows setting freeform schedule like UTG. It is used when your service is placed behind a load balancer and users count is masked.

Samplers

The original JMeter is perfect at testing HTTP tasks and other high-level TCP services. But suddenly it has no UDP protocol support. JP@GC offers UDP Sampler, which may be used for load testing widely used DNS servers.

Dummy Sampler is also interesting: it just produces samples without external requests, this helps to debug Regular Expression Extractor work.

HTTP Raw Request offers low-level TCP sampler with important improvement: memory consumption limits. It may be used for huge file uploads and huge response downloads when the original JMeter items produce OutOfMemoryException or work slowly.

Logging

As said above, experienced JMeter users like to run tests from command-line using non-GUI mode. The drawback is that JMeter shows no activity info in command line and it is difficult to tell if it is OK. Again, JP@GC helps with Console Status Logger, which prints short summary every second in non-GUI mode. Find it in Listeners menu of JMeter.

A frequent question in JMeter Mailing List is how to save some value extracted during test to some custom log file. There is Flexible File Writer which can be used to setup freeform saving into file.

Inter-Thread Communication Features

At last, the most advanced JMeter users will be surprised how easily they can perform the most complex task for JMeter scenario: pass some value from one Thread Group to another. The version 0.5.2 of JP@GC introduces Post-Processor that puts data into global queue and Pre-Processor that gets data from that queue, no matter in which thread it will be called.

JMeter Plugins - More Powerful Load Testing with JMeter Plugins

Figure 5 - Inter-Thread Communication via FIFO Queue

Conclusion

The original JMeter is precious tool for the load testing community. And it can glitter even more when polished with JP@GC additions. Not all of them were covered in this short article, so take your time to investigate project documentation.

Remember, that you are in the area of free and open source software with JMeter and . Your feedback and ideas can easily change the project and fill it with new features.


More JMeter, Load Testing, Software Testing and Java Content


Click here to view the complete list of tools reviews

This article was originally published in the Summer 2012 issue of Methods & Tools

Methods & Tools
is supported by


Testmatick.com

Software Testing
Magazine


The Scrum Expert