ewma age 60
Vladimir Bauer
8 years ago
| 46 | 46 | decor.Name(name, decor.WC{W: len(name) + 1, C: decor.DidentRight}), |
| 47 | 47 | // replace ETA decorator with "done" message, OnComplete event |
| 48 | 48 | decor.OnComplete( |
| 49 | // ETA decorator with default eta age, and width reservation of 4 | |
| 50 | decor.ETA(decor.ET_STYLE_GO, 0, sbEta, decor.WC{W: 4}), "done", | |
| 49 | // ETA decorator with ewma age of 60, and width reservation of 4 | |
| 50 | decor.ETA(decor.ET_STYLE_GO, 60, sbEta, decor.WC{W: 4}), "done", | |
| 51 | 51 | ), |
| 52 | 52 | ), |
| 53 | 53 | mpb.AppendDecorators(decor.Percentage()), |
| 54 | 54 | ) |
| 55 | ||
| 56 | 55 | // simulating some work |
| 57 | 56 | max := 100 * time.Millisecond |
| 58 | 57 | for i := 0; i < total; i++ { |
| 78 | 77 | sbEta := make(chan time.Time) |
| 79 | 78 | bar := p.AddBar(int64(total), |
| 80 | 79 | mpb.PrependDecorators( |
| 81 | // display our name with one space on the right | |
| 82 | decor.Name(name, decor.WC{W: len(name) + 1, C: decor.DidentRight}), | |
| 83 | // decor.DSyncWidth bit enables same column width synchronization | |
| 84 | decor.Percentage(decor.WCSyncWidth), | |
| 80 | // simple name decorator | |
| 81 | decor.Name(name), | |
| 82 | // decor.DSyncWidth bit enables column width synchronization | |
| 83 | decor.Percentage(decor.WCSyncSpace), | |
| 85 | 84 | ), |
| 86 | 85 | mpb.AppendDecorators( |
| 87 | 86 | // replace ETA decorator with "done" message, OnComplete event |
| 88 | 87 | decor.OnComplete( |
| 89 | // ETA decorator with default eta age, and width reservation of 3 | |
| 90 | decor.ETA(decor.ET_STYLE_GO, 0, sbEta, decor.WC{W: 3}), "done", | |
| 88 | // ETA decorator with ewma age of 60 | |
| 89 | decor.ETA(decor.ET_STYLE_GO, 60, sbEta), "done", | |
| 91 | 90 | ), |
| 92 | 91 | ), |
| 93 | 92 | ) |
| 30 | 30 | decor.Name(name, decor.WC{W: len(name) + 1, C: decor.DidentRight}), |
| 31 | 31 | // replace ETA decorator with "done" message, OnComplete event |
| 32 | 32 | decor.OnComplete( |
| 33 | // ETA decorator with default eta age, and width reservation of 4 | |
| 34 | decor.ETA(decor.ET_STYLE_GO, 0, sbEta, decor.WC{W: 4}), "done", | |
| 33 | // ETA decorator with ewma age of 60, and width reservation of 4 | |
| 34 | decor.ETA(decor.ET_STYLE_GO, 60, sbEta, decor.WC{W: 4}), "done", | |
| 35 | 35 | ), |
| 36 | 36 | ), |
| 37 | 37 | mpb.AppendDecorators(decor.Percentage()), |
| 38 | 38 | ) |
| 39 | ||
| 40 | 39 | // simulating some work |
| 41 | 40 | max := 100 * time.Millisecond |
| 42 | 41 | for i := 0; i < total; i++ { |
| 24 | 24 | sbEta := make(chan time.Time) |
| 25 | 25 | bar := p.AddBar(int64(total), |
| 26 | 26 | mpb.PrependDecorators( |
| 27 | // display our name with one space on the right | |
| 28 | decor.Name(name, decor.WC{W: len(name) + 1, C: decor.DidentRight}), | |
| 29 | // decor.DSyncWidth bit enables same column width synchronization | |
| 30 | decor.Percentage(decor.WCSyncWidth), | |
| 27 | // simple name decorator | |
| 28 | decor.Name(name), | |
| 29 | // decor.DSyncWidth bit enables column width synchronization | |
| 30 | decor.Percentage(decor.WCSyncSpace), | |
| 31 | 31 | ), |
| 32 | 32 | mpb.AppendDecorators( |
| 33 | 33 | // replace ETA decorator with "done" message, OnComplete event |
| 34 | 34 | decor.OnComplete( |
| 35 | // ETA decorator with default eta age, and width reservation of 3 | |
| 36 | decor.ETA(decor.ET_STYLE_GO, 0, sbEta, decor.WC{W: 3}), "done", | |
| 35 | // ETA decorator with ewma age of 60 | |
| 36 | decor.ETA(decor.ET_STYLE_GO, 60, sbEta), "done", | |
| 37 | 37 | ), |
| 38 | 38 | ), |
| 39 | 39 | ) |
| 27 | 27 | decor.Name(name, decor.WC{W: len(name) + 1, C: decor.DidentRight}), |
| 28 | 28 | // replace ETA decorator with "done" message, OnComplete event |
| 29 | 29 | decor.OnComplete( |
| 30 | // ETA decorator with default eta age, and width reservation of 4 | |
| 31 | decor.ETA(decor.ET_STYLE_GO, 0, sbEta, decor.WC{W: 4}), "done", | |
| 30 | // ETA decorator with ewma age of 60, and width reservation of 4 | |
| 31 | decor.ETA(decor.ET_STYLE_GO, 60, sbEta, decor.WC{W: 4}), "done", | |
| 32 | 32 | ), |
| 33 | 33 | ), |
| 34 | 34 | mpb.AppendDecorators(decor.Percentage()), |
| 35 | 35 | ) |
| 36 | ||
| 37 | 36 | // simulating some work |
| 38 | 37 | max := 100 * time.Millisecond |
| 39 | 38 | for i := 0; i < total; i++ { |