Documentation
¶
Overview ¶
Package stressagent runs a fleet of fake nodes against a real control plane. Each node enrolls and holds a session through the production agent client, backed by an in-memory container runtime.
Index ¶
- type Config
- type Fleet
- type Runtime
- func (r *Runtime) Count() int
- func (r *Runtime) Create(_ context.Context, spec docker.ContainerSpec) (string, error)
- func (r *Runtime) EnsureNetwork(_ context.Context, name string) (string, error)
- func (r *Runtime) EnsureVolume(context.Context, string) error
- func (r *Runtime) Events(ctx context.Context) (<-chan docker.Event, <-chan error)
- func (r *Runtime) Exec(context.Context, string, []string) (io.ReadCloser, error)
- func (r *Runtime) ExecWithInput(context.Context, string, []string, io.Reader) (io.ReadCloser, error)
- func (r *Runtime) InspectByName(_ context.Context, name string) (*docker.ContainerState, error)
- func (r *Runtime) ListByPrefix(_ context.Context, prefix string) ([]docker.ContainerState, error)
- func (r *Runtime) ListImages(context.Context, string) ([]docker.ImageInfo, error)
- func (r *Runtime) ListNetworksByPrefix(_ context.Context, prefix string) ([]docker.NetworkInfo, error)
- func (r *Runtime) NetworkConnect(context.Context, string, string) error
- func (r *Runtime) NetworkDisconnect(context.Context, string, string, bool) error
- func (r *Runtime) Remove(_ context.Context, id string, _ bool) error
- func (r *Runtime) RemoveNetwork(_ context.Context, name string) error
- func (r *Runtime) Start(_ context.Context, id string) error
- func (r *Runtime) Stop(_ context.Context, id string, _ time.Duration) error
- func (r *Runtime) UpdateResources(context.Context, string, docker.Resources) error
- type TokenSource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Addr is the control plane agent listener (host:port).
Addr string
Count int
NamePrefix string
Token TokenSource
// HeartbeatInterval of zero keeps the agent default.
HeartbeatInterval time.Duration
Logger *slog.Logger
}
Config describes the fleet.
type Fleet ¶
type Fleet struct {
// contains filtered or unexported fields
}
Fleet is a set of enrolled, connected fake nodes.
func (*Fleet) Containers ¶
Containers counts containers across the fleet.
func (*Fleet) NodeIDs ¶
NodeIDs returns the control plane's ids for the enrolled nodes, in enrollment order.
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
Runtime is an in-memory container runtime: created containers start instantly and stay running.
func (*Runtime) EnsureNetwork ¶
EnsureNetwork records the network and returns a stable id.
func (*Runtime) EnsureVolume ¶
EnsureVolume is accepted and ignored.
func (*Runtime) ExecWithInput ¶
func (r *Runtime) ExecWithInput(context.Context, string, []string, io.Reader) (io.ReadCloser, error)
ExecWithInput is not supported: stress nodes run no processes.
func (*Runtime) InspectByName ¶
InspectByName returns a copy of the container, or nil when absent.
func (*Runtime) ListByPrefix ¶
ListByPrefix returns containers whose name starts with prefix, sorted by name.
func (*Runtime) ListImages ¶
ListImages reports no local images.
func (*Runtime) ListNetworksByPrefix ¶
func (r *Runtime) ListNetworksByPrefix(_ context.Context, prefix string) ([]docker.NetworkInfo, error)
ListNetworksByPrefix returns networks whose name starts with prefix.
func (*Runtime) NetworkConnect ¶
NetworkConnect is accepted and ignored.
func (*Runtime) NetworkDisconnect ¶
NetworkDisconnect is accepted and ignored.
func (*Runtime) RemoveNetwork ¶
RemoveNetwork forgets the network.