func()

in cmd/queuebench/config.go [35:62]


func (c *config) Parse() {
	b := flag.String("broker", "", "Broker bootstrap URL (host:port) to connect to for this benchmark run")
	d := flag.Int("duration", 0, "Duration is seconds of the production phase of the benchmark")
	p := flag.Int("partitions", 1, "The number of topic partitions to create")
	t := flag.String("timeout", "1m", "Timeout for consuming all records. Benchmark will stop regardless of completion.")
	v := flag.Bool("verbose", false, "Enable additional logging")

	flag.Parse()

	if *b == "" {
		log.Fatal("-broker must be set")
	}
	if *d == 0 {
		log.Fatal("-duration must be set and greater than 0")
	}

	timeout, err := time.ParseDuration(*t)
	if err != nil {
		log.Fatalf("cannot parse -timeout '%s' as duration: %s", *t, err)
	}

	c.broker = *b
	c.duration = time.Duration(*d) * time.Second
	c.eventSize = 1024
	c.partitions = *p
	c.timeout = timeout
	c.verbose = *v
}