func (c BenchmarkRunnerConfig) AddToFlagSet(fs *pflag.FlagSet) {
	fs.String("db-name", "benchmark", "Name of database to use for queries")
	fs.Uint64("burn-in", 0, "Number of queries to ignore before collecting statistics.")
	fs.Uint64("max-queries", 0, "Limit the number of queries to send, 0 = no limit")
	fs.Uint64("max-rps", 0, "Limit the rate of queries per second, 0 = no limit")
	fs.Uint64("print-interval", 100, "Print timing stats to stderr after this many queries (0 to disable)")
	fs.String("memprofile", "", "Write a memory profile to this file.")
	fs.String("hdr-latencies", "", "Write the High Dynamic Range (HDR) Histogram of Response Latencies to this file.")
	fs.Uint("workers", 1, "Number of concurrent requests to make.")
	fs.Bool("prewarm-queries", false, "Run each query twice in a row so the warm query is guaranteed to be a cache hit")
	fs.Bool("print-responses", false, "Pretty print response bodies for correctness checking (default false).")
	fs.Int("debug", 0, "Whether to print debug messages.")
	fs.String("file", "", "File name to read queries from")
	fs.String("results-file", "", "Write the test results summary json to this file")
}
AddToFlagSet adds command line flags needed by the BenchmarkRunnerConfig to the flag set.
package query
import (
	"bufio"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"log"
	"os"
	"runtime/pprof"
	"sync"
	"time"
	"github.com/spf13/pflag"
	"golang.org/x/time/rate"
)
const (
	labelAllQueries  = "all queries"
	labelColdQueries = "cold queries"
	labelWarmQueries = "warm queries"
	defaultReadSize = 4 << 20  
)
type BenchmarkRunnerConfig struct {
	DBName           string `mapstructure:"db-name"`
	Limit            uint64 `mapstructure:"max-queries"`
	LimitRPS         uint64 `mapstructure:"max-rps"`
	MemProfile       string `mapstructure:"memprofile"`
	HDRLatenciesFile string `mapstructure:"hdr-latencies"`
	Workers          uint   `mapstructure:"workers"`
	PrintResponses   bool   `mapstructure:"print-responses"`
	Debug            int    `mapstructure:"debug"`
	FileName         string `mapstructure:"file"`
	BurnIn           uint64 `mapstructure:"burn-in"`
	PrintInterval    uint64 `mapstructure:"print-interval"`
	PrewarmQueries   bool   `mapstructure:"prewarm-queries"`
	ResultsFile      string `mapstructure:"results-file"`
}