This resolves a bug where getting the DecayCounter value before one second has
elapsed will result in 0 always being returned. This is because ::hit will add
to the delta, not the value. The delta is added to the value only in the decay
function which only processes changes after 1 second has elapsed since the last
decay.
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
double get(utime_t now, const DecayRate& rate) {
decay(now, rate);
- return val;
+ return val+delta;
}
double get_last() {