-
Notifications
You must be signed in to change notification settings - Fork 130
Open
Description
I looked at the dyn total example and don't quite understand it.
This is what I tried:
p := mpb.New(mpb.WithWidth(64))
success := p.AddBar(
0,
mpb.PrependDecorators(
decor.Name("Success", decor.WC{C: decor.DSyncWidth}),
),
mpb.AppendDecorators(
decor.CountersNoUnit("%d / %d", decor.WCSyncWidth),
),
)
success.SetTotal(0, true)
max := 100 * time.Millisecond
for i := 0; i < total; i++ {
time.Sleep(time.Duration(rand.Intn(10)+1) * max / 10)
ok := rand.Int63n(100)
ko := rand.Int63n(100)
success.SetCurrent(ok)
success.SetTotal(ok+ko, false)
}
p.Wait()
I want to see the percentage or ratio of ok vs ko.
But it just shows
Success [--------------------------------------------------------------] 0 / 0
Metadata
Metadata
Assignees
Labels
No labels