JMeter - Graphite Backend listener rootmetricsPrefix taking previously generated value

和自甴很熟 提交于 2019-12-10 19:17:31

问题


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:


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.



来源:https://stackoverflow.com/questions/30981881/jmeter-graphite-backend-listener-rootmetricsprefix-taking-previously-generated

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!