slapperx

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Ready  windowState = 0
	Filled windowState = 1
)

Variables

This section is empty.

Functions

func Main

func Main()

Types

type Config

type Config struct {
	Workers   uint
	Timeout   time.Duration
	Targets   string
	Overrides string
	Rate      float64
	MinY      time.Duration
	MaxY      time.Duration
	RampUp    time.Duration
	LogFile   string
	Verbose   bool
}

func ParseFlags

func ParseFlags() *Config

type LogFile added in v1.1.0

type LogFile struct {
	sync.WaitGroup
	// contains filtered or unexported fields
}

func NewLogFile added in v1.1.0

func NewLogFile(logFile string) *LogFile

func (*LogFile) Close added in v1.1.0

func (f *LogFile) Close()

func (*LogFile) WriteLoop added in v1.1.0

func (f *LogFile) WriteLoop()

func (*LogFile) WriteString added in v1.1.0

func (f *LogFile) WriteString(s string)

type MovingWindow added in v1.0.0

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

ring moving window buffer

func (*MovingWindow) Reset added in v1.0.0

func (mw *MovingWindow) Reset()

func (*MovingWindow) ResetSlot added in v1.0.0

func (mw *MovingWindow) ResetSlot(slot int)

type OkBadCounter added in v1.0.0

type OkBadCounter struct {
	Ok  counter
	Bad counter
}

type RampUpController added in v0.3.0

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

func NewRamUpController added in v0.3.0

func NewRamUpController(rampUpTime time.Duration, maxRate float64) *RampUpController

func (*RampUpController) GetRateChanger added in v0.3.0

func (r *RampUpController) GetRateChanger() chan float64

GetRateChanger returns a channel for changing the ticker's rate during operation.

type Stats

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

type StatsResponse added in v0.5.0

type StatsResponse struct {
	ErrorEof         counter
	ErrorTimeout     counter
	ErrorConnRefused counter
	ErrorNoSuchHost  counter
	// contains filtered or unexported fields
}

type Targeter

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

func NewTargeter

func NewTargeter(requests *[]http.Request, timeout time.Duration, logFile *LogFile, verbose bool) *Targeter

func (*Targeter) Close added in v1.1.0

func (trgt *Targeter) Close()

func (*Targeter) Start

func (trgt *Targeter) Start(workers uint, ticker <-chan time.Time)

type Ticker added in v0.3.0

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

func NewTicker added in v0.3.0

func NewTicker(rate float64) *Ticker

NewTicker creates a new ticker instance with a given rate and ramp-up time.

func (*Ticker) GetRateChanger added in v0.3.0

func (t *Ticker) GetRateChanger() chan float64

GetRateChanger returns a channel for changing the ticker's rate during operation.

func (*Ticker) Start added in v0.3.0

func (t *Ticker) Start() <-chan time.Time

Start initializes the tick process and returns a channel to receive tick events.

func (*Ticker) Stop added in v1.1.0

func (t *Ticker) Stop()

type UI

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

func InitTerminal

func InitTerminal(minY time.Duration, maxY time.Duration) *UI

InitTerminal initializes the terminal and sets the UI dimensions

func (*UI) Close added in v1.1.0

func (ui *UI) Close()

func (*UI) Show added in v1.1.0

func (ui *UI) Show()

show periodically updates and redraws the histogram

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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