Codebase list golang-github-vbauerster-mpb / a5ef683
minor: refactoring ewmaUpdate to decoratorEwmaUpdate Vladimir Bauer 3 years ago
1 changed file(s) with 3 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
246246 select {
247247 case b.operateState <- func(s *bState) {
248248 if n := current - s.current; n > 0 {
249 s.ewmaUpdate(n, iterDur)
249 s.decoratorEwmaUpdate(n, iterDur)
250250 }
251251 s.current = current
252252 if s.triggerComplete && s.current >= s.total {
305305 }
306306 select {
307307 case b.operateState <- func(s *bState) {
308 s.ewmaUpdate(n, iterDur)
308 s.decoratorEwmaUpdate(n, iterDur)
309309 s.current += n
310310 if s.triggerComplete && s.current >= s.total {
311311 s.current = s.total
587587 return table
588588 }
589589
590 func (s bState) ewmaUpdate(n int64, dur time.Duration) {
590 func (s bState) decoratorEwmaUpdate(n int64, dur time.Duration) {
591591 var wg sync.WaitGroup
592592 for i := 0; i < len(s.ewmaDecorators); i++ {
593593 switch d := s.ewmaDecorators[i]; i {