Codebase list golang-github-vbauerster-mpb / 291e5b4
ewma age 60 Vladimir Bauer 8 years ago
4 changed file(s) with 18 addition(s) and 21 deletion(s). Raw diff Collapse all Expand all
4646 decor.Name(name, decor.WC{W: len(name) + 1, C: decor.DidentRight}),
4747 // replace ETA decorator with "done" message, OnComplete event
4848 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",
5151 ),
5252 ),
5353 mpb.AppendDecorators(decor.Percentage()),
5454 )
55
5655 // simulating some work
5756 max := 100 * time.Millisecond
5857 for i := 0; i < total; i++ {
7877 sbEta := make(chan time.Time)
7978 bar := p.AddBar(int64(total),
8079 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),
8584 ),
8685 mpb.AppendDecorators(
8786 // replace ETA decorator with "done" message, OnComplete event
8887 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",
9190 ),
9291 ),
9392 )
3030 decor.Name(name, decor.WC{W: len(name) + 1, C: decor.DidentRight}),
3131 // replace ETA decorator with "done" message, OnComplete event
3232 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",
3535 ),
3636 ),
3737 mpb.AppendDecorators(decor.Percentage()),
3838 )
39
4039 // simulating some work
4140 max := 100 * time.Millisecond
4241 for i := 0; i < total; i++ {
2424 sbEta := make(chan time.Time)
2525 bar := p.AddBar(int64(total),
2626 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),
3131 ),
3232 mpb.AppendDecorators(
3333 // replace ETA decorator with "done" message, OnComplete event
3434 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",
3737 ),
3838 ),
3939 )
2727 decor.Name(name, decor.WC{W: len(name) + 1, C: decor.DidentRight}),
2828 // replace ETA decorator with "done" message, OnComplete event
2929 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",
3232 ),
3333 ),
3434 mpb.AppendDecorators(decor.Percentage()),
3535 )
36
3736 // simulating some work
3837 max := 100 * time.Millisecond
3938 for i := 0; i < total; i++ {