mode

package
v0.0.0-...-be22c8c Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoConfig

type AutoConfig struct {
	// 正确率
	CorrectRate float32
	// p90
	P90 time.Duration
	// p99
	P99 time.Duration
	// 最大并发
	MaxConcurrency int
	// 最小并发
	MinConcurrency int
	// 总执行时间
	MaxPeriod time.Duration
	// 单个请求的超时时间
	Timeout time.Duration
}

type AutoMode

type AutoMode struct {
	ModeArgs AutoConfig

	Runner   req.Runner
	Requests []interface{}
	Reporter run.Reporter
}

func (*AutoMode) Run

func (m *AutoMode) Run()

开始调度

type I

type I interface {
	Run()
}

type ManualConfig

type ManualConfig struct {
	// 并发数, 必须指定
	Concurrency int
	// 总请求数
	Count int
	// 总运行时间, 与 Count 二选一. 作为执行的停止条件.
	TimeLimit time.Duration
}

type ManualMode

type ManualMode struct {
	ModeArgs ManualConfig

	Runner   req.Runner
	Requests []interface{}
	Reporter run.Reporter
}

手动执行模式, 请求, 控制等参数均需要人为控制.

func (*ManualMode) Run

func (m *ManualMode) Run()

type Protocol

type Protocol string
const (
	ProtocolHTTP Protocol = "HTTP"
)

type RequestConfig

type RequestConfig struct {
	Protocol   string
	Method     string
	Body       string
	OutputFile string
	Headers    []string
	Timeout    time.Duration
	Url        string
}

通过命令行的简单参数, 转换成对应协议所需的参数.

func (*RequestConfig) Make

func (c *RequestConfig) Make() (interface{}, error)

Jump to

Keyboard shortcuts

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