stress

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: MulanPSL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultStress = Stress{
	// contains filtered or unexported fields
}

DefaultStress 默认压测对象

Functions

This section is empty.

Types

type Stress

type Stress struct {
	// contains filtered or unexported fields
}

Stress 压测结构体

func NewStress

func NewStress(customerNum, requestNum, cpuNum, step int, stepTime, rSpaceTime, testTime time.Duration) *Stress

NewStress 创建压测对象

customerNum -> 初始开启线程数
requestNum  -> 每个线程请求次数,0 表示一直请求
cpuNum      -> 使用CPU核心数
step        -> 每次增加多少线程
stepTime    -> 每次增线程时间间隔
rSpaceTime  -> 每个线程中每次请求时间间隔
testTime    -> 压测总时间 0 表示一直压测

func (*Stress) Run

func (s *Stress) Run(requests ...*request.Request)

Jump to

Keyboard shortcuts

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