Documentation ¶
Index ¶
- Variables
- type Agent
- func (a *Agent) AddUsers(numUsers int) (loadtest.Status, error)
- func (a *Agent) Create(ltConfig *loadtest.Config, ucConfig interface{}) (loadtest.Status, error)
- func (a *Agent) Destroy() (loadtest.Status, error)
- func (a *Agent) Id() string
- func (a *Agent) InjectAction(actionID string) (loadtest.Status, error)
- func (a *Agent) RemoveUsers(numUsers int) (loadtest.Status, error)
- func (a *Agent) Run() (loadtest.Status, error)
- func (a *Agent) Status() (loadtest.Status, error)
- func (a *Agent) Stop() (loadtest.Status, error)
- type AgentResponse
Constants ¶
This section is empty.
Variables ¶
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 ¶
New creates and initializes a new instance of Agent. Returns an error in case of failure.
func (*Agent) AddUsers ¶
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 ¶
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 ¶
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) InjectAction ¶ added in v1.10.0
InjectAction injects an action that is run once, at the next possible opportunity.
func (*Agent) RemoveUsers ¶
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 ¶
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.
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.