examples: ewma age 30
Vladimir Bauer
3 years ago
| 81 | 81 |
mpb.AppendDecorators(
|
| 82 | 82 |
// replace ETA decorator with "done" message, OnComplete event
|
| 83 | 83 |
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",
|
| 86 | 86 |
),
|
| 87 | 87 |
),
|
| 88 | 88 |
)
|
| 36 | 36 |
mpb.AppendDecorators(
|
| 37 | 37 |
// replace ETA decorator with "done" message, OnComplete event
|
| 38 | 38 |
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",
|
| 41 | 41 |
),
|
| 42 | 42 |
),
|
| 43 | 43 |
)
|
| 26 | 26 |
bar := p.AddBar(int64(total),
|
| 27 | 27 |
mpb.PrependDecorators(
|
| 28 | 28 |
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),
|
| 30 | 30 |
),
|
| 31 | 31 |
mpb.AppendDecorators(
|
| 32 | 32 |
// note that OnComplete will not be fired, because of cancel
|
| 33 | 33 |
mpb.AppendDecorators(
|
| 34 | 34 |
// replace ETA decorator with "done" message, OnComplete event
|
| 35 | 35 |
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",
|
| 38 | 38 |
),
|
| 39 | 39 |
),
|
| 40 | 40 |
)
|
| 24 | 24 |
decor.Counters(decor.SizeB1024(0), "% .2f / % .2f"),
|
| 25 | 25 |
),
|
| 26 | 26 |
mpb.AppendDecorators(
|
| 27 | |
decor.EwmaETA(decor.ET_STYLE_GO, 90),
|
|
27 |
decor.EwmaETA(decor.ET_STYLE_GO, 30),
|
| 28 | 28 |
decor.Name(" ] "),
|
| 29 | |
decor.EwmaSpeed(decor.SizeB1024(0), "% .2f", 60),
|
|
29 |
decor.EwmaSpeed(decor.SizeB1024(0), "% .2f", 30),
|
| 30 | 30 |
),
|
| 31 | 31 |
)
|
| 32 | 32 |
|
| 39 | 39 |
bar := p.AddBar(int64(total),
|
| 40 | 40 |
pdecorators,
|
| 41 | 41 |
mpb.AppendDecorators(
|
| 42 | |
decor.OnComplete(decor.EwmaETA(decor.ET_STYLE_GO, 60), "done"),
|
|
42 |
decor.OnComplete(decor.EwmaETA(decor.ET_STYLE_GO, 30), "done"),
|
| 43 | 43 |
),
|
| 44 | 44 |
)
|
| 45 | 45 |
// simulating some work
|
| 28 | 28 |
mpb.AppendDecorators(
|
| 29 | 29 |
// replace ETA decorator with "done" message, OnComplete event
|
| 30 | 30 |
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",
|
| 33 | 33 |
),
|
| 34 | 34 |
),
|
| 35 | 35 |
)
|
| 32 | 32 |
),
|
| 33 | 33 |
mpb.AppendDecorators(
|
| 34 | 34 |
decor.OnComplete(
|
| 35 | |
decor.EwmaETA(decor.ET_STYLE_GO, 60, decor.WCSyncWidth), "done",
|
|
35 |
decor.EwmaETA(decor.ET_STYLE_GO, 30, decor.WCSyncWidth), "done",
|
| 36 | 36 |
),
|
| 37 | 37 |
),
|
| 38 | 38 |
)
|
| 40 | 40 |
mpb.AppendDecorators(
|
| 41 | 41 |
// replace ETA decorator with "done" message, OnComplete event
|
| 42 | 42 |
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",
|
| 45 | 45 |
),
|
| 46 | 46 |
),
|
| 47 | 47 |
)
|
| 28 | 28 |
mpb.AppendDecorators(
|
| 29 | 29 |
// replace ETA decorator with "done" message, OnComplete event
|
| 30 | 30 |
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",
|
| 33 | 33 |
),
|
| 34 | 34 |
),
|
| 35 | 35 |
)
|
| 29 | 29 |
mpb.AppendDecorators(
|
| 30 | 30 |
// replace ETA decorator with "done" message, OnComplete event
|
| 31 | 31 |
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",
|
| 34 | 34 |
),
|
| 35 | 35 |
),
|
| 36 | 36 |
)
|