Graph for individual sampler throughput in grafana using jmeter and influx db

旧时模样 提交于 2019-12-12 01:38:07

问题


Im trying to graph throughput of individual samplers i have in jmeter ,in grafana using influx db.

Bellow is my jmeter test with 3 thread group having dummy sampler.

1.

2.

3.

According to how jmeter calculates throughput ,

throughput for very first second should be 10 and after 10 seconds throughput should be 2 ,similarly after 20 sec throughput should be 5.

I've attached influx db Screenshot bellow

Using this im plotting graph in grafana:

Bellow is what i've got:

However in graph as you can see throughput for all showing at a particular time. That should not be the case.

I've refered the template given in :http://www.testautomationguru.com/jmeter-real-time-results-influxdb-grafana/ 6

For your better understanding Used templating to get all samplers name in grafana And i've asked the same question here

I don't think this is working fine for throughput calculation .

Can somebody help me in this. Any other way to achieve my requirement.

Or I'm going wrong(in finding throughput)

IS THERE ANY WAY TO UPDATE JAR FILE OR ADD NEW JAR FILE TO ADD TABLE RELATED TO THROUGHPUT(IN THE SAME WAY AS WE GET IN JMETER)

Or Can anyone tell me how we get delta and samples and total table .


回答1:


Do you use the modified apache_core.jar? If yes, you do not need to use Backend Listener. Because, modified jar itself posts the data to influxdb assuming you have updated all the influxdb details in the property file.

For your question and test setup, as you calculate the throughput for each sample, the above grafana throughput looks correct. To understand this better, run this test for longer duration - say at least 10 mins.

ThreadGroup 1: within 1 second, 10 requests were made by 10 users. So the throughput shows 10.

Similarly for all other threadgroups, based on the requests sent to the server / unit time (in your case it is 30 seconds) - the throughput is calculated.

Lets consider this example:

Lets say, at 1:00:01 you send a request and next request is sent at 1:00:05 - JMeter will simply say it is 2 requests / 4 seconds (jmeter gives aggregate number). But grafana will show the results per time interval

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

So my point is both JMeter and the above graph you have are correct. It depends on how we look at the data.

Update 2:

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

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




回答2:


I use the following for throughput

<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)

with the following in grafana for e.g.

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


来源:https://stackoverflow.com/questions/39867108/graph-for-individual-sampler-throughput-in-grafana-using-jmeter-and-influx-db

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!