Codebase list golang-github-vbauerster-mpb / 5a70128
return simple ewma if age is 0.0 Vladimir Bauer 6 years ago
1 changed file(s) with 7 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
2626 // work duration as second argument, in order for this decorator to
2727 // work correctly. This decorator is a wrapper of MovingAverageETA.
2828 func EwmaETA(style TimeStyle, age float64, wcc ...WC) Decorator {
29 return MovingAverageETA(style, ewma.NewMovingAverage(age), nil, wcc...)
29 var average MovingAverage
30 if age == 0.0 {
31 average = ewma.NewMovingAverage()
32 } else {
33 average = ewma.NewMovingAverage(age)
34 }
35 return MovingAverageETA(style, average, nil, wcc...)
3036 }
3137
3238 // MovingAverageETA decorator relies on MovingAverage implementation to calculate its average.