vegetahelper

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: MIT Imports: 8 Imported by: 4

README

vegetahelper

Helper library for creating load test client using vegeta.
https://github.com/tsenart/vegeta

Its motivation is make vegeta attackable against gRPC server, and I want to use reporting function of vegeta same as http load testing.

Requirements

Example

https://github.com/tckz/healthcheck/tree/master/cmd/helloattacker

My environment

  • CentOS 8 x64
  • Go 1.17.5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attacker

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

func NewAttacker

func NewAttacker(f HitFunc, opts ...AttackerOption) *Attacker

func (*Attacker) Attack

func (a *Attacker) Attack(ctx context.Context, r vegeta.Rate, du time.Duration, name string) <-chan *vegeta.Result

type AttackerOption

type AttackerOption func(*AttackerOptions)

func WithWorkers

func WithWorkers(n uint64) AttackerOption

type AttackerOptions

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

type HitFunc

type HitFunc func(context.Context) (*HitResult, error)

type HitResult

type HitResult struct {
	SentBytes uint64
	RecvBytes uint64
	Code      uint16
	Error     string
}

type RateFlag

type RateFlag struct{ *vegeta.Rate }

func (*RateFlag) Set

func (f *RateFlag) Set(v string) (err error)

func (*RateFlag) String

func (f *RateFlag) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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