run

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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicController

type BasicController struct {
	// 并发数, 必须指定
	Concurrency int
	// 总请求数
	Count int
	// 总运行时间
	Period time.Duration
	// 请求
	Requests []interface{}
}

func (*BasicController) Control

func (c *BasicController) Control(runner req.Runner, reporter Reporter)

func (*BasicController) String

func (c *BasicController) String() string

type Controller

type Controller interface {
	fmt.Stringer
	// 调用逻辑控制
	Control(runner req.Runner, reporter Reporter)
}

type Reporter

type Reporter interface {
	// 结果流式处理: 存盘, 抽样统计
	StreamReport(report *req.ReportV1)
	//
	ResultReport(interface{})
	// 渲染自己, 最后自己就是结果.
	Result(print bool)
}

通过不同的策略, 去实现不同的抽样.

type Statistic

type Statistic struct {
	WriterCSV       io.WriteCloser
	Filter          func(v1 *req.ReportV1) bool // 抽样方法
	SampleReservoir int
	ReservoirIndex  int
	TP              []int
	// contains filtered or unexported fields
}

func (*Statistic) Result

func (s *Statistic) Result(print bool)

func (*Statistic) ResultReport

func (s *Statistic) ResultReport(result interface{})

func (*Statistic) StreamReport

func (s *Statistic) StreamReport(report *req.ReportV1)

func (*Statistic) String

func (s *Statistic) String() string

Jump to

Keyboard shortcuts

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