소스 검색

benchmark: move sample flag to root command

Sample is configuration for reports. This should be
flag at top command.
Gyu-Ho Lee 9 년 전
부모
커밋
c9e4e2b6dc
4개의 변경된 파일2개의 추가작업 그리고 5개의 파일을 삭제
  1. 0 3
      tools/benchmark/cmd/put.go
  2. 0 1
      tools/benchmark/cmd/range.go
  3. 2 0
      tools/benchmark/cmd/root.go
  4. 0 1
      tools/benchmark/cmd/watch.go

+ 0 - 3
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) {

+ 0 - 1
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) {

+ 2 - 0
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")

+ 0 - 1
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) {