summaryrefslogtreecommitdiff
path: root/src/lib/event_history.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-12-31 22:50:41 +0100
committerCarl Hetherington <cth@carlh.net>2025-12-31 22:50:41 +0100
commit34746766f79e5304ef4fa948e7e1d8a06bf8b816 (patch)
tree6c9ac1c408c4a166f086a84efd198dba304ad392 /src/lib/event_history.h
parentf51e9c758a39932625a52ebecc9e3c6f8b807cfd (diff)
Add events count to EventHistory.
Diffstat (limited to 'src/lib/event_history.h')
-rw-r--r--src/lib/event_history.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/event_history.h b/src/lib/event_history.h
index 63329fa0e..5dd84cbbf 100644
--- a/src/lib/event_history.h
+++ b/src/lib/event_history.h
@@ -35,14 +35,16 @@ public:
boost::optional<float> rate() const;
void event();
+ int events() const;
private:
- /** Mutex for _history */
+ /** Mutex for _history and _events */
mutable boost::mutex _mutex;
/** List of the times of the last _history_size events
first is the most recently completed.
*/
std::list<struct timeval> _history;
+ int _events = 0;
/** Number of events that we should keep history for */
int const _size;
};