core

package
v0.0.0-...-4b634d0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 26, 2022 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func ExtractArgs(o *options.Options, cmd *cobra.Command, args []string) (*options.Options, error)

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

func ExtractOptions(o *options.Options, cmd *cobra.Command, _ []string) (*options.Options, error)

ExtractOptions extracts flags commonly used options across all commands.

func ExtractTests

func ExtractTests(args []string) ([]int, error)

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

type CommandParams func(*cobra.Command, *options.Options) (*runner.Params, error)

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.

type OptionsGenerator

type OptionsGenerator func(o *options.Options, cmd *cobra.Command, args []string) (*options.Options, error)

OptionsGenerator is used to generate options from command line params.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL