Codebase list golang-github-vbauerster-mpb / a72089f
examples: ewma age 30 Vladimir Bauer 3 years ago
11 changed file(s) with 19 addition(s) and 19 deletion(s). Raw diff Collapse all Expand all
8181 mpb.AppendDecorators(
8282 // replace ETA decorator with "done" message, OnComplete event
8383 decor.OnComplete(
84 // ETA decorator with ewma age of 60
85 decor.EwmaETA(decor.ET_STYLE_GO, 60, decor.WCSyncWidth), "done",
84 // ETA decorator with ewma age of 30
85 decor.EwmaETA(decor.ET_STYLE_GO, 30, decor.WCSyncWidth), "done",
8686 ),
8787 ),
8888 )
3636 mpb.AppendDecorators(
3737 // replace ETA decorator with "done" message, OnComplete event
3838 decor.OnComplete(
39 // ETA decorator with ewma age of 60
40 decor.EwmaETA(decor.ET_STYLE_GO, 60), "done",
39 // ETA decorator with ewma age of 30
40 decor.EwmaETA(decor.ET_STYLE_GO, 30), "done",
4141 ),
4242 ),
4343 )
2626 bar := p.AddBar(int64(total),
2727 mpb.PrependDecorators(
2828 decor.Name(name, decor.WCSyncWidthR),
29 decor.EwmaETA(decor.ET_STYLE_GO, 60, decor.WCSyncWidth),
29 decor.EwmaETA(decor.ET_STYLE_GO, 30, decor.WCSyncWidth),
3030 ),
3131 mpb.AppendDecorators(
3232 // note that OnComplete will not be fired, because of cancel
3333 mpb.AppendDecorators(
3434 // replace ETA decorator with "done" message, OnComplete event
3535 decor.OnComplete(
36 // ETA decorator with ewma age of 60
37 decor.EwmaETA(decor.ET_STYLE_GO, 60), "done",
36 // ETA decorator with ewma age of 30
37 decor.EwmaETA(decor.ET_STYLE_GO, 30), "done",
3838 ),
3939 ),
4040 )
2424 decor.Counters(decor.SizeB1024(0), "% .2f / % .2f"),
2525 ),
2626 mpb.AppendDecorators(
27 decor.EwmaETA(decor.ET_STYLE_GO, 90),
27 decor.EwmaETA(decor.ET_STYLE_GO, 30),
2828 decor.Name(" ] "),
29 decor.EwmaSpeed(decor.SizeB1024(0), "% .2f", 60),
29 decor.EwmaSpeed(decor.SizeB1024(0), "% .2f", 30),
3030 ),
3131 )
3232
3939 bar := p.AddBar(int64(total),
4040 pdecorators,
4141 mpb.AppendDecorators(
42 decor.OnComplete(decor.EwmaETA(decor.ET_STYLE_GO, 60), "done"),
42 decor.OnComplete(decor.EwmaETA(decor.ET_STYLE_GO, 30), "done"),
4343 ),
4444 )
4545 // simulating some work
2828 mpb.AppendDecorators(
2929 // replace ETA decorator with "done" message, OnComplete event
3030 decor.OnComplete(
31 // ETA decorator with ewma age of 60
32 decor.EwmaETA(decor.ET_STYLE_GO, 60, decor.WCSyncWidth), "done",
31 // ETA decorator with ewma age of 30
32 decor.EwmaETA(decor.ET_STYLE_GO, 30, decor.WCSyncWidth), "done",
3333 ),
3434 ),
3535 )
3232 ),
3333 mpb.AppendDecorators(
3434 decor.OnComplete(
35 decor.EwmaETA(decor.ET_STYLE_GO, 60, decor.WCSyncWidth), "done",
35 decor.EwmaETA(decor.ET_STYLE_GO, 30, decor.WCSyncWidth), "done",
3636 ),
3737 ),
3838 )
4040 mpb.AppendDecorators(
4141 // replace ETA decorator with "done" message, OnComplete event
4242 decor.OnComplete(
43 // ETA decorator with ewma age of 60
44 decor.EwmaETA(decor.ET_STYLE_GO, 60), "done",
43 // ETA decorator with ewma age of 30
44 decor.EwmaETA(decor.ET_STYLE_GO, 30), "done",
4545 ),
4646 ),
4747 )
2828 mpb.AppendDecorators(
2929 // replace ETA decorator with "done" message, OnComplete event
3030 decor.OnComplete(
31 // ETA decorator with ewma age of 60
32 decor.EwmaETA(decor.ET_STYLE_GO, 60), "done",
31 // ETA decorator with ewma age of 30
32 decor.EwmaETA(decor.ET_STYLE_GO, 30), "done",
3333 ),
3434 ),
3535 )
2929 mpb.AppendDecorators(
3030 // replace ETA decorator with "done" message, OnComplete event
3131 decor.OnComplete(
32 // ETA decorator with ewma age of 60
33 decor.EwmaETA(decor.ET_STYLE_GO, 60), "done",
32 // ETA decorator with ewma age of 30
33 decor.EwmaETA(decor.ET_STYLE_GO, 30), "done",
3434 ),
3535 ),
3636 )