Skip to content
Snippets Groups Projects

exponentially decay message frequency in live_info

Merged Jorn Hoofwijk requested to merge limit_message_queue into master
All threads resolved!
Compare and Show latest version
1 file
+ 2
2
Compare changes
  • Side-by-side
  • Inline
@@ -155,9 +155,9 @@ def live_info(runner, *, update_interval=0.5):
# we decide to only add messages to it when a certain probability.
# i.e. we're offline for 12h, with an update_interval of 0.5s,
# and without the reduced probability, we have buffer_size=86400.
# With the correction this is np.log(86400) / np.log(1.5) = 28.03
# With the correction this is np.log(86400) / np.log(1.1) = 119.2
should_update = 1.5**buffer_size * random.random() < 1
should_update = 1.1**buffer_size * random.random() < 1
if should_update:
status.value = _info_html(runner)
else:
Loading