summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid/broker')
-rw-r--r--cpp/src/qpid/broker/RateTracker.cpp5
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