JMeter is a very popular open source load testing tool with great flexibility thanks to its Java-based extension points. What it lacks is the ability to analyze the results in combination with metrics from your application and your infrastructure. As mentioned in a recent PerfBytes podcast, because JMeter itself doesn’t provide good data visualization, most users stream JMeter results to an external dashboarding solution.

In order to avoid having to set up Elastic Search, Splunk or other external analytics solutions I want to show you how you can easily stream data to Dynatrace AppMon using the free Dynatrace Personal License. With it you get JMeter and Application Performance Monitoring data in a single dashboard which makes performance analysis and diagnostics much easier.

Here is what you get if you follow my recommendations in this blog or simply watch my Metrics-Driven Continuous Delivery Performance Clinic recording on YouTube:

LIVE JMeter results in a Dynatrace dashboard correlated to key application and infrastructure measures!
LIVE JMeter results in a Dynatrace dashboard correlated to key application and infrastructure measures!

Step 0: Get Dynatrace Installed

If you do not yet have Dynatrace just register for a 30 Day Free Trial which will automatically convert to a lifetime Personal License. The Personal License gives you all product features for applications that you test on your local workstation! I also have a YouTube Tutorial that shows “What Dynatrace really is, How to get Started” and, in all fairness, whether it is a tool for your application stack or not!

Step 1: Install Generic Data Monitoring Plugin

In order to feed ANY TYPE of data to Dynatrace I created a Generic Measure Monitoring Plugin that you can download from the Dynatrace GitHub repository. Download the latest release, install the plugin through the “Server Settings” dialog and then configure the plugin to run every 10s in your System Profile. By default the plugin will then open a REST listening endpoint on http://yourcollector:4000/genericmonitor (you can change that if you want).

To verify if the plugin is really working as expected just check my plugin description on the GitHub page!

Step 2: Stream JMeter Results to Dynatrace

JMeter provides a BeanShellListener Extension which we can use to get every single result of your Samplers. All you need to do is create such a BeanShell Listener for your Test Plan or Thread Group and then copy my Java code from my BeanShellListener that I’ve uploaded in the JMeter Sample script on GitHub.

This JMeter BeanShell Listener will stream result data to Dynatrac
This JMeter BeanShell Listener will stream result data to Dynatrace

Step 3: Run your Test

I guess I don’t need to tell you how to run your JMeter tests. So – fire them up!

Step 4: View the Results in Dynatrace

On the GitHub page I added a Dynatrace Web Dashboard. You can simply open your Dynatrace Web Dashboards through http://yourdtserver:9911/index.jsp#dashboard-selection-list. Once logged in click on Import and import that JMeterDTWebDashboard.dwd file. If you open the dashboard the only thing you might need to do is change the data source to your System Profile. Now you should see data coming in with the JMeter Response Time overview broken into Thread Group Names in the top left, and Dynatrace performance data such as Response Time as captured on the application, number of SQL Queries executed, number of Exceptions thrown or how many internal web services are called — basically the screenshot I used in the introduction of this blog post.

Step 5: Diagnose Performance Hotspots

To give you some additional ideas on more Dynatrace Web Dashboards check out the following screenshot:

  • Top Left: Response Time and Load split by logical application tiers. Tells you whether your load balancer works correct or whether you have any unusual load on certain backend tiers
  • Bottom Right: CPU by application tier. Tells you whether you have individual overloaded web or application servers
  • Top Right: Worker thread utilization on your app and web servers. Easy to spot when you run out of threads either because of misconfiguration or “thread leaks”.
  • Bottom Right: Memory behavior of your Java & .NET Tiers. Makes it easy to spot memory leaks, performance problems due to high memory usage and crashes due to out-of-memory exceptions
Dynatrace Load Testing Dashboard to identify architectural performance hotspots such as bad load balancing or running out of key resources: CPU, Threads, Memory
Dynatrace Load Testing Dashboard to identify architectural performance hotspots such as bad load balancing or running out of key resources: CPU, Threads, Memory

Engineers: Time to Start your JMeter Engines

This is just a start but a really great way to combine the data from two powerful tools. I’ve been analyzing JMeter and Dynatrace results for a while now. Most of the real application performance and scalability problems we see are caused by inefficient database access, resource leaks, bad coding and bad configuration. Dynatrace gives you more specific Load Testing Dashboards to analyze all these problems. I also covered this in several YouTube Tutorials that you should check out:

If you have any further questions let me know. If you want to share some data with me feel free to use my Share Your PurePath Program.