hidserv-stats: removeNoise function tends to undercount
Things here are probably wrong
while working on #23126 I found out that that removeNoise function did not work as intended.
The function is supposed to take a number to the right side of the bin and then subtract half of the bin. For a binsize of 8 (the default) this means that the function should have a maximum effect of -3 or +3 to a number. However, I found that this is not the case and that the function tended to go as deep as -7.
Here are examples of bad invocations:
- For reported number 138 we went to: 132 (binsize 8)
- For reported number 43 we went to: 36 (binsize 8)
- For reported number -5 we went to: -12 (binsize 8)
I attempted to fix the code in https://github.com/torproject/metrics-web/pull/2 .
Here are examples of fixed invocations:
- For reported number 138 we went to: 140 (right side of bin 144) (remainder 2) (binsize 8)
- For reported number 43 we went to: 44 (right side of bin 48) (remainder 3) (binsize 8)
- For reported number -5 we went to: -4 (right side of bin 0) (remainder 5) (binsize 8)
This should influence the metrics graphs.
Looking forward to see the results!
(cc @karsten )