From a3b69f906690fd170082d0fe9fde4041ac646722 Mon Sep 17 00:00:00 2001 From: jaffee Date: Mon, 28 Nov 2016 11:30:27 -0700 Subject: [PATCH] rename bench commands and args lower case and dash separated --- bench/diagonal.go | 24 +++++++++--------- bench/multidb.go | 22 ++++++++-------- bench/random.go | 38 ++++++++++++++-------------- bench/randquery.go | 40 +++++++++++++++--------------- cmd/pilosactl/main.go | 16 ++++++------ cmd/pilosactl/multidbspawn.json | 2 +- cmd/pilosactl/randSetAndQuery.json | 4 +-- cmd/pilosactl/randspawn.json | 2 +- cmd/pilosactl/spawn.json | 2 +- 9 files changed, 75 insertions(+), 75 deletions(-) diff --git a/bench/diagonal.go b/bench/diagonal.go index 22e6b5cb9..fc0084e67 100644 --- a/bench/diagonal.go +++ b/bench/diagonal.go @@ -21,25 +21,25 @@ type DiagonalSetBits struct { func (b *DiagonalSetBits) Usage() string { return ` -DiagonalSetBits sets bits with increasing profile id and bitmap id. +diagonal-set-bits sets bits with increasing profile id and bitmap id. -Usage: DiagonalSetBits [arguments] +Usage: diagonal-set-bits [arguments] The following arguments are available: - -BaseBitmapID int + -base-bitmap-id int bits being set will all be greater than BaseBitmapID - -BaseProfileID int + -base-profile-id int profile id num to start from - -Iterations int + -iterations int number of bits to set - -DB string + -db string pilosa db to use - -ClientType string + -client-type string Can be 'single' (all agents hitting one host) or 'round_robin' `[1:] @@ -48,11 +48,11 @@ The following arguments are available: func (b *DiagonalSetBits) ConsumeFlags(args []string) ([]string, error) { fs := flag.NewFlagSet("DiagonalSetBits", flag.ContinueOnError) fs.SetOutput(ioutil.Discard) - fs.IntVar(&b.BaseBitmapID, "BaseBitmapID", 0, "") - fs.IntVar(&b.BaseProfileID, "BaseProfileID", 0, "") - fs.IntVar(&b.Iterations, "Iterations", 100, "") - fs.StringVar(&b.DB, "DB", "benchdb", "") - fs.StringVar(&b.ClientType, "ClientType", "single", "") + fs.IntVar(&b.BaseBitmapID, "base-bitmap-id", 0, "") + fs.IntVar(&b.BaseProfileID, "base-profile-id", 0, "") + fs.IntVar(&b.Iterations, "iterations", 100, "") + fs.StringVar(&b.DB, "db", "benchdb", "") + fs.StringVar(&b.ClientType, "client-type", "single", "") if err := fs.Parse(args); err != nil { return nil, err diff --git a/bench/multidb.go b/bench/multidb.go index 20bc81aab..2a76ca3f9 100644 --- a/bench/multidb.go +++ b/bench/multidb.go @@ -19,22 +19,22 @@ type MultiDBSetBits struct { func (b *MultiDBSetBits) Usage() string { return ` -MultiDBSetBits sets bits with increasing profile id and bitmap id using a different DB for each agent. +multi-db-set-bits sets bits with increasing profile id and bitmap id using a different DB for each agent. -Usage: MultiDBSetBits [arguments] +Usage: multi-db-set-bits [arguments] The following arguments are available: - -BaseBitmapID int - bits being set will all be greater than BaseBitmapID + -base-bitmap-id int + bits being set will all be greater than base-bitmap-id - -BaseProfileID int + -base-profile-id int profile id num to start from - -Iterations int + -iterations int number of bits to set - -ClientType string + -client-type string Can be 'single' (all agents hitting one host) or 'round_robin' `[1:] @@ -43,10 +43,10 @@ The following arguments are available: func (b *MultiDBSetBits) ConsumeFlags(args []string) ([]string, error) { fs := flag.NewFlagSet("MultiDBSetBits", flag.ContinueOnError) fs.SetOutput(ioutil.Discard) - fs.IntVar(&b.BaseBitmapID, "BaseBitmapID", 0, "") - fs.IntVar(&b.BaseProfileID, "BaseProfileID", 0, "") - fs.IntVar(&b.Iterations, "Iterations", 100, "") - fs.StringVar(&b.ClientType, "ClientType", "single", "") + fs.IntVar(&b.BaseBitmapID, "base-bitmap-id", 0, "") + fs.IntVar(&b.BaseProfileID, "base-profile-id", 0, "") + fs.IntVar(&b.Iterations, "iterations", 100, "") + fs.StringVar(&b.ClientType, "client-type", "single", "") if err := fs.Parse(args); err != nil { return nil, err diff --git a/bench/random.go b/bench/random.go index 7c6795408..86d1c2969 100644 --- a/bench/random.go +++ b/bench/random.go @@ -26,34 +26,34 @@ type RandomSetBits struct { func (b *RandomSetBits) Usage() string { return ` -RandomSetBits sets random bits +random-set-bits sets random bits -Usage: RandomSetBits [arguments] +Usage: random-set-bits [arguments] The following arguments are available: - -BaseBitmapID int - bitmap id to start from + -base-bitmap-id int + bits being set will all be greater than BaseBitmapID - -BitmapIDRange int + -bitmap-id-range int number of possible bitmap ids that can be set - -BaseProfileID int + -base-profile-id int profile id num to start from - -ProfileIDRange int + -profile-id-range int number of possible profile ids that can be set - -Iterations int + -iterations int number of bits to set - -Seed int + -seed int Seed for RNG - -DB string + -db string pilosa db to use - -ClientType string + -client-type string Can be 'single' (all agents hitting one host) or 'round_robin' `[1:] } @@ -61,14 +61,14 @@ The following arguments are available: func (b *RandomSetBits) ConsumeFlags(args []string) ([]string, error) { fs := flag.NewFlagSet("RandomSetBits", flag.ContinueOnError) fs.SetOutput(ioutil.Discard) - fs.Int64Var(&b.BaseBitmapID, "BaseBitmapID", 0, "") - fs.Int64Var(&b.BitmapIDRange, "BitmapIDRange", 100000, "") - fs.Int64Var(&b.BaseProfileID, "BaseProfileID", 0, "") - fs.Int64Var(&b.ProfileIDRange, "ProfileIDRange", 100000, "") - fs.Int64Var(&b.Seed, "Seed", 1, "") - fs.IntVar(&b.Iterations, "Iterations", 100, "") - fs.StringVar(&b.DB, "DB", "benchdb", "") - fs.StringVar(&b.ClientType, "ClientType", "single", "") + fs.Int64Var(&b.BaseBitmapID, "base-bitmap-id", 0, "") + fs.Int64Var(&b.BitmapIDRange, "bitmap-id-range", 100000, "") + fs.Int64Var(&b.BaseProfileID, "base-profile-id", 0, "") + fs.Int64Var(&b.ProfileIDRange, "profile-id-range", 100000, "") + fs.Int64Var(&b.Seed, "seed", 1, "") + fs.IntVar(&b.Iterations, "iterations", 100, "") + fs.StringVar(&b.DB, "db", "benchdb", "") + fs.StringVar(&b.ClientType, "client-type", "single", "") if err := fs.Parse(args); err != nil { return nil, err diff --git a/bench/randquery.go b/bench/randquery.go index ce5571997..a926f48fd 100644 --- a/bench/randquery.go +++ b/bench/randquery.go @@ -25,37 +25,37 @@ type RandomQuery struct { func (b *RandomQuery) Usage() string { return ` -RandomQuery constructs random queries +random-query constructs random queries -Usage: RandomQuery [arguments] +Usage: random-query [arguments] The following arguments are available: - -MaxDepth int + -max-depth int Maximum nesting depth of queries - -MaxArgs int + -max-args int Maximum number of args for Union/Intersect/Difference Queries - -MaxN int + -max-n int Maximum N value for TopN queries. - -BaseBitmapID int + -base-bitmap-id int bitmap id to start from - -BitmapIDRange int + -bitmap-id-range int number of possible bitmap ids that can be set - -Iterations int + -iterations int number of bits to set - -Seed int + -seed int Seed for RNG - -DBs string + -dbs string Comma separated list of DBs to query against - -ClientType string + -client-type string Can be 'single' (all agents hitting one host) or 'round_robin' `[1:] } @@ -63,16 +63,16 @@ The following arguments are available: func (b *RandomQuery) ConsumeFlags(args []string) ([]string, error) { fs := flag.NewFlagSet("RandomQuery", flag.ContinueOnError) fs.SetOutput(ioutil.Discard) - fs.IntVar(&b.MaxDepth, "MaxDepth", 4, "") - fs.IntVar(&b.MaxArgs, "MaxArgs", 4, "") - fs.IntVar(&b.MaxN, "MaxN", 4, "") - fs.Int64Var(&b.BaseBitmapID, "BaseBitmapID", 0, "") - fs.Int64Var(&b.BitmapIDRange, "BitmapIDRange", 100000, "") - fs.Int64Var(&b.Seed, "Seed", 1, "") - fs.IntVar(&b.Iterations, "Iterations", 100, "") + fs.IntVar(&b.MaxDepth, "max-depth", 4, "") + fs.IntVar(&b.MaxArgs, "max-args", 4, "") + fs.IntVar(&b.MaxN, "max-n", 4, "") + fs.Int64Var(&b.BaseBitmapID, "base-bitmap-id", 0, "") + fs.Int64Var(&b.BitmapIDRange, "bitmap-id-range", 100000, "") + fs.Int64Var(&b.Seed, "seed", 1, "") + fs.IntVar(&b.Iterations, "iterations", 100, "") var dbs string - fs.StringVar(&dbs, "DBs", "benchdb", "") - fs.StringVar(&b.ClientType, "ClientType", "single", "") + fs.StringVar(&dbs, "dbs", "benchdb", "") + fs.StringVar(&b.ClientType, "client-type", "single", "") if err := fs.Parse(args); err != nil { return nil, err diff --git a/cmd/pilosactl/main.go b/cmd/pilosactl/main.go index 4ab54eb1c..cfe0213a1 100644 --- a/cmd/pilosactl/main.go +++ b/cmd/pilosactl/main.go @@ -1329,13 +1329,13 @@ func (cmd *BagentCommand) ParseFlags(args []string) error { switch remArgs[0] { case "-help", "-h": return flag.ErrHelp - case "DiagonalSetBits": + case "diagonal-set-bits": bm = &bench.DiagonalSetBits{} - case "RandomSetBits": + case "random-set-bits": bm = &bench.RandomSetBits{} - case "MultiDBSetBits": + case "multi-db-set-bits": bm = &bench.MultiDBSetBits{} - case "RandomQuery": + case "random-query": bm = &bench.RandomQuery{} default: return fmt.Errorf("Unknown benchmark cmd: %v", remArgs[0]) @@ -1373,10 +1373,10 @@ The following arguments are available: An integer differentiating this agent from others in the fleet. subcommands: - DiagonalSetBits - RandomSetBits - MultiDBSetBits - RandomQuery + diagonal-set-bits + random-set-bits + multi-db-set-bits + random-query diff --git a/cmd/pilosactl/multidbspawn.json b/cmd/pilosactl/multidbspawn.json index a22db6fbd..627c6af94 100644 --- a/cmd/pilosactl/multidbspawn.json +++ b/cmd/pilosactl/multidbspawn.json @@ -4,7 +4,7 @@ "Benchmarks": [ { "Num": 3, - "Args": ["MultiDBSetBits", "-Iterations", "30000", "-ClientType", "round_robin"] + "Args": ["multi-db-set-bits", "-iterations", "30000", "-client-type", "round_robin"] } ] } diff --git a/cmd/pilosactl/randSetAndQuery.json b/cmd/pilosactl/randSetAndQuery.json index 091d2a2c9..714f3d035 100644 --- a/cmd/pilosactl/randSetAndQuery.json +++ b/cmd/pilosactl/randSetAndQuery.json @@ -5,8 +5,8 @@ { "Num": 3, "Args": [ - "RandomSetBits", "-Iterations", "30000", "-ProfileIDRange", "1000000", "-BitmapIDRange", "1000000", "-Seed", "2345", "-ClientType", "round_robin", "-DB", "randsetandquery", - "RandomQuery", "-Iterations", "1000", "-BitmapIDRange", "1000000", "-Seed", "1239", "-DBs", "randsetandquery" + "random-set-bits", "-iterations", "30000", "-profile-id-range", "1000000", "-bitmap-id-range", "1000000", "-seed", "2345", "-client-type", "round_robin", "-db", "randsetandquery", + "random-query", "-iterations", "1000", "-bitmap-id-range", "1000000", "-seed", "1239", "-dbs", "randsetandquery" ] } ] diff --git a/cmd/pilosactl/randspawn.json b/cmd/pilosactl/randspawn.json index 91a6d5866..4c3d52b59 100644 --- a/cmd/pilosactl/randspawn.json +++ b/cmd/pilosactl/randspawn.json @@ -4,7 +4,7 @@ "Benchmarks": [ { "Num": 3, - "Args": ["RandomSetBits", "-Iterations", "30000", "-ProfileIDRange", "1000000", "-BitmapIDRange", "1000000", "-Seed", "2345", "-ClientType", "round_robin"] + "Args": ["random-set-bits", "-iterations", "30000", "-profile-id-range", "1000000", "-bitmap-id-range", "1000000", "-seed", "2345", "-client-type", "round_robin"] } ] } diff --git a/cmd/pilosactl/spawn.json b/cmd/pilosactl/spawn.json index 35743c0b3..b3daa8a58 100644 --- a/cmd/pilosactl/spawn.json +++ b/cmd/pilosactl/spawn.json @@ -4,7 +4,7 @@ "Benchmarks": [ { "Num": 3, - "Args": ["DiagonalSetBits", "-Iterations", "30000", "-ClientType", "round_robin"] + "Args": ["diagonal-set-bits", "-iterations", "30000", "-client-type", "round_robin"] } ] }