agent

package
v1.22.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAgentNotFound = errors.New("client: agent not found")
)

Functions

This section is empty.

Types

type Agent

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

Agent represents a load-test agent. It exposes methods to manage a load-test agent resource through API.

func New

func New(id, serverURL string, client *http.Client) (*Agent, error)

New creates and initializes a new instance of Agent. Returns an error in case of failure.

func (*Agent) AddUsers

func (a *Agent) AddUsers(numUsers int) (loadtest.Status, error)

AddUsers attempts to increment by numUsers the number of active users. Returns the load-test agent status or an error in case of failure.

func (*Agent) Create

func (a *Agent) Create(ltConfig *loadtest.Config, ucConfig interface{}) (loadtest.Status, error)

Create creates a new load-test agent resource with the given configs. Returns the load-test agent status or an error in case of failure.

func (*Agent) Destroy

func (a *Agent) Destroy() (loadtest.Status, error)

Destroy stops (if running) and destroys the load-test agent resource. Returns the load-test agent status or an error in case of failure.

func (*Agent) Id

func (a *Agent) Id() string

Id returns the unique identifier for the load-test agent resource.

func (*Agent) InjectAction added in v1.10.0

func (a *Agent) InjectAction(actionID string) (loadtest.Status, error)

InjectAction injects an action that is run once, at the next possible opportunity.

func (*Agent) RemoveUsers

func (a *Agent) RemoveUsers(numUsers int) (loadtest.Status, error)

AddUsers attempts to decrease by numUsers the number of active users. Returns the load-test agent status or an error in case of failure.

func (*Agent) Run

func (a *Agent) Run() (loadtest.Status, error)

Run starts the load-test agent. It starts the execution of a load-test. Returns the load-test agent status or an error in case of failure.

func (*Agent) Status

func (a *Agent) Status() (loadtest.Status, error)

Status retrieves and returns the status for the load-test agent. It also returns an error in case of failure.

func (*Agent) Stop

func (a *Agent) Stop() (loadtest.Status, error)

Stop stops the load-test agent. It stops the execution of the running Returns the load-test agent status or an error in case of failure.

type AgentResponse

type AgentResponse struct {
	Id      string           `json:"id,omitempty"`      // The load-test agent unique identifier.
	Message string           `json:"message,omitempty"` // Message contains information about the response.
	Status  *loadtest.Status `json:"status,omitempty"`  // Status contains the current status of the load test.
	Error   string           `json:"error,omitempty"`   // Error is set if there was an error during the operation.
}

AgentResponse contains the data returned by the load-test agent API.

Jump to

Keyboard shortcuts

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