wrk

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCommand

func NewCommand() command.Command

Types

type Config

type Config struct {
	Duration    time.Duration `json:"-"` // 处理时间
	DurationStr string        `json:"duration"`

	Url         string          `json:"url"` // 请求路径
	HeaderSlice cli.StringSlice `json:"-"`
	Header      http.Header     `json:"header"` // 请求头
	Body        string          `json:"body"`   // 请求体

	Threads     int `json:"threads"`     // 最大并发数量
	Connections int `json:"connections"` // 最大连接数

	Timeout    time.Duration `json:"-"` // 连接/请求超时时间
	TimeoutStr string        `json:"timeout"`

	Method string `json:"method"` // 请求方法
}

func NewConfig

func NewConfig(time time.Duration, url string, op ...Option) *Config

func (*Config) Flag

func (c *Config) Flag() []cli.Flag

func (*Config) InitConfig

func (c *Config) InitConfig(context *cli.Context) (interface{}, error)

func (*Config) Run

func (c *Config) Run(ctx context.Context) error

type Option

type Option func(config *Config)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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