生成 JMeter 自定义饼图

huangapple go评论63阅读模式
英文:

Generate JMeter custom pie chart

问题

我正在寻找一种在运行100个测试后显示饼图/表的方法,但所有可用的内置报告似乎都会累积有关每个样本、控制器和性能指标花费的时间的数据。尽管测试主要检查性能,一些指标很有用,但我们还需要有关实际响应数据的统计信息。每个HTTP请求都会查询产品的可用性。

测试完成后,我们还希望出现一个饼图,分为3个部分:
1)可用
2)库存不足
3)不可用

现在,我找到了“保存响应到文件”监听器,但它会生成单独的文件,这并不是很好。此外,使用“查看结果树”我们可以指定响应将被转储的文件名。

我们不需要整个响应对象,最好甚至不要将任何内容写入磁盘。
然后,如何在JMeter中实际可视化这些数据呢?可以使用聚合图表吗?

因此,简而言之:当线程运行时,应该将来自JSON响应对象(使用JPath解析)的每个值都记住,然后在测试完成后,应该将这些变量分组并显示为饼图。

英文:

I'm looking for a way to display pie chart/table after running 100 tests, but all available built-in reports seem to accumulate data on time spent per sample, controller and about performance metrics.
Although tests mostly check performance and some metrics are usefull, we also need statistics on actual response data.
Each http request queries service for items availability per product.
After tests finish we also would like pie chart appear with 3 sections:

  1. Available
  2. Low on stock
  3. Unavailable

Now, I found "Save Responses to a file" listener but it generates separate files which isn't very good. Also with "View Results Tree" we can specify filename where responses will be dumped.

We don't need the whole response object and preferably not even write anything to disk.
And than, how to actually visualize that data in JMeter after tests complete? Would it be Aggregate Graph?

So to recap: while threads run, each value from json response object (parsed with JPath) should be remembered somewhere and after tests complete these variables should be grouped and displayed as a pie chart.

答案1

得分: 1

我只能考虑示例变量属性,如果您将以下行添加到user.properties文件中:

sample_variables=value1,value2,etc.

下次当您以非GUI模式运行JMeter测试时,.jtl结果文件将包含与示例变量相同数量的额外列,每个单元格将包含相应的变量值,针对每个采样器。

您可以使用Excel或类似工具来创建您的图表。或者,您可以使用后端监听器并创建一个显示您所需信息的Grafana仪表板。

英文:

I can think only of Sample Variables property, if you add the next line to user.properties file:

sample_variables=value1,value2,etc.

next time when you run JMeter test in command-line non-GUI mode the .jtl result file will contain as many extra columns as you have Sample Variables and each cell will contain respective value of the variable for each Sampler.

You will be able to use Excel or equivalent to build your charts. Alternatively you could use Backend Listener and come up with a Grafana dashboard showing what you need.

huangapple
  • 本文由 发表于 2023年2月18日 01:40:19
  • 转载请务必保留本文链接:https://go.coder-hub.com/75487590.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定