JMeter - Graphite Backend listener rootmetricsPrefix taking previously generated value

1.2k views Asked by At

Background: I am using graphite to store the data generated during the performance test and ideally, we would like to look at the historical graphs as well. Hence, I am creating a rootMetricsPrefix folder name dynamically in a setup thread group and assigning it to a property. The backend listener is in a different thread group and the configuration uses this folder name as the rootMetricsPrefix -

<elementProp name="rootMetricsPrefix" elementType="Argument">
                <stringProp name="Argument.name">rootMetricsPrefix</stringProp>
                <stringProp `enter code here`name="Argument.value">${__property(graphiteFolderName)}</stringProp>
                <stringProp name="Argument.metadata">=</stringProp>
</elementProp>

Symptoms: The first time the JMeter srcript is run (after opening JMeter), no folder is generated in the Graphite DB. From the second run onwards, results are written to a folder which was defined in the previous run. For example, Run 1: DynamicResultsFolder_1 (No Results written) Run 2: DynamicResultsFolder_2 (Results written to DynamicResultsFolder_1) Run 3: DynamicResultsFolder_3 (Results written to DynamicResultsFolder_2)

When I print the folder name to the log in the main thread group, the expected folder name is printed out. The issue seems to be in the way the ${__property(graphiteFolderName)} is evaluated in the BackendListener configuration.

I have also tried assigning the the property to a local variable and using the local variable in the BackendListener config, but that does not write any results to the DB.

Any ideas as to what is going on here or if I am missing something obvious?

1

There are 1 answers

1
UBIK LOAD PACK On BEST ANSWER

This cannot work because Backend Listener parameters will be passed to components before the setUp ThreadGroup will be executed.

So what is happening is that first time, property is not configured, and it fails , then setup thread group run and fills in property for next run.

This is your issue.

Maybe you could try to generate your name using __BeanShell function in rootMetricsPrefix property.