mirror of
https://github.com/ceph/ceph
synced 2025-03-31 07:53:23 +00:00
common/DecayCounter: add delta to value for ::get
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>
This commit is contained in:
parent
5f49379afb
commit
b2f53b85c3
@ -73,7 +73,7 @@ public:
|
||||
|
||||
double get(utime_t now, const DecayRate& rate) {
|
||||
decay(now, rate);
|
||||
return val;
|
||||
return val+delta;
|
||||
}
|
||||
|
||||
double get_last() {
|
||||
|
Loading…
Reference in New Issue
Block a user