Backend Listener
- Dominant language
- Java
- Stars
- 9.5k
- Forks
- 2.3k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 5
Description
**Eligiusz Ziółkowski** ([Bug 64487](https://bz.apache.org/bugzilla//show_bug.cgi?id=64487&redirect=false)):
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 :)
Severity: normal
OS: All
Contributor guide
Assessment
This issue has not been assessed yet.