Merge pull request #5239 from influxdb/md-add-db
Add flag to specify db and clarify flag descriptionspull/5253/head
commit
bf1673f466
|
@ -12,6 +12,7 @@ import (
|
||||||
var (
|
var (
|
||||||
config = flag.String("config", "", "The stress test file")
|
config = flag.String("config", "", "The stress test file")
|
||||||
cpuprofile = flag.String("cpuprofile", "", "Write the cpu profile to `filename`")
|
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() {
|
func main() {
|
||||||
|
@ -34,6 +35,12 @@ func main() {
|
||||||
return
|
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)
|
w := stress.NewWriter(&c.Write.PointGenerators.Basic, &c.Write.InfluxClients.Basic)
|
||||||
r := stress.NewQuerier(&c.Read.QueryGenerators.Basic, &c.Read.QueryClients.Basic)
|
r := stress.NewQuerier(&c.Read.QueryGenerators.Basic, &c.Read.QueryClients.Basic)
|
||||||
s := stress.NewStressTest(&c.Provision.Basic, w, r)
|
s := stress.NewStressTest(&c.Provision.Basic, w, r)
|
||||||
|
|
|
@ -662,7 +662,7 @@ func (o *outputConfig) HTTPHandler(method string) func(r <-chan response, rt *Ti
|
||||||
tags := o.tags
|
tags := o.tags
|
||||||
tags["method"] = method
|
tags["method"] = method
|
||||||
fields := map[string]interface{}{
|
fields := map[string]interface{}{
|
||||||
"response_time": p.Timer.Elapsed(),
|
"response_time": float64(p.Timer.Elapsed()),
|
||||||
}
|
}
|
||||||
pt, _ := client.NewPoint("performance", tags, fields, p.Time)
|
pt, _ := client.NewPoint("performance", tags, fields, p.Time)
|
||||||
bp.AddPoint(pt)
|
bp.AddPoint(pt)
|
||||||
|
|
|
@ -113,7 +113,7 @@ func NewOutputConfig() *outputConfig {
|
||||||
var o outputConfig
|
var o outputConfig
|
||||||
tags := make(map[string]string)
|
tags := make(map[string]string)
|
||||||
o.tags = tags
|
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)")
|
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.Var(&o, "tags", "A comma seperated list of tags")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
Loading…
Reference in New Issue