Enum goose::controller::GooseControllerCommand[][src]

pub enum GooseControllerCommand {
Show 13 variants Host, Users, HatchRate, RunTime, Config, ConfigJson, Metrics, MetricsJson, Help, Exit, Start, Stop, Shutdown,
}
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 GooseControllerWebSocketRequest.

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

  1. Define the command here in the GooseControllerCommand enum.
  2. Add the regular expression for matching the new command in the command regex::RegexSet in controller_main().
    1. If a value needs to be captured, define the regular expression in a variable outside the set, and add the variable to the top section of the set with the other regex variables.
    2. In the same function, also add the variable to the captures Vector, in the same order that it was added to the command RegexSet. Order is important as this is how the regex is later identified.
  3. Check for a match to the new regex in get_match(), any additional validation beyond the regex must be performed here (for example, the regular expression for capturing hosts simply confirms that the host starts with http or https, then in get_match() it calls util::is_valid_host() to be sure it is truly a valid host before passing it to the parent process).
  4. Add any parent process logic for the command to handle_controller_requests().
  5. Handle the response in process_response(), returning a Result<String, String> succinctly describing success or failure.

Variants

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.

Users

Configure how many GooseUsers are launched.

Example

Tells Goose to simulate 100 concurrent users.

users 100

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.

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.

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.

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.

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

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

Performs the conversion.

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

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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