我如何使用jmeter + influxDB + Grafana Stack在grafana中生成“时间上的连接时间”图?

问题描述 投票:0回答:1

我知道jmeter的侦听器会生成这样的图形,如下所示:

enter image description here

但是我想在grafana仪表板中使用它,我正在使用InfluxDbBackendListenerClient,这些是我在influxDB中的表列:

"columns": [
                 "time",
                 "application",
                 "avg",
                 "count",
                 "countError",
                 "endedT",
                 "hit",
                 "max",
                 "maxAT",
                 "meanAT",
                 "min",
                 "minAT",
                 "pct90.0",
                 "pct95.0",
                 "pct99.0",
                 "rb",
                 "responseCode",
                 "responseMessage",
                 "sb",
                 "startedT",
                 "statut",
                 "transaction"
                ],
performance http jmeter grafana influxdb
1个回答
0
投票
根据Metrics ExposedReal-time results章节,[连接时间]不可用,根据JMeter 5.2.1

您可以提出AbstractBackendListenerClient的自定义实现,该实现将收集并发送连接时间。

或者,您也可以将您不感兴趣的指标(例如Sent Bytes)替换为“连接时间”。可以使用JSR223 PostProcessor和以下简单代码完成:

prev.setSentBytes(prev.getConnectTime())

enter image description here

您可以在执行时看到Sent Bytes值等于Connect Time值,因此您可以在Grafana中绘制它以修改图表标题:

enter image description here

不要忘记根据JMeter Scoping Rules适当放置JSR223后处理器,以便将其应用于所有采样器

在以上示例中,prev代表SampleResult类实例,有关所有可用功能/属性,请参见Javadoc。

© www.soinside.com 2019 - 2024. All rights reserved.