diff options
Diffstat (limited to 'cpp/src/qpid/broker/RateTracker.cpp')
| -rw-r--r-- | cpp/src/qpid/broker/RateTracker.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cpp/src/qpid/broker/RateTracker.cpp b/cpp/src/qpid/broker/RateTracker.cpp index 5377bcfc0b..f7bf0a8ff0 100644 --- a/cpp/src/qpid/broker/RateTracker.cpp +++ b/cpp/src/qpid/broker/RateTracker.cpp @@ -42,7 +42,10 @@ double RateTracker::sampleRatePerSecond() Duration interval(lastTime, now); lastCount = currentCount; lastTime = now; - return increment ? increment / (interval / TIME_SEC) : 0; + //if sampling at higher frequency than supported, will just return the number of increments + if (interval == 0) return increment; + else if (increment == 0) return 0; + else return increment / (interval / TIME_SEC); } }} // namespace qpid::broker |
