diff --git a/cmd/influx_stress/influx_stress.go b/cmd/influx_stress/influx_stress.go index f0b9cccbdf..b9b39d28f0 100644 --- a/cmd/influx_stress/influx_stress.go +++ b/cmd/influx_stress/influx_stress.go @@ -12,6 +12,7 @@ import ( var ( config = flag.String("config", "", "The stress test file") cpuprofile = flag.String("cpuprofile", "", "Write the cpu profile to `filename`") + db = flag.String("db", "", "name of the database where the stress test will take place") ) func main() { @@ -34,6 +35,12 @@ func main() { return } + if *db != "" { + c.Provision.Basic.Database = *db + c.Write.InfluxClients.Basic.Database = *db + c.Read.QueryClients.Basic.Database = *db + } + w := stress.NewWriter(&c.Write.PointGenerators.Basic, &c.Write.InfluxClients.Basic) r := stress.NewQuerier(&c.Read.QueryGenerators.Basic, &c.Read.QueryClients.Basic) s := stress.NewStressTest(&c.Provision.Basic, w, r) diff --git a/stress/config.go b/stress/config.go index e8702d45c0..6749986b6a 100644 --- a/stress/config.go +++ b/stress/config.go @@ -113,7 +113,7 @@ func NewOutputConfig() *outputConfig { var o outputConfig tags := make(map[string]string) o.tags = tags - database := flag.String("database", "stress", "name of database") + database := flag.String("database", "stress", "name of database where the response times will persist") address := flag.String("addr", "http://localhost:8086", "IP address and port of database where response times will persist (e.g., localhost:8086)") flag.Var(&o, "tags", "A comma seperated list of tags") flag.Parse()