Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sumstats: Allow changing epoch #348

Open
jmellander opened this issue May 2, 2019 · 0 comments

Comments

Projects
None yet
2 participants
@jmellander
Copy link

commented May 2, 2019

I've found it convenient to use an undocumented feature of Sumstats: changing the epoch. This comes particularly handy when creating statistics for human consumption, as oftentimes it is useful to synchronize to a logging interval. For example, if hourly stats are desired, it is useful to have a shorter epoch for the original sumstats to align with an hour, then to have subsequent sumstats trigger on the hour.

To allow use scripts to schedule the end of the epoch:

  • Mark epoch as &optional.
  • Expose and document SumStats::finish_epoch as part of the public API
  • Make the minor changes to not schedule SumStats::finish_epoch if epoch is undefined.

By not defining epoch a script would indicate that it will manage epoch timing. The script would schedule the first epoch based on the logging interval, and in the epoch_finished function schedule each successive epoch to stay in sync with the logging interval.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.