Enum goose::controller::ControllerCommand
source · 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:
- 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.
- Add the new command to
ControllerCommand::details
and populate allControllerCommandDetails
, using other commands as an implementation reference.- The
regex
is used to identify the command, and optionally to extract a value (for example seeHatchrate
andUsers
) - If additional validation is required beyond the regular expression, add
the necessary logic to
ControllerCommand::validate_value
.
- The
- Add any necessary parent process logic for the command to
GooseAttack::handle_controller_requests
(also in this file). - 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 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.
StartupTime
Configure how long to take to launch all GooseUser
s.
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 GooseUser
s 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
ConfigJson
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.
Metrics
Display the current GooseMetric
s.
Example
Returns the current Goose metrics.
metrics
This command can be run at any time.
MetricsJson
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.
Trait Implementations§
source§impl Clone for ControllerCommand
impl Clone for ControllerCommand
source§fn clone(&self) -> ControllerCommand
fn clone(&self) -> ControllerCommand
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ControllerCommand
impl Debug for ControllerCommand
source§impl FromStr for ControllerCommand
impl FromStr for ControllerCommand
Implement FromStr
to convert controller commands and optional values to the proper enum
representation.
source§impl IntoEnumIterator for ControllerCommand
impl IntoEnumIterator for ControllerCommand
type Iterator = ControllerCommandIter
fn iter() -> ControllerCommandIter ⓘ
source§impl PartialEq<ControllerCommand> for ControllerCommand
impl PartialEq<ControllerCommand> for ControllerCommand
source§fn eq(&self, other: &ControllerCommand) -> bool
fn eq(&self, other: &ControllerCommand) -> bool
self
and other
values to be equal, and is used
by ==
.impl Eq for ControllerCommand
impl StructuralEq for ControllerCommand
impl StructuralPartialEq for ControllerCommand
Auto Trait Implementations§
impl RefUnwindSafe for ControllerCommand
impl Send for ControllerCommand
impl Sync for ControllerCommand
impl Unpin for ControllerCommand
impl UnwindSafe for ControllerCommand
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
source§fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
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
.source§fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.