Versions in this module Expand all Collapse all v0 v0.4.0 Nov 24, 2026 Changes in this version + const KindCanceled + const KindCrashed + const KindLeased + const KindRunning + const KindTerminal + const OutcomeFailed + const OutcomeHang + const OutcomeSucceeded + func LogLine(taskID string, n, lineBytes int) string + type Behavior interface + Plan func(m *protocol.AssignMsg, r *rand.Rand) TaskPlan + func ScenarioBehavior(classes map[string]scenario.TaskSpec) Behavior + type BehaviorFunc func(m *protocol.AssignMsg, r *rand.Rand) TaskPlan + func (f BehaviorFunc) Plan(m *protocol.AssignMsg, r *rand.Rand) TaskPlan + type ChurnCounts struct + Crashes int64 + Disconnects int64 + Failures int64 + Restarts int64 + Skipped int64 + type Credentials interface + For func(ctx context.Context, workerID string) (seed []byte, publicKey string, err error) + func JoinTokenCredentials(c *client.Client, joinToken string) Credentials + type Dispatcher struct + func NewDispatcher(workerID string, st *status.Publisher, logs *logstreamer.Publisher, b Behavior, ...) *Dispatcher + func (d *Dispatcher) AbandonStatuses() int + func (d *Dispatcher) ActiveAttemptIDs() []string + func (d *Dispatcher) ActiveTaskCount() int + func (d *Dispatcher) ActiveTaskIDs() []string + func (d *Dispatcher) Cancel(taskID, attemptID string) bool + func (d *Dispatcher) Dispatch(_ context.Context, m *protocol.AssignMsg) error + func (d *Dispatcher) FlushStatuses(ctx context.Context) int + func (d *Dispatcher) Hold(attemptID string) + func (d *Dispatcher) LastAssignmentAt() *time.Time + func (d *Dispatcher) SetProgress(ic *openjd.Interceptor) + type Event struct + AssignedAt time.Time + At time.Time + AttemptID string + InstanceID string + JobID string + Kind string + LogLines int + Outcome string + TaskID string + WorkerID string + type Fleet struct + func NewFleet(cfg FleetConfig, b Behavior, l *Ledger, logger *slog.Logger) *Fleet + func (f *Fleet) ChurnCounts() ChurnCounts + func (f *Fleet) CrashAll() + func (f *Fleet) GroupOf(workerID string) string + func (f *Fleet) Live() int + func (f *Fleet) RestartAll(ctx context.Context) error + func (f *Fleet) RunChurn(ctx context.Context) + func (f *Fleet) Simulates(workerID string) bool + func (f *Fleet) Specs() []WorkerSpec + func (f *Fleet) Start(ctx context.Context) error + func (f *Fleet) Stop(ctx context.Context) error + type FleetConfig struct + Creds Credentials + FarmID string + Groups []scenario.WorkerGroup + IDPrefix string + NATSURL string + NATSURLFor func(group string) string + QueueIDs map[string]string + RunID string + Seed int64 + TLS TLSFiles + type Ledger struct + func NewLedger() *Ledger + func (l *Ledger) Events() []Event + func (l *Ledger) EventsSince(n int) []Event + func (l *Ledger) LogLines() int64 + func (l *Ledger) Record(e Event) + func (l *Ledger) SetOutcome(taskID, outcome string) bool + type NoCredentials struct + func (NoCredentials) For(context.Context, string) (seed []byte, publicKey string, err error) + type TLSFiles struct + CAFile string + CertFile string + Enabled string + InsecureSkipVerify bool + KeyFile string + func (f TLSFiles) NATSConfig() workerconfig.NATSConfig + type TaskPlan struct + Duration time.Duration + LineBytes int + LogLines int + Outcome string + ProgressEvery time.Duration + type Worker struct + func NewWorker(spec WorkerSpec, b Behavior, l *Ledger, logger *slog.Logger) *Worker + func (w *Worker) Crash() + func (w *Worker) Disconnect(ctx context.Context) error + func (w *Worker) InstanceID() string + func (w *Worker) Restart(ctx context.Context) error + func (w *Worker) Start(ctx context.Context) error + func (w *Worker) Stop(ctx context.Context) error + type WorkerSpec struct + FarmID string + Group scenario.WorkerGroup + Hostname string + ID string + NATSURL string + PublicKey string + RandSeed uint64 + Seed []byte + TLS TLSFiles