collectd test client defaults to no limit points

pull/2987/head
Philip O'Toole 2015-06-12 15:28:31 -07:00
parent 1eb0347670
commit d2da99049a
1 changed files with 5 additions and 2 deletions

View File

@ -15,7 +15,7 @@ import (
var nMeasurments = flag.Int("m", 1, "Number of measurements") var nMeasurments = flag.Int("m", 1, "Number of measurements")
var tagVariance = flag.Int("v", 1, "Number of values per tag. Client is fixed at one tag") var tagVariance = flag.Int("v", 1, "Number of values per tag. Client is fixed at one tag")
var rate = flag.Int("r", 1, "Number of points per second") var rate = flag.Int("r", 1, "Number of points per second")
var total = flag.Int("t", 1, "Total number of points to send") var total = flag.Int("t", -1, "Total number of points to send (default is no limit)")
var host = flag.String("u", "127.0.0.1:25826", "Destination host in the form host:port") var host = flag.String("u", "127.0.0.1:25826", "Destination host in the form host:port")
func main() { func main() {
@ -43,7 +43,10 @@ func main() {
}() }()
nSent := 0 nSent := 0
for nSent < *total { for {
if nSent >= *total && *total > 0 {
break
}
<-rateLimiter <-rateLimiter
vl := api.ValueList{ vl := api.ValueList{