Codebase list golang-github-vbauerster-mpb / ee647b7
update ewma related godoc Vladimir Bauer 3 years ago
2 changed file(s) with 5 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
2121 return f(src)
2222 }
2323
24 // EwmaETA exponential-weighted-moving-average based ETA decorator.
25 // For this decorator to work correctly you have to measure each
26 // iteration's duration and pass it to the
27 // *Bar.DecoratorEwmaUpdate(time.Duration) method after each increment.
24 // EwmaETA exponential-weighted-moving-average based ETA decorator. For this
25 // decorator to work correctly you have to measure each iteration's duration
26 // and pass it to one of the (*Bar).EwmaIncr... family methods.
2827 func EwmaETA(style TimeStyle, age float64, wcc ...WC) Decorator {
2928 var average ewma.MovingAverage
3029 if age == 0 {
2828 }
2929
3030 // EwmaSpeed exponential-weighted-moving-average based speed decorator.
31 // For this decorator to work correctly you have to measure each
32 // iteration's duration and pass it to the
33 // *Bar.DecoratorEwmaUpdate(time.Duration) method after each increment.
31 // For this decorator to work correctly you have to measure each iteration's
32 // duration and pass it to one of the (*Bar).EwmaIncr... family methods.
3433 func EwmaSpeed(unit int, format string, age float64, wcc ...WC) Decorator {
3534 var average ewma.MovingAverage
3635 if age == 0 {