jmeter-backend-listener-kafka
A JMeter plug-in that enables you to send test results to a Kafka server.
Overview
Description
JMeter Backend Listener Kafka is a JMeter plugin enabling you to send test results to a Kafka server. It is meant as an alternative live-monitoring tool to the built-in "InfluxDB" backend listener of JMeter. It is inspired from JMeter ElasticSearch backend listener plug-in.
Features
- Filters
- Only send the samples you want, by using Filters! Simply type them as follows in the appropriate field:
filter1;filter2;filter3
orsampleLabel_must_contain_this
.
- Only send the samples you want, by using Filters! Simply type them as follows in the appropriate field:
- Specific fields
field1;field2;field3
- Specify fields that you want to send to Kafka (possible fields below):
- AllThreads
- BodySize
- Bytes
- SentBytes
- ConnectTime
- ContentType
- DataType
- ErrorCount
- GrpThreads
- IdleTime
- Latency
- ResponseTime
- SampleCount
- SampleLabel
- ThreadName
- URL
- ResponseCode
- TestStartTime
- SampleStartTime
- SampleEndTime
- Timestamp
- InjectorHostname
- Specify fields that you want to send to Kafka (possible fields below):
- Verbose, semi-verbose, error only, and quiet mode:
- debug : Send request/response information of all samplers (headers, body, etc.)
- info : Sends all samplers to the Kafka server, but only sends the headers, body info for the failed samplers.
- quiet : Only sends the response time, bytes, and other metrics
- error : Only sends the failing samplers to the Kafka server (Along with their headers and body information).
- Use Logstash or any other tool to consume data from Kafka topic and then ingest it into a Database of your liking.
Maven
<dependency>
<groupId>io.github.rahulsinghai</groupId>
<artifactId>jmeter.backendlistener.kafka</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
Packaging and testing your newly added code
Execute below mvn command. Make sure JAVA_HOME is set properly
mvn package
Move the resulting JAR to your JMETER_HOME/lib/ext
.
Screenshots
Configuration
Sample Grafana dashboard
Sample Grafana dashboard
For more info
For more information, here's a little documentation.
Contributing
Feel free to contribute by branching and making pull requests, or simply by suggesting ideas through the "Issues" tab.
Code Styling
Please find instructions here on how to configure your IntelliJ or Eclipse to format the source code according to Google style.
Once configured in IntelliJ, format code as normal with Ctrl + Alt + L
.
Further Changes
Adding the XML file alone and auto-formatting the whole document could replace imports with wildcard imports, which isn't always what we want.
- To stop this from happening, Go to
File
→Settings
→Editor
→Code Style
→Java
and select theImports
tab. - Set
Class Count to use import with '*'
andNames count to us static import with '*'
to a higher value; anything over999
should be fine.
You can now reformat code throughout your project without imports being changed to Wildcard imports.