testbench

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2025 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunTimedTest

func RunTimedTest[T any, Q queue.QueueValidationInterface[T]](
	q Q,
	cfg Config,
	testDuration time.Duration,
	valueGenerator func(int) T,
) (producedCount int64, consumedCount int64, elapsed time.Duration)

RunTimedTest spawns producers and consumers that run for the specified duration, measuring how many messages are actually enqueued/dequeued in that window. Once the context expires, producers stop and consumers drain any remaining messages in the queue. Returns the total messages enqueued, total consumed, and the actual elapsed time.

Types

type Config

type Config struct {
	NumProducers int
	NumConsumers int
}

Config is now only about concurrency: how many producers, how many consumers.

Jump to

Keyboard shortcuts

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