update ewma related godoc
Vladimir Bauer
3 years ago
| 21 | 21 |
return f(src)
|
| 22 | 22 |
}
|
| 23 | 23 |
|
| 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.
|
| 28 | 27 |
func EwmaETA(style TimeStyle, age float64, wcc ...WC) Decorator {
|
| 29 | 28 |
var average ewma.MovingAverage
|
| 30 | 29 |
if age == 0 {
|
| 28 | 28 |
}
|
| 29 | 29 |
|
| 30 | 30 |
// 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.
|
| 34 | 33 |
func EwmaSpeed(unit int, format string, age float64, wcc ...WC) Decorator {
|
| 35 | 34 |
var average ewma.MovingAverage
|
| 36 | 35 |
if age == 0 {
|