mirror of
https://github.com/Zygo/bees.git
synced 2025-07-06 02:22:27 +02:00
throttle: track time values more closely
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>
This commit is contained in:
@ -326,7 +326,7 @@ bees_throttle(const double time_used, const char *const context)
|
|||||||
++this_time_count;
|
++this_time_count;
|
||||||
// Keep the timing data fresh
|
// Keep the timing data fresh
|
||||||
static Timer s_fresh_timer;
|
static Timer s_fresh_timer;
|
||||||
if (s_fresh_timer.age() > 300) {
|
if (s_fresh_timer.age() > 60) {
|
||||||
s_fresh_timer.reset();
|
s_fresh_timer.reset();
|
||||||
this_time_count *= 0.9;
|
this_time_count *= 0.9;
|
||||||
this_time_used *= 0.9;
|
this_time_used *= 0.9;
|
||||||
|
Reference in New Issue
Block a user