Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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, built from the class's
// Entry.Config codec. Required: a class reads its typed knobs from it
// through dynconfig.Get on every iteration, so tests can swap the
// holder without touching class internals.
Dyn *dynconfig.Holder
// Tracer anchors sampled spans; falls back to the otel global if nil.
Tracer trace.Tracer
// ActorsPerUser is the number of actors each VU creates on startup and
// cycles through in round-robin (iteration i targets actor
// i%ActorsPerUser). Zero or negative is treated as 1 by user classes
// that honor this knob; classes that don't honor it treat every VU as
// owning exactly one actor.
ActorsPerUser int
// TotalActors is the total number of actors to create in the batch (spawn benchmark).
TotalActors int
// SpawnConcurrency is the number of actors created concurrently (spawn benchmark).
SpawnConcurrency int
// ActorDeadline is the per-actor timeout covering CreateActor + ResumeActor + Ping (spawn benchmark).
ActorDeadline time.Duration
}
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
// Config is the class's runtime config codec: a dynconfig.Typed over
// the struct it reads its knobs from, with its defaults and rules. The
// worker builds the holder from it, so a payload the class cannot run
// on is refused at fetch time rather than failing in the middle of a
// run. Nil when the class reads no runtime config.
Config dynconfig.Codec
// 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.