Open
Description
When the terminal screensize is small and the number of progress bars are more the progress bars rendering fails
func Example_multiple() {
// create bars
//first := pb.New(200).Prefix("App1 Deployment Status := Pending")
//second := pb.New(200).Prefix("App1 Deployment Status := Pending ")
//third := pb.New(200).Prefix("App1 Deployment Status := Pending ")
numberOfBars := 100
var pbs []*pb.ProgressBar
for i:=1 ;i<=numberOfBars ; i++ {
bar := pb.New(100).Prefix(fmt.Sprintf("App%d Deployment Status := Pending",i))
pbs = append(pbs,bar)
}
// start pool
//pool, err := pb.StartPool(first, second, third)
pool, err := pb.StartPool(pbs...)
if err != nil {
panic(err)
}
// update bars
wg := new(sync.WaitGroup)
for i:=0 ;i<numberOfBars ; i++ {
wg.Add(1)
go func(cb *pb.ProgressBar,appName string) {
for n := 0; n < int(cb.Total); n++ {
cb.Increment()
time.Sleep(time.Millisecond * time.Duration(rand.Intn(100)))
cb.Prefix(fmt.Sprintf("%s Deployment Status := Inprogress",appName))
}
cb.Finish()
wg.Done()
}(pbs[i],fmt.Sprintf("App%d",i+1))
}
wg.Wait()
// close pool
pool.Stop()
}
Metadata
Metadata
Assignees
Labels
No labels