简体   繁体   English

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

[英]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.

相关问题 如何找到并隔离 jmeter 脚本随时间增加 memory 消耗的原因? - How can I find and isolate the cause for a jmeter script's increased memory consumption over time? Grafana中针对JMeter日志的ElasticSearch查询 - ElasticSearch Queries in Grafana for JMeter Logs 随着时间的推移,Jmeter 主动威胁 - Jmeter Active Threats Over Time 我如何在jmeter中使用户登录会话保持固定时间 - How i can Keep user login session alive for fixed time in jmeter 如何在JMeter中组合HTTP请求以获得总响应时间 - How can I combine HTTP requests in JMeter to get a total response time 我应该如何计算 Jmeter 的加速时间 - How should I calculate Ramp-up time in Jmeter Jmeter负载测试网站在一段时间/所需的持续时间 - Jmeter Load testing website over a period of time/required duration 如何在 grafana 数据源中获取更新 IP 的通知? - How to get notification for updated IP in grafana datasource? 每次需要从Jmeter生成编码的请求 - Need generate encoded request every time from Jmeter 我们如何通过Apache Jmeter测量服务器处理时间,页面加载时间,页面渲染时间和页面大小 - How can we measure the Server Processing Time,Page Loading Time,Page Rendering Time and Page Size from Apache Jmeter
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM