Add optional precision setting
parent
551e51a643
commit
70c816e236
|
@ -18,6 +18,7 @@ var (
|
|||
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")
|
||||
)
|
||||
|
||||
var ms runner.Measurements
|
||||
|
@ -43,6 +44,7 @@ func main() {
|
|||
BatchInterval: *batchInterval,
|
||||
Database: *database,
|
||||
Address: *address,
|
||||
Precision: *precision,
|
||||
}
|
||||
|
||||
totalPoints, responseTimes, timer := runner.Run(cfg)
|
||||
|
|
|
@ -114,6 +114,7 @@ type Config struct {
|
|||
BatchInterval time.Duration
|
||||
Database string
|
||||
Address string
|
||||
Precision string
|
||||
}
|
||||
|
||||
// newClient returns a pointer to an InfluxDB client for
|
||||
|
@ -153,7 +154,7 @@ func Run(cfg *Config) (totalPoints int, responseTimes ResponseTimes, timer *Time
|
|||
Database: cfg.Database,
|
||||
WriteConsistency: "any",
|
||||
Time: time.Now(),
|
||||
Precision: "n",
|
||||
Precision: cfg.Precision,
|
||||
}
|
||||
|
||||
for i := 1; i <= cfg.PointCount; i++ {
|
||||
|
|
Loading…
Reference in New Issue