File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -33,13 +33,18 @@ func (f TimeNormalizerFunc) Normalize(src time.Duration) time.Duration {
33
33
// decorator to work correctly you have to measure each iteration's duration
34
34
// and pass it to one of the (*Bar).EwmaIncr... family methods.
35
35
func EwmaETA (style TimeStyle , age float64 , wcc ... WC ) Decorator {
36
+ return EwmaNormalizedETA (style , age , nil , wcc ... )
37
+ }
38
+
39
+ // EwmaNormalizedETA same as EwmaETA but with TimeNormalizer option.
40
+ func EwmaNormalizedETA (style TimeStyle , age float64 , normalizer TimeNormalizer , wcc ... WC ) Decorator {
36
41
var average ewma.MovingAverage
37
42
if age == 0 {
38
43
average = ewma .NewMovingAverage ()
39
44
} else {
40
45
average = ewma .NewMovingAverage (age )
41
46
}
42
- return MovingAverageETA (style , NewThreadSafeMovingAverage (average ), nil , wcc ... )
47
+ return MovingAverageETA (style , NewThreadSafeMovingAverage (average ), normalizer , wcc ... )
43
48
}
44
49
45
50
// MovingAverageETA decorator relies on MovingAverage implementation to calculate its average.
You can’t perform that action at this time.
0 commit comments