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:
- Define the command here in the GooseControllerCommand enum.
- Add the regular expression for matching the new command in the
command
regex::RegexSet
incontroller_main()
.- 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.
- In the same function, also add the variable to the
captures
Vector, in the same order that it was added to thecommand
RegexSet
. Order is important as this is how the regex is later identified.
- 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 inget_match()
it callsutil::is_valid_host()
to be sure it is truly a valid host before passing it to the parent process). - Add any parent process logic for the command to
handle_controller_requests()
. - Handle the response in
process_response()
, returning aResult<String, String>
succinctly describing success or failure.
Variants
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.
Configure how many GooseUser
s are launched.
Example
Tells Goose to simulate 100 concurrent users.
users 100
Goose must be idle to process this command.
Configure how quickly new GooseUser
s 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.
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.
Display the current GooseConfiguration
s in json format.
Example
Returns the current Goose configuration in json format.
configjson
This command can be run at any time.
Display the current GooseMetric
s.
Example
Returns the current Goose metrics.
metrics
This command can be run at any time.
Display the current GooseMetric
s in json format.
Example
Returns the current Goose metrics in json format.
metricsjson
This command can be run at any time.
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.
Disconnect from the Controller.
Example
Disconnects from the Controller.
exit
This command can be run at any time.
Start an idle test.
Example
Starts an idle load test.
start
Goose must be idle to process this command.
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.
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
Auto Trait Implementations
impl RefUnwindSafe for GooseControllerCommand
impl Send for GooseControllerCommand
impl Sync for GooseControllerCommand
impl Unpin for GooseControllerCommand
impl UnwindSafe for GooseControllerCommand
Blanket Implementations
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
pub fn vzip(self) -> V
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