userclass

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(e Entry)

Add registers a user class Entry. It panics if an entry with the same Name is already registered.

func Names

func Names() []string

Names returns a sorted slice of all registered user class names.

Types

type Config

type Config struct {
	// APIStub is the shared gRPC client to ateapi (one connection, all goroutines).
	APIStub ateapipb.ControlClient
	// HTTPClient is the shared HTTP client for atenet pings.
	HTTPClient *http.Client
	// RouterURL is the base URL of the atenet router (no trailing slash).
	RouterURL string
	// Atespace every actor this worker creates lives in. Required; caller
	// is responsible for having ensured it exists (see EnsureAtespace).
	Atespace string
	// Dyn is the runtime-mutable config (wait-time bounds, trace
	// probability). Required — every per-iteration read goes through it,
	// so tests can mutate it without touching glutton internals.
	Dyn *dynconfig.Holder
	// Tracer anchors sampled spans; falls back to the otel global if nil.
	Tracer trace.Tracer
}

Config holds the dependencies a user class needs. Built once at startup and passed to the entry's Init func.

type Entry

type Entry struct {
	// Name is the --user-class flag value that selects this class.
	Name string
	// LocustFile is the tests/<file> the Locust master loads for it.
	LocustFile string
	// UserClass is the Python class name. It must equal boomer.Task.Name or
	// the master's spawn messages never match and no users start.
	UserClass string
	// Init builds the boomer task func and its shutdown hook.
	Init func(*Config) (task func(), shutdown func(context.Context))
}

Entry declares one user class: the flag value that selects it, the Locust file and Python class it pairs with, and the func that builds its task.

func Lookup

func Lookup(name string) (Entry, bool)

Lookup returns the Entry registered under name, or false if not found.

Jump to

Keyboard shortcuts

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