Enable/Disable sending of Metrics by properties in InfluxdbBackendListenerClient and InfluxDBRawBackendListenerClient #6476
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Introduce
listenerIsEnabled
to InfluxdbBackendListenerClient and InfluxDBRawBackendListenerClient.By this it is possible to enable/disable the sending of Metrics by properties (like in the Dynatrace/MINT Backend Listener)
Motivation and Context
When running the same testplan in different environments, I can not always rely on the accessibility to my InfluxDB. (Here I get the log file spammed by errors that are preventable.)
With this, I can configure i.e. by properties or groovy code, if i can send metrics to my InfluxDB:
${__P(InfluxdbBackendListener.enabled, true)}
${__groovy(org.apache.commons.lang3.SystemUtils.IS_OS_LINUX)}
The idea is copied from the MintBackendListener.
By default the listener is always enabled and must be disabled explicitly.
How Has This Been Tested?
Locally tested the InfluxdbBackendListenerClient with
enabled=true
Log message "InfluxdbBackendListenerClient will send metrics: true"
and sending of metrics
enabled=false
Log message "InfluxdbBackendListenerClient will send metrics: false"
and NO sending of metrics
enabled=faaaaaalse
Log message "InfluxdbBackendListenerClient will send metrics: false"
and NO sending of metrics
Types of changes
Checklist: