3 Easy Ways to Monitor JMeter Non-GUI Test Results

The Apache JMeter™ GUI enables you to easily configure your performance scripts, add new test elements, and monitor test execution by using a variety of different listeners. But this “easy-to-use” solution has its drawbacks, especially when you need to use it for more complex cases.

For example, you might feel the disadvantages of the GUI mode when you start to perform load tests with thousands of users since running JMeter in GUI mode takes a lot of your machine resources. You might also be confused about how to use JMeter GUI in your continuous integration server (CI). The answer is that there's no way.

Fortunately, JMeter allows you to save performance tests as a script and run them in the non-GUI mode via the command line. This enables running very large tests, as well as adding the same command into continuous integration and automating the process.

But at this point, you might notice that you are not able to monitor your scripts with GUI JMeter listeners like you were before. In this article, we are going to cover that gap and help you start monitoring your non-GUI tests in a few steps: through out-of-the-box logs, via Taurus, and through the BlazeMeter cloud.

First of all, let’s create a performance script that we can use for the test. We will run a load test for the http://blazedemo.com/ web app, which is available for everyone who wants to play around with some performance scripts.

We are not going to cover GUI performance script creation from scratch, assuming that you have some hands-on experience on that. Briefly, this is the performance script configuration:

Thread group:

monitoring jmeter results in non gui mode

HTTP Sampler (1/2):

monitoring jmeter results in non gui mode

HTTP Sampler (2/2):

how to monitor results when jmeter is in non gui

Add a random timeout to simulate user behavior:

jmeter results monitoring and analysis non gui mode

Save the JMX file to be used to run the performance test via the command line. You can do it this way:

File > Save Test Plan As > JMX file. I named mine NonGuiTestMonitoring.jmx.

At this point, you can forget about the JMeter GUI application and close it until you want to change something in the script. 

1. Monitoring JMeter Results From Out-of-the-Box Logs

To run the JMeter JMX file, you can use this command line template:

 > jmeter -n -t [jmx_path] 

Assuming that our current location is the folder with the created script, you run it with this command: 

 > jmeter -n -t NonGuiTestMonitoring.jmx 

Let’s run and see which details we can get from JMeter Non-GUI mode. 

jmeter results kpis in non gui mode

As you can see, even out of the box JMeter, provides some useful stats that can be used for basic real-time monitoring of your script execution. Let’s go over the stats and verify what we have:

These metrics show us some basic stats about our performance tests execution. However, they do not contain any specific details and reflect only the general server state. Let’s see how we can improve that.

2. Monitoring JMeter Results via Taurus

You also can go with another way. By using the Taurus framework, you can get real-time monitors right inside your console. Taurus can be used as a JMX script runner and provides many additional features, including real-time monitoring.

After you finish the Taurus installation with the few steps mentioned on this page, you can go ahead and run the same JMX file from before.

Just run this command:

 > bzt NonGuiTestMonitoring.jmx 

jmeter non gui results monitoring via taurus

Even without any additional configurations, Taurus allows you to run your performance script with detailed real-time monitoring in the command line. On the Console dashboard, you can find almost all the metrics you might be interested in.

You can track active and all users, different response metrics for each sampler separately, errors, and execution machine metrics. This solution is perfect if you want just to monitor your tests in real time and don’t want to waste time on additional configurations. It’s also helpful that you don’t need to use anything except the console and you can even run these monitors on a remote server that doesn’t have a desktop (via SSH) and still see execution monitors.

3. Monitoring JMeter Results via the BlazeMeter Cloud

You can also easily run your JMX script in the cloud by using https://a.blazemeter.com. Use the free out-of-the-box version to upload your JMX script and run a load of up to 50 users. To run the test, you can either upload your JMX file in the box below or at the top of the page, or open the web application and then choose JMeter Test and configure your test.

After that, you might need to wait for two to four minutes until cloud server is up and running. As soon as the script is running, you will be redirected to the page of real-time monitoring where you can see all KPIs and analytics, like response time, active users, the percentage of errors and bandwidth, as well as multiple reports. 

monitoring results by jmeter through blazemeter

You can combine Taurus with BlazeMeter. By using just one command line parameter, you can still monitor results through your console, with the BlazeMeter results analysis. This will allow you to save all your test reports and perform additional analyses and metrics’ comparison afterward. All you need to do is to add one argument to the existing command:

 > bzt NonGuiTestMonitoring.jmx -report 

Then, in the logs execution, you will find the link to real-time monitoring. The new browser tab will also be automatically opened during test execution. 

monitoring jmeter results in taurus and blazemeter

In addition to all these methods, there is one more way to establish detailed monitoring: by integrating JMeter, InfluxDB, and Grafana. This method might suit you if you are able to spend more time on the configuration and maintenance of your solution. We will cover this solution in the next blog post, so stay tuned!

 

 

 

 

Top