DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report

JMeter Listeners, Part IV: Listeners That Support Scripting and Management

Listeners enable monitoring of JMeter requests, analyze results, and check system health. They aggregate data, process and manipulate info, and enable customization.

Konsantine Firsanov user avatar by
Konsantine Firsanov
·
Mar. 11, 17 · Opinion
Like (2)
Save
Tweet
Share
5.59K Views

Join the DZone community and get the full member experience.

Join For Free

Welcome to Part IV of our JMeter listeners series, which is also the final part. In Part I, we explained listeners that have basic displays. In Part II, we went over listeners that aggregate data samples. In Part III, we covered listeners that calculate distribution metrics. This time, we will present listeners that support scripting and enable test and system management. 

All listeners can be found by right clicking the test plan Add > Listeners. A JMeter listener will only collect data from JMeter elements at or above its level. For a more detailed explanation, see the first blog post in this series.

Listeners enable monitoring of JMeter requests, analyze results, and check system health. They aggregate data, process and manipulate the information in it, and even enable customization. Read on to learn about the five last listeners we will cover: BeanShell, JSR223, Composite Graph, PerfMon Metrics Collector, and AutoStop. 

BeanShell Listener

The BeanShell listener supports Java syntax code and has access to the JMeter runtime variables (vars, CTX, prev, log, props, SampleEvent) and to the methods they support. This enables you to get sample results and compose specific custom reports from them. Results are saved to a file. 

In the screenshot below, you can see an example of a BeanShell listener that implements writing aggregated information about response codes that each sample of the script returns to a file. The listener collects all the response codes from the samples in their scope into the Map java object. At the end of the script, in the TearDown thread group, the collected data is written into a file.

jmeter beanshell listener

JSR223 Listener

The JSR223listener is similar to the BeanShell listener, but it enables selecting between several languages to code the listener functionality.

PerfMon Metrics Collector 

Load testing measures not only the behavior of the tested system but also its resource utilization. The PerfMonMetricsCollector listener receives CPU usage, memory consumption, disk and network utilization metrics and provides reports. The data is received from the server agent, which is installed on the servers of the system under the test. The server agent utility collects the resource consumption data of the servers it is installed on and sends them back to the listener. Learn more about the PerfMonMetricsCollector from this article.

jmeter perfmon metrics collector

AutoStop Listener

One of the most useful JMeter listeners is the AutoStoplistener, which is configured so that the test stops executing if the response time exceeds a certain value or if the error percentage rate is higher than the defined limit. After all, it makes sense to stop the test if the tested service is unresponsive. So, if possible, we recommend you include this listener to the script. 

jmeter autostop listener

Composite Graph Listener

Finally, there is one listener that can be used to consolidate all the information from other listeners configured in the script and display it on the chart. This is the CompositeGraphlistener, available through JMeter plugins. This listener is useful for finding the cause of bottlenecks or understanding the real capacity of the system under the test. For example, correlating response time charts and resource utilization charts or response time charts and throughput related charts.

composite graph listener

Please note that when running your tests in BlazeMeter, you should remove or disable the Listeners, unless you intend to generate extra log files. This is because they consume resources from the machine or engine that is running the test.

That’s it! We’ve covered all the important JMeter listeners. You can also view results, analyze KPIs, and monitor system health through BlazeMeter reports.

Testing

Published at DZone with permission of Konsantine Firsanov, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Choosing the Right Framework for Your Project
  • 11 Observability Tools You Should Know
  • Testing Level Dynamics: Achieving Confidence From Testing
  • Integrate AWS Secrets Manager in Spring Boot Application

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: