Skip to content

Commit

Permalink
etcdctl/check: create progress bar for datascale
Browse files Browse the repository at this point in the history
Create a progress bar. The bar will show progress for a given workload.

Fixes etcd-io#9328
  • Loading branch information
spzala committed May 8, 2018
1 parent b91ed54 commit 8ba41d5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions etcdctl/ctlv3/command/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,18 @@ func newCheckDatascaleCommand(cmd *cobra.Command, args []string) {
}

fmt.Println(fmt.Sprintf("Start data scale check for work load [%v key-value pairs, %v bytes per key-value, %v concurrent clients].", cfg.limit, cfg.kvSize, cfg.clients))
bar := pb.New(cfg.limit)
bar.Format("Bom !")
bar.Start()

for i := range clients {
go func(c *v3.Client) {
defer wg.Done()
for op := range requests {
st := time.Now()
_, derr := c.Do(context.Background(), op)
r.Results() <- report.Result{Err: derr, Start: st, End: time.Now()}
bar.Increment()
}
}(clients[i])
}
Expand All @@ -358,6 +363,7 @@ func newCheckDatascaleCommand(cmd *cobra.Command, args []string) {
sc := r.Stats()
wg.Wait()
close(r.Results())
bar.Finish()
s := <-sc

// get the process_resident_memory_bytes after the put operations
Expand Down

0 comments on commit 8ba41d5

Please sign in to comment.