[英]How can i generate a "connect time over time" graph in grafana with jmeter+influxDB+Grafana Stack?
I know that jmeter has a listener that generates such a graph like so:我知道 jmeter 有一个监听器可以生成这样的图表:
But i want this in a grafana dashboard, i am using the InfluxDbBackendListenerClient and these are my table columns in influxDB:但是我想在 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"
],
As per Metrics Exposed chapter of the Real-time results Connect Time is not something which is available as per JMeter 5.2.1根据实时结果的指标公开章节,连接时间不是根据JMeter 5.2.1可用的
You can come up with a custom implementation of the AbstractBackendListenerClient which will collect and send Connect Times.您可以想出一个AbstractBackendListenerClient的自定义实现,它将收集和发送连接时间。
Alternatively you can substitute a metric you're not interested in, for example Sent Bytes
with the Connect Time.或者,您可以替换一个您不感兴趣的指标,例如使用连接时间
Sent Bytes
。 It can be done using ie JSR223 PostProcessor and the following simple code:可以使用 ie JSR223 PostProcessor 和以下简单代码来完成:
prev.setSentBytes(prev.getConnectTime())
as you can see upon execution Sent Bytes
value becomes equal to Connect Time
value hence you can plot it in Grafana amending the chart title:正如您在执行时所看到的,
Sent Bytes
值变得等于Connect Time
值,因此您可以在 Grafana 中绘制它并修改图表标题:
Don't forget to appropriately place the JSR223 PostProcessor according to JMeter Scoping Rules so it would be applied to all the Samplers不要忘记根据JMeter 范围规则适当放置 JSR223 后处理器,以便将其应用于所有采样器
In the above example prev
stands for SampleResult class instance, see the Javadoc for all available functions/properties.在上面的示例中,
prev
代表SampleResult类实例,有关所有可用的函数/属性,请参阅 Javadoc。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.