Class InfluxDbBackendListener
- java.lang.Object
-
- us.abstracta.jmeter.javadsl.core.testelements.BaseTestElement
-
- us.abstracta.jmeter.javadsl.core.listeners.BaseListener
-
- us.abstracta.jmeter.javadsl.core.listeners.DslBackendListener<InfluxDbBackendListener>
-
- us.abstracta.jmeter.javadsl.core.listeners.InfluxDbBackendListener
-
- All Implemented Interfaces:
DslTestElement,DslTestPlan.TestPlanChild,DslListener,BaseSampler.SamplerChild,MultiLevelTestElement,BaseThreadGroup.ThreadGroupChild
public class InfluxDbBackendListener extends DslBackendListener<InfluxDbBackendListener>
Test element which publishes all test run metrics to an InfluxDB instance.- Since:
- 0.4
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classInfluxDbBackendListener.CodeBuilder-
Nested classes/interfaces inherited from class us.abstracta.jmeter.javadsl.core.listeners.DslBackendListener
DslBackendListener.BackendListenerCodeBuilder
-
-
Field Summary
Fields Modifier and Type Field Description protected StringapplicationNameprotected Stringmeasurementprotected Stringpercentilesprotected StringsamplersRegexprotected Map<String,String>tagsprotected Stringtitleprotected Stringtoken-
Fields inherited from class us.abstracta.jmeter.javadsl.core.listeners.DslBackendListener
listenerClass, queueSize, url
-
Fields inherited from class us.abstracta.jmeter.javadsl.core.testelements.BaseTestElement
guiClass, name
-
-
Constructor Summary
Constructors Constructor Description InfluxDbBackendListener(String url)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InfluxDbBackendListenerapplication(String applicationName)Allows specifying an application name tag to be included with collected metrics.protected org.apache.jmeter.config.ArgumentsbuildListenerArguments()InfluxDbBackendListenermeasurement(String measurement)Allows specifying the name of the measurement that contains collected metrics sent to InfluxDB.InfluxDbBackendListenerpercentiles(float... percentiles)Allows specifying a list of percentiles that will be calculated and sent to InfluxDb.InfluxDbBackendListenersamplersRegex(String samplersRegex)Allows specifying a regular expression used to filter collected metrics.InfluxDbBackendListenertag(String name, String value)Allows adding tags to be included with every measurement sent to InfluxDB.InfluxDbBackendListenertitle(String title)Allows setting a title for the test which will be included in started and ended annotations in "events" measurement.InfluxDbBackendListenertoken(String token)Allows specifying a token for authentication with InfluxDB 2 instances.-
Methods inherited from class us.abstracta.jmeter.javadsl.core.listeners.DslBackendListener
buildTestElement, queueSize
-
Methods inherited from class us.abstracta.jmeter.javadsl.core.testelements.BaseTestElement
buildConfiguredTestElement, buildTestElementGui, buildTreeUnder, configureTestElement, durationToSeconds, loadBeanProperties, showAndWaitFrameWith, showFrameWith, showInGui, showTestElementGui
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface us.abstracta.jmeter.javadsl.core.DslTestElement
buildTreeUnder, showInGui
-
-
-
-
Constructor Detail
-
InfluxDbBackendListener
public InfluxDbBackendListener(String url)
-
-
Method Detail
-
token
public InfluxDbBackendListener token(String token)
Allows specifying a token for authentication with InfluxDB 2 instances.Check InfluxDB documentation for more details.
- Parameters:
token- to use to authenticate to InfluxDB- Returns:
- the listener for further configuration or usage.
-
title
public InfluxDbBackendListener title(String title)
Allows setting a title for the test which will be included in started and ended annotations in "events" measurement.Consider setting this value to something that properly describes your application and the particular test run (some timestamp, some CI/CD build ID, some commit ID, etc.).
When not specified, this will default to "jmeter-java-dsl" plus the current timestamp.
- Parameters:
title- to be included in started and ended annotations.- Returns:
- the listener for further configuration or usage.
-
application
public InfluxDbBackendListener application(String applicationName)
Allows specifying an application name tag to be included with collected metrics.This name can later be used to identify tests generated by this application on a given measurement, from other applications.
- Parameters:
applicationName- specifies the name of the application tag.- Returns:
- the listener for further configuration or usage.
- Since:
- 0.38
-
measurement
public InfluxDbBackendListener measurement(String measurement)
Allows specifying the name of the measurement that contains collected metrics sent to InfluxDB.- Parameters:
measurement- specifies the name of the measurement.- Returns:
- the listener for further configuration or usage.
- Since:
- 0.38
-
samplersRegex
public InfluxDbBackendListener samplersRegex(String samplersRegex)
Allows specifying a regular expression used to filter collected metrics.This regular expression is applied to sample labels, and when matched, collected sample metrics will be sent to InfluxDB. Otherwise, they will be ignored.
For example ^[^_].*" - will exclude samplers which labels start with symbol "_".
- Parameters:
samplersRegex- specifies the name of the samplersRegex.- Returns:
- the listener for further configuration or usage.
- Since:
- 0.38
-
tag
public InfluxDbBackendListener tag(String name, String value)
Allows adding tags to be included with every measurement sent to InfluxDB.- Parameters:
name- specifies the name of the tag. Take into consideration that, in contrast to JMeter GUI, noTAG_
prefix should be included.value- specifies the value of the tag.- Returns:
- the listener for further configuration or usage.
-
percentiles
public InfluxDbBackendListener percentiles(float... percentiles)
Allows specifying a list of percentiles that will be calculated and sent to InfluxDb.- Parameters:
percentiles- specifies a list of percentiles as float values.- Returns:
- the listener for further configuration or usage.
- Since:
- 1.24
-
buildListenerArguments
protected org.apache.jmeter.config.Arguments buildListenerArguments()
- Specified by:
buildListenerArgumentsin classDslBackendListener<InfluxDbBackendListener>
-
-