load

package
v0.26.2 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: MPL-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoopRequestGenerator = RequestGeneratorFn(func() []byte {
	return nil
})

Functions

This section is empty.

Types

type Finished

type Finished func()

Finished should be called when a function exits to stop the load generation

type Generator

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

func NewGenerator

func NewGenerator(cores int, percentage float64, memoryBytes, memoryVariance int, logger hclog.Logger) *Generator

NewGenerator creates a new load generator that can create atrificial memory and cpu pressure

func (*Generator) Generate

func (g *Generator) Generate() Finished

Generate load for the request

type RequestGenerator

type RequestGenerator interface {
	Generate() []byte
}

func NewRequestGenerator

func NewRequestGenerator(body string, size int, variance int, seed int64) RequestGenerator

type RequestGeneratorFn

type RequestGeneratorFn func() []byte

func (RequestGeneratorFn) Generate

func (f RequestGeneratorFn) Generate() []byte

Jump to

Keyboard shortcuts

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