December 20, 2020

Introducing Apache JMeter 5.4: New Features and Abilities

Open Source Automation
DevOps

The Apache JMeter™ team released Apache JMeter 5.4 in December 2020. This article provides information about this new version, on top of the official JMeter changelog and the JMeter 5.4 announcement.

Back to top

What is the Latest Apache JMeter Version?

In December 2020, the Apache JMeter™ team released a brand new version—Apache JMeter 5.4. This article provides information about this new version, as well as the official JMeter changelog and the 5.4 announcement. Let’s take a look at which new features are available in the latest release of this popular open source load testing tool.

 

Back to top

How To Easily Filter Out Embedded Resources in JMeter 5.4

As you are probably aware, when performance testing web applications, Apache JMeter should behave as close to the real browser as possible. This includes handling of the so called “embedded resources”, such as images, scripts, styles, sounds, and fonts, to name a few.

 

In short, JMeter should - even must - download embedded resources to mimic a real browser’s behavior (don’t forget about the HTTP Cache Manager). However, when it comes to “external” resources that are not directly related to the system under test, it’s different. External resources like 3rd-party banners, JavaScript libraries loaded from CDNs, and any other types of website content that are not in your scope - should be excluded, as they will severely impact test results, and they are not something you can efficiently control.

 

Prior to Apache JMeter 5.4, it was possible to exclude these external resources from the “embedded resources” scope. However, you had to come up with a “negative” regular expression, which was not very convenient. Now with this new version, JMeter 5.4 provides a separate input field where you can specify the “unwanted” domains:

 

Specify unwanted domains

 

The setting appears both for HTTP Request sampler and for the HTTP Request Defaults configuration element.

 

Back to top

GraphQL HTTP Request

Prior to Apache JMeter 5.4 it was possible to test GraphQL using the normal HTTP Request sampler, however:

 

  • It was required to define a JSON object with the “query” attribute. The value had to be properly escaped for the translation of GraphQL queries into vanilla JSON. This created a lot of overhead, and now the solution is simple.
  • It was required to add the HTTP Header Manager to send the Content-Type header.

 

Pictured below is a brief demo that shows what the GraphQL HTTP Request sampler does under the hood, making your life easier:

GraphQL HTTP Request sampler

So basically you can use the same syntax as in your GraphQL console or other tools/programming languages, without worrying about the translation.

 

Back to top

New Implementation Option in JMeter 5.4

In addition to the previously available GraphiteBackendListenerClient and InfluxdbBackendListenerClient, a new implementation option is now available in the Backend Listener.

 

New Implementation Option in JMeter 5.4

This listener allows storage of “raw”, i.e. non-aggregated, metrics. Now you have individual results for each sampler. These include start time, connect time, elapsed time, status, sampler (or transaction) name, and latency. 

 

Let’s execute the GraphQL HTTP Request from above with the Backend Listener enabled and see what is stored in the InfluxDB:

 

Execute the GraphQL HTTP Request

As you can see:

 

  • The first "show measurements" command returns an empty result
  • After the execution of the GraphQL HTTP Request sampler there is a "jmeter" measurement 
  • The "select * from jmeter" command shows the aforementioned metrics and they match the ones from the View Results Tree listener ("ttfb" is “time to first byte” and JMeter’s equivalent is “Latency”).

 

Back to top

Why You Should Upgrade to JMeter 5.4

Even if the new features are not something you will be using right away, you should still consider upgrading to the latest version. Apart from the new functionalities, Apache JMeter 5.4 includes many bug fixes and performance improvements. This is due to its own codebase optimization as a side-effect of ramping up the versions of its dependent libraries. Using the latest version of JMeter is recommended both by JMeter Best Practices and BlazeMeter’s 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure article.

BlazeMeter supports all JMeter versions. Create your JMeter script and then run it in the cloud with BlazeMeter for free. Sign up now.

 

Back to top

Read More JMeter Content on BlazeMeter

If you would like to learn more about using JMeter or get tips, tricks and solutions on how to better use JMeter, check out the following blogs available on BlazeMeter.

START TESTING NOW

Back to top