diff --git a/cmd/influx_stress/influx_stress.go b/cmd/influx_stress/influx_stress.go index 660007125a9..bb61e53710e 100644 --- a/cmd/influx_stress/influx_stress.go +++ b/cmd/influx_stress/influx_stress.go @@ -11,23 +11,15 @@ import ( ) var ( - batchSize = flag.Int("batchsize", 5000, "number of points per batch") - seriesCount = flag.Int("series", 100000, "number of unique series to create") - pointCount = flag.Int("points", 100, "number of points per series to create") - concurrency = flag.Int("concurrency", 10, "number of simultaneous writes to run") + batchSize = flag.Int("batchsize", 0, "number of points per batch") + concurrency = flag.Int("concurrency", 0, "number of simultaneous writes to run") batchInterval = flag.Duration("batchinterval", 0*time.Second, "duration between batches") - database = flag.String("database", "stress", "name of database") - address = flag.String("addr", "localhost:8086", "IP address and port of database (e.g., localhost:8086)") - precision = flag.String("precision", "n", "The precision that points in the database will be with") + database = flag.String("database", "", "name of database") + address = flag.String("addr", "", "IP address and port of database (e.g., localhost:8086)") + precision = flag.String("precision", "", "The precision that points in the database will be with") test = flag.String("test", "", "The stress test file") ) -var ms runner.Measurements - -func init() { - flag.Var(&ms, "m", "comma-separated list of intervals to use between events") -} - func main() { var cfg *runner.Config var err error @@ -35,26 +27,45 @@ func main() { runtime.GOMAXPROCS(runtime.NumCPU()) flag.Parse() - cfg = runner.NewConfig() + if *test == "" { + fmt.Println("'-test' flag is required") + return + } - if len(ms) == 0 { - ms = append(ms, "cpu") + cfg, err = runner.DecodeFile(*test) + if err != nil { + fmt.Println(err) + return } - for _, m := range ms { - cfg.Series = append(cfg.Series, runner.NewSeries(m, 100, 100000)) + fmt.Printf("%#v\n", cfg.Write) + + if *batchSize != 0 { + cfg.Write.BatchSize = *batchSize } - if *test != "" { - cfg, err = runner.DecodeFile(*test) + if *concurrency != 0 { + cfg.Write.Concurrency = *concurrency + } - if err != nil { - fmt.Println(err) - return - } + if *batchInterval != 0*time.Second { + cfg.Write.BatchInterval = batchInterval.String() + } + + if *database != "" { + cfg.Write.Database = *database + } + if *address != "" { + cfg.Write.Address = *address } + if *precision != "" { + cfg.Write.Precision = *precision + } + + fmt.Printf("%#v\n", cfg.Write) + d := make(chan struct{}) seriesQueryResults := make(chan runner.QueryResults)