benchmark: move sample flag to root command

Sample is configuration for reports. This should be
flag at top command.
This commit is contained in:
Gyu-Ho Lee 2016-03-15 10:36:27 -07:00
parent 323687e1f1
commit c9e4e2b6dc
4 changed files with 2 additions and 5 deletions

View File

@ -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) {

View File

@ -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) {

View File

@ -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")

View File

@ -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) {