Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultHistogramBuckets = []int64{1, 2, 5, 7, 10, 15, 25, 50, 75, 100, 250, 350, 500, 750, 1000, 5000}
Functions ¶
This section is empty.
Types ¶
type GenerateFn ¶
type GenerateFn func(add GeneratorAddFn)
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator sets up a pool and a result collector
func NewGenerator ¶
func NewGenerator(name string, parallelism int, opts ...GeneratorOption) *Generator
func (*Generator) Run ¶
Run will start the worker goroutines and print out their progress every second. Upon completion (or on a SIGTERM), will also print a latency histogram
func (*Generator) Setup ¶
func (g *Generator) Setup(fn GenerateFn)
type GeneratorAddFn ¶
type GeneratorAddFn func(string)
type GeneratorOption ¶
type GeneratorOption func(*Generator)
func WithSignalHandlersFor ¶
func WithSignalHandlersFor(sigs ...os.Signal) GeneratorOption
type Histogram ¶
type Histogram struct {
// contains filtered or unexported fields
}
func NewHistogram ¶
type ResultCollector ¶
type ResultCollector struct { // Results is the channel workers should write their output to Results chan Result // contains filtered or unexported fields }
func NewResultCollector ¶
func NewResultCollector(workerResults chan Result) *ResultCollector
func (*ResultCollector) Collect ¶
func (rc *ResultCollector) Collect()
func (*ResultCollector) Histogram ¶
func (rc *ResultCollector) Histogram() *Histogram
func (*ResultCollector) Stats ¶
func (rc *ResultCollector) Stats() *Stats
func (*ResultCollector) Total ¶ added in v1.40.0
func (rc *ResultCollector) Total() *TotalStats
type Stats ¶
type TotalStats ¶ added in v1.40.0
func (*TotalStats) String ¶ added in v1.40.0
func (t *TotalStats) String() string
type WorkerPool ¶
type WorkerPool struct { Input chan string Output chan Result // contains filtered or unexported fields }
func NewWorkerPool ¶
func NewWorkerPool(parallelism int) *WorkerPool
func (*WorkerPool) Done ¶
func (p *WorkerPool) Done() chan struct{}
func (*WorkerPool) Start ¶
func (p *WorkerPool) Start(workFn WorkFn)
Click to show internal directories.
Click to hide internal directories.