Closed AntonioSun closed 1 year ago
two different types of inputs, to save you from typing:
datadog way:
@GrabConfig(systemClassLoader = true)
@Grab('net.simonix.scripts:groovy-jmeter')
@groovy.transform.BaseScript net.simonix.dsl.jmeter.TestScript script
start {
plan {
backend classname: 'rocks.nt.apm.jmeter.JMeterInfluxDBBackendListenerClient' {
arguments {
argument(name: 'testName', value: '${c_cfg_TestName}')
argument(name: 'nodeName', value: '${TestDesc}')
argument(name: 'runId', value: '${runId}')
argument(name: 'influxDBHost', value: 'xyz')
argument(name: 'influxDBPort', value: '8086')
argument(name: 'influxDBUser', value: 'jmeter')
argument(name: 'influxDBPassword', value: 'PW')
argument(name: 'influxDBDatabase', value: 'jmeter')
argument(name: 'retentionPolicy', value: 'autogen')
argument(name: 'samplersList', value: 'abc.*')
argument(name: 'useRegexForSamplerList', value: 'true')
argument(name: 'recordSubSamples', value: 'recordSubSamples')
}
}
view () // View Result Tree
}
}
Original way:
start {
plan {
backend(name: 'InfluxDb Backend', enabled: true) {
arguments {
argument(name: 'influxdbMetricsSender', value: 'rocks.nt.apm.jmeter.JMeterInfluxDBBackendListenerClient')
argument(name: 'testName', value: '${c_cfg_TestName}')
argument(name: 'nodeName', value: '${TestDesc}')
argument(name: 'runId', value: '${runId}')
argument(name: 'influxDBHost', value: 'xyz')
argument(name: 'influxDBPort', value: '8086')
argument(name: 'influxDBUser', value: 'jmeter')
argument(name: 'influxDBPassword', value: 'PW')
argument(name: 'influxDBDatabase', value: 'jmeter')
argument(name: 'retentionPolicy', value: 'autogen')
argument(name: 'samplersList', value: 'abc.*')
argument(name: 'useRegexForSamplerList', value: 'true')
argument(name: 'recordSubSamples', value: 'recordSubSamples')
}
}
view () // View Result Tree
}
}
Sure, I will look into this.
Hi, I think your original script had one error. It was missing comma after classname: 'rocks.nt.apm.jmeter.JMeterInfluxDBBackendListenerClient'. Below you can find the correct version.
Please, remember that when you execute the script you need to add the plugin jar to the classpath e.g.
groovy -cp JMeter-InfluxDB-Writer-plugin-1.2.jar script.groovy
Remember to add any parameters required by the script at the end of the command line.
@GrabConfig(systemClassLoader = true)
@Grab('net.simonix.scripts:groovy-jmeter')
@groovy.transform.BaseScript net.simonix.dsl.jmeter.TestScript script
start {
plan {
backend classname: 'rocks.nt.apm.jmeter.JMeterInfluxDBBackendListenerClient', {
arguments {
argument(name: 'testName', value: '${c_cfg_TestName}')
argument(name: 'nodeName', value: '${TestDesc}')
argument(name: 'runId', value: '${runId}')
argument(name: 'influxDBHost', value: 'xyz')
argument(name: 'influxDBPort', value: '8086')
argument(name: 'influxDBUser', value: 'jmeter')
argument(name: 'influxDBPassword', value: 'PW')
argument(name: 'influxDBDatabase', value: 'jmeter')
argument(name: 'retentionPolicy', value: 'autogen')
argument(name: 'samplersList', value: 'abc.*')
argument(name: 'useRegexForSamplerList', value: 'true')
argument(name: 'recordSubSamples', value: 'recordSubSamples')
}
}
view () // View Result Tree
}
}
Please, remember that when you execute the script you need to add the plugin jar to the classpath
Ah. THX! I got it working per your instructions. Thanks!
Please, remember that when you execute the script you need to add the plugin jar to the classpath
Just to be 100% clear, it is necessary when executing the script, but unnecessary when generating the .jmx
script file.
Hi @smicyk,
I'm switching to another InfluxDb Backend Listener, which is of class
rocks.nt.apm.jmeter.JMeterInfluxDBBackendListenerClient
I first try follow the https://github.com/smicyk/groovy-jmeter/blob/develop/examples/plugins/datadog/script.groovy but got:
I then try follow the https://github.com/smicyk/groovy-jmeter/blob/develop/examples/standalone/script.groovy
Generating![image](https://user-images.githubusercontent.com/2840074/206883392-2a2e6ee8-cf1b-4f49-ae31-8b0942d9e1f8.png)
.jmx
succeeded, but I got this:Would you support this new InfluxDb Backend Listener please?
The desired xml output is:
Changes need from the
org.apache.jmeter.visualizers.backend.influxdb.InfluxdbBackendListenerClient
is posted at https://www.diffchecker.com/NZbFVuXTThanks