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.
Implementations
impl ControllerCommand
Defines details around identifying and processing ControllerCommands.
As order doesn’t matter here, it’s preferred to define commands in alphabetical order.
Trait Implementations
sourceimpl Clone for ControllerCommand
impl Clone for ControllerCommand
sourcefn clone(&self) -> ControllerCommand
fn clone(&self) -> ControllerCommand
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ControllerCommand
impl Debug for ControllerCommand
sourceimpl FromStr for ControllerCommand
impl FromStr for ControllerCommand
Implement FromStr
to convert controller commands and optional values to the proper enum
representation.
sourceimpl IntoEnumIterator for ControllerCommand
impl IntoEnumIterator for ControllerCommand
type Iterator = ControllerCommandIter
fn iter() -> ControllerCommandIterⓘNotable traits for ControllerCommandIterimpl Iterator for ControllerCommandIter type Item = 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
sourcefn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
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
sourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
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
sourcefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
sourcefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
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
sourceimpl<T> DowncastSync for T where
T: Any + Send + Sync,
impl<T> DowncastSync for T where
T: Any + Send + Sync,
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more