diff --git a/cmd/influx_stress/influx_stress.go b/cmd/influx_stress/influx_stress.go index f0b9cccbdf..1185dbee30 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", "", "target database within test system for write and query load") ) 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/basic.go b/stress/basic.go index b8dc32682f..ad82f1292c 100644 --- a/stress/basic.go +++ b/stress/basic.go @@ -662,7 +662,7 @@ func (o *outputConfig) HTTPHandler(method string) func(r <-chan response, rt *Ti tags := o.tags tags["method"] = method fields := map[string]interface{}{ - "response_time": p.Timer.Elapsed(), + "response_time": float64(p.Timer.Elapsed()), } pt, _ := client.NewPoint("performance", tags, fields, p.Time) bp.AddPoint(pt) 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()