Documentation ¶
Index ¶
- Variables
- func DeferPostInit(postinit func())
- func ExtractArgs(o *options.Options, cmd *cobra.Command, args []string) (*options.Options, error)
- func ExtractConstraintsOptions(o *options.Options, cmd *cobra.Command, _ []string) (*options.Options, error)
- func ExtractOptions(o *options.Options, cmd *cobra.Command, _ []string) (*options.Options, error)
- func ExtractTests(args []string) ([]int, error)
- func GenerateOptions(cmd *cobra.Command, args []string, gs ...OptionsGenerator) (*options.Options, error)
- func NewTestCommand(c *CommandTemplate, p CommandParams) *cobra.Command
- func RunLoadTestConcurrencyConstraints(p CommandParams) cobraRunE
- func RunLoadTestConcurrencyFixed(p CommandParams) cobraRunE
- func RunLoadTestThroughputConstraints(p CommandParams) cobraRunE
- func RunLoadTestThroughputFixed(p CommandParams) cobraRunE
- func StartPostInit()
- type CommandParams
- type CommandTemplate
- type OptionsGenerator
Constants ¶
This section is empty.
Variables ¶
var ( // ConstraintsFlags contains flags for specifying constraints tests options. ConstraintsFlags = pflag.NewFlagSet("Constraints test flags", pflag.ExitOnError) // ConstraintsValue is a pflag value for constraints. ConstraintsValue = flags.NewConstraintSliceValue(metric.Parser) // ConstraintsHelp is a help message on how to use constraints. ConstraintsHelp = strings.Join([]string{tester.ConstraintsHelp, metric.Help}, "\n") )
Functions ¶
func DeferPostInit ¶
func DeferPostInit(postinit func())
DeferPostInit defers an execution of postinit function until a StartPostInit is called.
func ExtractArgs ¶
ExtractArgs extracts arguments commonly used options across all tests.
func ExtractConstraintsOptions ¶
func ExtractConstraintsOptions(o *options.Options, cmd *cobra.Command, _ []string) (*options.Options, error)
ExtractConstraintsOptions extracts flag commonly used options across constraints test commands.
func ExtractOptions ¶
ExtractOptions extracts flags commonly used options across all commands.
func ExtractTests ¶
ExtractTests parses list of arguments to a list of int values.
func GenerateOptions ¶
func GenerateOptions(cmd *cobra.Command, args []string, gs ...OptionsGenerator) (*options.Options, error)
GenerateOptions runs given generators for a command and returns options.
func NewTestCommand ¶
func NewTestCommand(c *CommandTemplate, p CommandParams) *cobra.Command
NewTestCommand creates a protocol command with all the test subcommands. ${protocol} throughput fixed ${protocol} throughput constraints ${protocol} concurrency fixed ${protocol} concurrency constraints
func RunLoadTestConcurrencyConstraints ¶
func RunLoadTestConcurrencyConstraints(p CommandParams) cobraRunE
RunLoadTestConcurrencyConstraints returns a new cobra RunE method for the concurrency load tester with constraint checks.
func RunLoadTestConcurrencyFixed ¶
func RunLoadTestConcurrencyFixed(p CommandParams) cobraRunE
RunLoadTestConcurrencyFixed returns a new cobra RunE method for the load tester with fixed concurrent connections count.
func RunLoadTestThroughputConstraints ¶
func RunLoadTestThroughputConstraints(p CommandParams) cobraRunE
RunLoadTestThroughputConstraints returns a new cobra RunE method for the QPS load tester with constraint checks.
func RunLoadTestThroughputFixed ¶
func RunLoadTestThroughputFixed(p CommandParams) cobraRunE
RunLoadTestThroughputFixed returns a new cobra RunE method for the load tester with fixed QPS tests.
func StartPostInit ¶
func StartPostInit()
StartPostInit starts all postinit functions and blocks execution until all of them are finished.
Types ¶
type CommandParams ¶
CommandParams is used to generate params for the runner.
type CommandTemplate ¶
type CommandTemplate struct { // Command name it will be invoked with Name string // Short and long help messages Short, Long string // Usage examples can containt {test} string which will be replaced with the // actual test name (throughput|concurrency) Fixed, Constraints string }
CommandTemplate groups parameters used to generate the test command.