]> git.hungrycats.org Git - bees/commitdiff
throttle: track time values more closely
authorZygo Blaxell <bees@furryterror.org>
Sat, 21 Dec 2024 16:25:20 +0000 (11:25 -0500)
committerZygo Blaxell <bees@furryterror.org>
Sat, 4 Jan 2025 04:14:31 +0000 (23:14 -0500)
Decaying averages by 10% every 5 minutes gives roughly a half-hour
half-life to the rolling average.  Speed that up to once per minute.

Signed-off-by: Zygo Blaxell <bees@furryterror.org>
src/bees.cc

index 6c34584f2e1cab6d5cea165ba54baf0ba46e52cd..b27d102c3b97e2385ad96531bfc133671f26c97d 100644 (file)
@@ -326,7 +326,7 @@ bees_throttle(const double time_used, const char *const context)
        ++this_time_count;
        // Keep the timing data fresh
        static Timer s_fresh_timer;
-       if (s_fresh_timer.age() > 300) {
+       if (s_fresh_timer.age() > 60) {
                s_fresh_timer.reset();
                this_time_count *= 0.9;
                this_time_used *= 0.9;