Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions etcdctl/ctlv3/command/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ var (
checkDatascalePrefix string
autoCompact bool
autoDefrag bool
verbose bool
)

type checkPerfCfg struct {
Expand Down Expand Up @@ -130,6 +131,7 @@ func NewCheckPerfCommand() *cobra.Command {
cmd.Flags().StringVar(&checkPerfPrefix, "prefix", "/etcdctl-check-perf/", "The prefix for writing the performance check's keys.")
cmd.Flags().BoolVar(&autoCompact, "auto-compact", false, "Compact storage with last revision after test is finished.")
cmd.Flags().BoolVar(&autoDefrag, "auto-defrag", false, "Defragment storage after test is finished.")
cmd.Flags().BoolVarP(&verbose, "verbose", "v", false, "Print detailed performance report.")
cmd.RegisterFlagCompletionFunc("load", func(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) {
return []string{"small", "medium", "large", "xLarge"}, cobra.ShellCompDirectiveDefault
})
Expand Down Expand Up @@ -216,10 +218,12 @@ func newCheckPerfCommand(cmd *cobra.Command, args []string) {
}()

sc := r.Stats()
rc := r.Run()
wg.Wait()
close(r.Results())

s := <-sc
rp := <-rc

attemptCleanup(clients[0], autoCompact)

Expand All @@ -229,6 +233,10 @@ func newCheckPerfCommand(cmd *cobra.Command, args []string) {
}
}

if verbose {
fmt.Print(rp)
}

ok = true
if len(s.ErrorDist) != 0 {
fmt.Println("FAIL: too many errors")
Expand Down