https://bz.apache.org/bugzilla/show_bug.cgi?id=64487

            Bug ID: 64487
           Summary: Backend Listener
           Product: JMeter
           Version: 5.2.1
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Main
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: JMETER_5.3.1

By default it is set to fixed which causes JMeter report statistics for last {{
backend_metrics_large_window }} (default 5000) number of samples, even though
{{ count }} is reset every 1s (default for graphite backend listener used in
this case)

This is a sequence of JMeter requests (4) gathered over 5 minutes (
(elapsed [ms], timestamp):
3249,   5/8/2020 14:27:44
2761,   5/8/2020 14:28:57
2920,   5/8/2020 14:31:25
2720,   5/8/2020 14:31:33
This gives mean elapsed [ms]= (3249+2761+2920+2720) / 4 = 2912.5

Now, what is sent via Graphite Backend listener is:
(mean, timestamp, count)
3249,   5/8/2020 14:27, 1
3005,   5/8/2020 14:29, 1
2976.7, 5/8/2020 14:31, 1
2912.5, 5/8/2020 14:31, 1

You can easily check, that each subsequent mean sent by graphite listener is:
sum(elaped so far) / sum(counts so far), i.e
3249 = 3249 / 1
3005 = (3249+2761) / 2
2976.7 ~= (3249+2761+2920) / 3
and yes, we've been already there: (3249+2761+2920+2720) / 4 = 2912.5


I have
1) backend_metrics_window_mode=fixed (default) and
2) backend_metrics_large_window = 5000 (default)

This configuration results in samples mean calculated using
backend_metrics_large_window # of last samples, 
while counter of samples will be reset each graphite listener interval (1s) –
links below:
Source code:

https://github.com/apache/jmeter/blob/master/src/components/src/main/java/org/apache/jmeter/visualizers/backend/SamplerMetric.java#L156
– do not clear descriptive statistics which holds sample times
https://github.com/apache/jmeter/blob/master/src/components/src/main/java/org/apache/jmeter/visualizers/backend/SamplerMetric.java#L168
– but clears sample count !

 This is why we see count=1 at each graphite aggregate. This way, having only
graphite listener I can't calculate mean response time over the whole test
period by summing 'mean' and dividing by sum of 'count.

I know, that using 'timed' mode will fix the problem for me, yet still I think
consequence of using default settings are surprising. I think mentioning this
caveat in documentation might safe some folks investigation time :)

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to