teststress

package
v0.0.0-...-bb56650 Latest Latest
Warning

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

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

Documentation

Overview

Package teststress provides a helper for stress testing.

It is in a separate package to avoid import cycles.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Stress

func Stress(tb testtb.TB, f func(ready chan<- struct{}, start <-chan struct{})) int

Stress runs function f in multiple goroutines. It returns the number of created goroutines.

Function f should do a needed setup, send a message to ready channel when it is ready to start, wait for start channel to be closed, and then do the actual work.

func StressN

func StressN(tb testtb.TB, n int, f func(ready chan<- struct{}, start <-chan struct{}))

StressN is a variant of Stress that allows to specify the number of goroutines.

Prefer using Stress when possible.

Types

This section is empty.

Jump to

Keyboard shortcuts

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