首页 文章

使用jmeter和流入db的grafana中单个采样器吞吐量的图表

提问于
浏览
0

我尝试使用流入db来绘制我在jmeter中使用的个体采样器的吞吐量 .

贝娄是我的jmeter测试,3线程组有虚拟采样器 .

thread group 1 with 10 users ,response time 1 m sec

thread group 2 with 2 users having response time 10000 mil seconds

thread group 3 with 5 users having response time 20000 m sec

根据jmeter如何计算吞吐量,

第一秒的吞吐量应为10秒,10秒后的吞吐量应为2,同样在20秒后,吞吐量应为5 .

我附上了潮流db截图

enter image description here

在grafana中使用这个im绘图图:

贝娄是我所拥有的:
Grafana showing individual graph

但是在图表中,您可以看到在特定时间显示的吞吐量 . 情况应该不是这样 .

我已经提到了以下模板:http://www.testautomationguru.com/jmeter-real-time-results-influxdb-grafana/ 6

为了更好地理解使用模板以获取所有采样器名称在grafana
templating to get all samplers name
我问了同样的问题here

我不认为这对吞吐量计算工作正常 .

有人可以帮助我 . 任何其他方式来实现我的要求 .

或者我错了(寻找吞吐量)

是否有任何方式更新JAR文件或添加新的JAR文件以添加与通过相关的表格(以我们在JMETER中获得的方式)

或者任何人都可以告诉我如何获得delta和样本以及总表 .

2 回答

  • 0

    你使用修改过的apache_core.jar吗?如果是,则不需要使用Backend Listener . 因为修改后的jar本身会将数据发布到Influxdb,假设您已更新属性文件中的所有Influxdb详细信息 .

    对于您的问题和测试设置,当您计算每个样本的吞吐量时,上面的grafana吞吐量看起来是正确的 . 要更好地理解这一点,请运行此测试更长的时间 - 比如说至少10分钟 .

    ThreadGroup 1:在1秒内,10个用户发出了10个请求 . 吞吐量显示为10 .

    类似地,对于所有其他线程组,基于发送到服务器/单元时间的请求(在您的情况下为30秒) - 计算吞吐量 .

    让我们考虑这个例子:

    让我们说,在1:00:01您发送请求,下一个请求在1:00:05发送 - JMeter将简单地说它是2个请求/ 4秒(jmeter给出总数) . 但grafana将显示每个时间间隔的结果

    1 sec interval:

    throughout 1 at 1:00:01
    throughput 0 at 1:00:02
    throughput 0 at 1:00:03
    throughput 0 at 1:00:04
    throughput 1 at 1:00:05
    

    5 sec interval:

    throughput 2 at 1:00:01 - 1:00:05
     throughput 0 at 1:00:05 - 1:00:10
    

    所以我的观点是JMeter和上面的图表都是正确的 . 这取决于我们如何看待数据 .

    Update 2:

    long org.apache.jmeter.samplers.SampleResult.getTimeStamp()

    Get the sample timestamp, which may be either the start time or the end time.

  • 0

    我使用以下吞吐量

    <rootMetricsPrefix><samplerName>.h.count
    Server hits per seconds, this metric cumulates Sample Result and Sub results (if using Transaction Controller, "Generate parent sampler" should be unchecked)
    

    在grafana中使用以下内容:

    select value from "jmeter.all.h.count"  WHERE $timeFilter
    

相关问题