From 8648f6d5e7b7d355dfad78adc3228699e088b0f5 Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Mon, 16 Mar 2015 11:27:27 -0600 Subject: [PATCH] Add -host option to urlgen. --- tests/urlgen/urlgen.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/urlgen/urlgen.go b/tests/urlgen/urlgen.go index 1baf02c221..76c2232f4b 100644 --- a/tests/urlgen/urlgen.go +++ b/tests/urlgen/urlgen.go @@ -8,9 +8,12 @@ import ( ) func main() { - intervalN := flag.Int("interval", 10, "interval") - seriesN := flag.Int("series", 1, "Number of unique series to generate.") - clientN := flag.Int("clients", 10, "Number of clients to simulate.") + var ( + intervalN = flag.Int("interval", 10, "interval") + seriesN = flag.Int("series", 1, "Number of unique series to generate.") + clientN = flag.Int("clients", 10, "Number of clients to simulate.") + host = flag.String("host", "localhost:8086", "Target host") + ) flag.Parse() // Calculate time so that the last point ends now. @@ -36,7 +39,7 @@ func main() { } buf, _ := json.Marshal(batch) - fmt.Printf("http://localhost:8086/write POST %s\n", buf) + fmt.Printf("http://%s/write POST %s\n", *host, buf) } } }