0
votes

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. thread group 1 with 10 users ,response time 1 m sec

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

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

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

enter image description here

Using this im plotting graph in grafana:

Bellow is what i've got: Grafana showing individual graph

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 grafanatemplating to get all samplers name 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 .

2

2 Answers

0
votes

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.

0
votes

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