cluster

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoadAgentCluster

type LoadAgentCluster struct {
	// contains filtered or unexported fields
}

LoadAgentCluster is the object holding information about all the load-test agents available in the cluster.

func New

func New(config LoadAgentClusterConfig, ltConfig loadtest.Config, log *mlog.Logger) (*LoadAgentCluster, error)

New creates and initializes a new LoadAgentCluster for the given config. An error is returned if the initialization fails.

func (*LoadAgentCluster) DecrementUsers

func (c *LoadAgentCluster) DecrementUsers(n int) error

DecrementUsers decrements the total number of active users in the load-test custer by the provided amount.

func (*LoadAgentCluster) IncrementUsers

func (c *LoadAgentCluster) IncrementUsers(n int) error

IncrementUsers increments the total number of active users in the load-test custer by the provided amount.

func (*LoadAgentCluster) InjectAction added in v1.10.0

func (c *LoadAgentCluster) InjectAction(actionID string) error

InjectAction injects an action into all the agents. The action is run once, at the next possible opportunity.

func (*LoadAgentCluster) Run

func (c *LoadAgentCluster) Run() error

Run starts all the load-test agents available in the cluster.

func (*LoadAgentCluster) Shutdown

func (c *LoadAgentCluster) Shutdown()

Shutdown stops and destroys all the load-test agents available in the cluster. It makes sure agent.Destroy() is called once for every agent in the cluster.

func (*LoadAgentCluster) Status

func (c *LoadAgentCluster) Status() (Status, error)

Status returns the current status of the LoadAgentCluster.

func (*LoadAgentCluster) Stop

func (c *LoadAgentCluster) Stop() error

Stop stops all the load-test agents available in the cluster.

type LoadAgentClusterConfig

type LoadAgentClusterConfig struct {
	// Agents is a list of the load-test agents API endpoints to be used during
	// the load-test. It's length defines the number of load-test instances
	// used during a load-test.
	Agents []LoadAgentConfig `default_size:"1"`
	// MaxActiveUsers defines the upper limit of concurrently active users to run across
	// the whole cluster.
	MaxActiveUsers int `default:"1000" validate:"range:(0,]"`
}

LoadAgentClusterConfig holds information regarding the cluster of load-test agents.

func (*LoadAgentClusterConfig) IsValid added in v1.7.0

func (c *LoadAgentClusterConfig) IsValid(ltConfig loadtest.Config) error

type LoadAgentConfig

type LoadAgentConfig struct {
	// A sring that identifies the load-test agent instance.
	Id string `default:"lt0" validate:"notempty"`
	// The API URL used to control the specified load-test instance.
	ApiURL string `default:"http://localhost:4000" validate:"url"`
}

LoadAgentConfig holds information about the load-test agent instance.

type Status

type Status struct {
	ActiveUsers int   // Total number of currently active users across the load-test agents cluster.
	NumErrors   int64 // Total number of errors received from the load-test agents cluster.
}

Jump to

Keyboard shortcuts

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