pub enum ControllerCommand {
Show 15 variants Help, Exit, Start, Stop, Shutdown, Host, HatchRate, StartupTime, Users, RunTime, TestPlan, Config, ConfigJson, Metrics, MetricsJson,
}
Expand description

All commands recognized by the Goose Controllers.

Commands are not case sensitive. When sending commands to the WebSocket Controller, they must be formatted as json as defined by ControllerWebSocketRequest.

GOOSE DEVELOPER NOTE: The following steps are required to add a new command:

  1. Define the new command here in the ControllerCommand enum.
    • Commands will be displayed in the help screen in the order defined here, so they should be logically grouped.
  2. Add the new command to ControllerCommand::details and populate all ControllerCommandDetails, using other commands as an implementation reference.
    • The regex is used to identify the command, and optionally to extract a value (for example see Hatchrate and Users)
    • If additional validation is required beyond the regular expression, add the necessary logic to ControllerCommand::validate_value.
  3. Add any necessary parent process logic for the command to GooseAttack::handle_controller_requests (also in this file).
  4. Add a test for the new command in tests/controller.rs.

Variants

Help

Displays a list of all commands supported by the Controller.

Example

Returns the a list of all supported Controller commands.

help

This command can be run at any time.

Exit

Disconnect from the Controller.

Example

Disconnects from the Controller.

exit

This command can be run at any time.

Start

Start an idle test.

Example

Starts an idle load test.

start

Goose must be idle to process this command.

Stop

Stop a running test, putting it into an idle state.

Example

Stops a running (or stating) load test.

stop

Goose must be running (or starting) to process this command.

Shutdown

Tell the load test to shut down (which will disconnect the controller).

Example

Terminates the Goose process, cleanly shutting down the load test if running.

shutdown

Goose can process this command at any time.

Host

Configure the host to load test.

Example

Tells Goose to generate load against http://example.com/.

host http://example.com/

Goose must be idle to process this command.

HatchRate

Configure how quickly new GooseUsers are launched.

Example

Tells Goose to launch a new user every 1.25 seconds.

hatchrate 1.25

Goose can be idle or running when processing this command.

StartupTime

Configure how long to take to launch all GooseUsers.

Example

Tells Goose to launch a new user every 1.25 seconds.

startuptime 1.25

Goose must be idle to process this command.

Users

Configure how many GooseUsers to launch.

Example

Tells Goose to simulate 100 concurrent users.

users 100

Can be configured on an idle or running load test.

RunTime

Configure how long the load test should run before stopping and returning to an idle state.

Example

Tells Goose to run the load test for 1 minute, before automatically stopping.

runtime 60

This can be configured when Goose is idle as well as when a Goose load test is running.

TestPlan

Define a load test plan. This will replace the previously configured test plan, if any.

Example

Tells Goose to launch 10 users in 5 seconds, maintain them for 30 seconds, and then spend 5 seconds stopping them.

testplan "10,5s;10,30s;0,5s"

Can be configured on an idle or running load test.

Config

Display the current GooseConfigurations.

Example

Returns the current Goose configuration.

config

ConfigJson

Display the current GooseConfigurations in json format.

Example

Returns the current Goose configuration in json format.

configjson

This command can be run at any time.

Metrics

Display the current GooseMetrics.

Example

Returns the current Goose metrics.

metrics

This command can be run at any time.

MetricsJson

Display the current GooseMetrics in json format.

Example

Returns the current Goose metrics in json format.

metricsjson

This command can be run at any time.

Implementations

This impl block contains no items.

Defines details around identifying and processing ControllerCommands.

As order doesn’t matter here, it’s preferred to define commands in alphabetical order.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Implement FromStr to convert controller commands and optional values to the proper enum representation.

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more