From c9e4e2b6dc656ad4a4ff90f36276eb54581f02f5 Mon Sep 17 00:00:00 2001 From: Gyu-Ho Lee Date: Tue, 15 Mar 2016 10:36:27 -0700 Subject: [PATCH] benchmark: move sample flag to root command Sample is configuration for reports. This should be flag at top command. --- tools/benchmark/cmd/put.go | 3 --- tools/benchmark/cmd/range.go | 1 - tools/benchmark/cmd/root.go | 2 ++ tools/benchmark/cmd/watch.go | 1 - 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/tools/benchmark/cmd/put.go b/tools/benchmark/cmd/put.go index bd7443fee..e1b1b7748 100644 --- a/tools/benchmark/cmd/put.go +++ b/tools/benchmark/cmd/put.go @@ -46,8 +46,6 @@ var ( compactInterval time.Duration compactIndexDelta int64 - - sample bool ) func init() { @@ -59,7 +57,6 @@ func init() { putCmd.Flags().BoolVar(&seqKeys, "sequential-keys", false, "Use sequential keys") putCmd.Flags().DurationVar(&compactInterval, "compact-interval", 0, `Interval to compact database (do not duplicate this with etcd's 'auto-compaction-retention' flag) (e.g. --compact-interval=5m compacts every 5-minute)`) putCmd.Flags().Int64Var(&compactIndexDelta, "compact-index-delta", 1000, "Delta between current revision and compact revision (e.g. current revision 10000, compact at 9000)") - putCmd.Flags().BoolVar(&sample, "sample", false, "'true' to sample requests for every second") } func putFunc(cmd *cobra.Command, args []string) { diff --git a/tools/benchmark/cmd/range.go b/tools/benchmark/cmd/range.go index 17fffed32..822a6d051 100644 --- a/tools/benchmark/cmd/range.go +++ b/tools/benchmark/cmd/range.go @@ -42,7 +42,6 @@ func init() { RootCmd.AddCommand(rangeCmd) rangeCmd.Flags().IntVar(&rangeTotal, "total", 10000, "Total number of range requests") rangeCmd.Flags().StringVar(&rangeConsistency, "consistency", "l", "Linearizable(l) or Serializable(s)") - rangeCmd.Flags().BoolVar(&sample, "sample", false, "'true' to sample requests for every second") } func rangeFunc(cmd *cobra.Command, args []string) { diff --git a/tools/benchmark/cmd/root.go b/tools/benchmark/cmd/root.go index e3cf936e6..ad843d630 100644 --- a/tools/benchmark/cmd/root.go +++ b/tools/benchmark/cmd/root.go @@ -36,6 +36,7 @@ var ( endpoints []string totalConns uint totalClients uint + sample bool bar *pb.ProgressBar results chan result @@ -52,6 +53,7 @@ func init() { RootCmd.PersistentFlags().UintVar(&totalConns, "conns", 1, "Total number of gRPC connections") RootCmd.PersistentFlags().UintVar(&totalClients, "clients", 1, "Total number of gRPC clients") + RootCmd.PersistentFlags().BoolVar(&sample, "sample", false, "'true' to sample requests for every second") RootCmd.PersistentFlags().StringVar(&tls.CertFile, "cert", "", "identify HTTPS client using this SSL certificate file") RootCmd.PersistentFlags().StringVar(&tls.KeyFile, "key", "", "identify HTTPS client using this SSL key file") RootCmd.PersistentFlags().StringVar(&tls.CAFile, "cacert", "", "verify certificates of HTTPS-enabled servers using this CA bundle") diff --git a/tools/benchmark/cmd/watch.go b/tools/benchmark/cmd/watch.go index 66d3eb3a9..227e06e17 100644 --- a/tools/benchmark/cmd/watch.go +++ b/tools/benchmark/cmd/watch.go @@ -80,7 +80,6 @@ func init() { watchCmd.Flags().IntVar(&watchKeySize, "key-size", 32, "Key size of watch request") watchCmd.Flags().IntVar(&watchKeySpaceSize, "key-space-size", 1, "Maximum possible keys") watchCmd.Flags().BoolVar(&watchSeqKeys, "sequential-keys", false, "Use sequential keys") - watchCmd.Flags().BoolVar(&sample, "sample", false, "'true' to sample requests for every second") } func watchFunc(cmd *cobra.Command, args []string) {