Skip to content

Moving averages for reports using cycle-time / percent_of  #4

@leopd

Description

@leopd

Currently the averages in the report are counted from the beginning of the program, without exception. This can be a problem if you're watching a process whose behavior is changing. Instead, the report could calculate the average over recent data only, and thus reflect changes in behavior much more quickly by only summarizing recent behavior.

Two common ways to do this would be an exponential moving average (EMA) algorithm, or a sliding window (SW). EMA is computationally simple, and thus would be my choice, but it's harder to explain and understand. SW literally just averages over the last N events instead of back to the beginning of the program. SW is much easier to understand, but requires a lot more computational overhead. SW also has some undesirable "ringing" properties in how it responds to periodically changing behavior whereas EMA does a better job of averaging those out.

The simplest (for the user) thing I can think of would be to switch to EMA after some number of cycles. Default to 100 say, but configurable like timebugdet.ema_after = 10 if you want to see behavior changes reflected more quickly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions