diff options
author | Daniel Schadt <kingdread@gmx.de> | 2018-06-15 13:44:31 +0200 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2018-06-15 13:44:31 +0200 |
commit | 4ea1d4f3e5082925874a271d14cc143ebf80912f (patch) | |
tree | 3ecdbf3af95f83848677cf2c4f786d7155084610 /src/statistics/trackers.rs | |
parent | 73db5bb9edfeb48fbf497561a12f7c9f362f4457 (diff) | |
download | evtclib-4ea1d4f3e5082925874a271d14cc143ebf80912f.tar.gz evtclib-4ea1d4f3e5082925874a271d14cc143ebf80912f.tar.bz2 evtclib-4ea1d4f3e5082925874a271d14cc143ebf80912f.zip |
fix(?) boon tracking
If we throw away all empty queues before we register that they are
empty, we end up never removing some boons, getting crazy uptimes.
The current state is still not perfect, but it's much closer to what we
expect.
Diffstat (limited to 'src/statistics/trackers.rs')
-rw-r--r-- | src/statistics/trackers.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/statistics/trackers.rs b/src/statistics/trackers.rs index 5eda86c..d18e9c5 100644 --- a/src/statistics/trackers.rs +++ b/src/statistics/trackers.rs @@ -253,7 +253,9 @@ impl BoonTracker { .values_mut() .flat_map(|m| m.values_mut()) .for_each(|queue| queue.simulate(delta_t)); + } + fn cleanup_queues(&mut self) { // Throw away empty boon queues or to improve performance self.boon_queues .values_mut() @@ -262,9 +264,6 @@ impl BoonTracker { } fn update_logs(&mut self, time: u64) { - if time == self.last_time { - return; - } for (agent, boons) in &self.boon_queues { let agent_log = self .boon_logs @@ -338,8 +337,10 @@ impl Tracker for BoonTracker { _ => (), } + self.update_logs(event.time); self.last_time = event.time; + self.cleanup_queues(); Ok(()) } |