diff --git a/flooder/cmd/flood/flood.go b/flooder/cmd/flood/flood.go index f5ef0854..4cf37ac6 100644 --- a/flooder/cmd/flood/flood.go +++ b/flooder/cmd/flood/flood.go @@ -39,4 +39,5 @@ func init() { floodCmd.Flags().StringSliceP("tags", "", []string{}, "Set tags") floodCmd.Flags().IntP("points-per-10seconds", "", 100000, "Set points per 10 seconds") floodCmd.Flags().BoolP("send-at-start-of-bucket", "", false, "Send all the points at the start of the 10 sec time bucket.") + floodCmd.Flags().BoolP("verbose", "", false, "Enable verbose mode") } diff --git a/flooder/pkg/flood/flood.go b/flooder/pkg/flood/flood.go index e90ce36f..e4e2dba5 100644 --- a/flooder/pkg/flood/flood.go +++ b/flooder/pkg/flood/flood.go @@ -128,6 +128,14 @@ func initClient(command *cobra.Command) (*client, error) { log.Printf("Tags: %v - Hash: %x", tags, h) + b, err = command.Flags().GetBool("verbose") + if err != nil { + return nil, err + } + if b { + options = append(options, statsd.WithErrorHandler(statsd.LoggingErrorHandler)) + } + options = append(options, statsd.WithOriginDetection()) c, err := statsd.New(address, options...)