diff options
Diffstat (limited to 'src/models')
-rw-r--r-- | src/models/counter.cpp | 4 | ||||
-rw-r--r-- | src/models/counter.hpp | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/models/counter.cpp b/src/models/counter.cpp index 4855c24..1b6315d 100644 --- a/src/models/counter.cpp +++ b/src/models/counter.cpp @@ -16,11 +16,11 @@ double FreqCounter::overtime_rate() const { } std::string FreqCounter::display_value() const { - if(_cnt == UINT32_MAX) { + if(_overtime_cnt == UINT32_MAX) { return "ERR"; } - return std::to_string(_cnt); + return std::to_string(_overtime_cnt); } void FreqCounter::inc() { diff --git a/src/models/counter.hpp b/src/models/counter.hpp index d1b68fc..fa9e1c5 100644 --- a/src/models/counter.hpp +++ b/src/models/counter.hpp @@ -18,6 +18,8 @@ class FreqCounter { uint32_t cnt() const { return _cnt; } + uint32_t overtime_cnt() const { return _overtime_cnt; } + [[nodiscard]] double rate() const; [[nodiscard]] double overtime_rate() const; |