JMeter-Graphite Backend侦听器rootmetrics使用先前生成的值的前缀 [英] JMeter - Graphite Backend listener rootmetricsPrefix taking previously generated value

查看:479
本文介绍了JMeter-Graphite Backend侦听器rootmetrics使用先前生成的值的前缀的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

背景: 我正在使用石墨来存储性能测试期间生成的数据,理想情况下,我们还要查看历史图表.因此,我将在安装线程组中动态创建rootMetricsPrefix文件夹名称,并将其分配给属性.后端侦听器位于不同的线程组中,并且配置使用此文件夹名称作为rootMetricsPrefix-

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>

症状: 第一次运行JMeter脚本(打开JMeter后),在Graphite DB中没有生成文件夹.从第二次运行开始,结果将写入上一次运行中定义的文件夹.例如, 运行1:DynamicResultsFolder_1(未写入结果) 运行2:DynamicResultsFolder_2(将结果写入DynamicResultsFolder_1) 运行3:DynamicResultsFolder_3(将结果写入DynamicResultsFolder_2)

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)

当我将文件夹名称打印到主线程组中的日志时,将打印出所需的文件夹名称.问题似乎在于在BackendListener配置中评估$ {__ property(graphiteFolderName)}的方式.

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.

我还尝试将属性分配给局部变量,并在BackendListener配置中使用局部变量,但这不会将任何结果写入数据库.

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?

推荐答案

这不能正常工作,因为后端侦听器参数将在 setUp ThreadGroup 传递给组件之前被执行.

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.

这是您的问题.

也许您可以尝试使用rootMetricsPrefix属性中的 __BeanShell 函数生成名称

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

这篇关于JMeter-Graphite Backend侦听器rootmetrics使用先前生成的值的前缀的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆