Closed cvonelm closed 1 year ago
I don't want to be that picky, but the commit message could need some touches still. But keep that aside for a moment.
What I'm wondering is this:
diff_enabled
and diff_running
might be switcheddiff_enabled is always smaller than diff_running
diff_running
is not smaller than diff_enabled
I don't understand it.
Another thing, does the situation occur that diff_running
is zero, but neither diff_enabled
nor diff_value
is?
The current implementation would result in infinity. The current patch would change that to zero. What should be the desired outcome? Why don't we handle the case that diff_running
is zero in the first if condition? Hence the outcome would be diff_value
.
There is forgotten knowledge passed down from the ancients of the SVN galaxy that there might have been a perf bug.
A bug for which there is zero information of it ever existing, neither in kernel changelogs, Robert and Thomas' knowledge and even the ancient scriptures of the lo2s SVN repository. During trial runs of lo2s, it also did not occur.
What should be the desired outcome?
Zero, I think. I don't see a case where a metric that was running 0% of the time during that sample interval should produce something else than diff_value
of 0 occurences.
Is anything blocking this? I kinda need it :/
someone should have a final look at the explanatory comment I have included in counter_buffer.hpp to make sure that it doesn't contain obvious bullshit.
Other than that I think we can ship it.
A code path could lead to a NaN if diff_running is 0 as this would result in a division-by-zero.
This commit solves this problem by just deleting that code path, as there is no evidence that the bug it addresses has existed in recent times, if ever.
This fixes #267