[][src]Struct goose::GooseState

pub struct GooseState { /* fields omitted */ }

Internal global state for load test.

Methods

impl GooseState[src]

Goose's internal global state.

pub fn initialize() -> GooseState[src]

Load configuration from command line and initialize a GooseState.

Example

    let mut goose_state = GooseState::initialize();

pub fn register_taskset(&mut self, taskset: GooseTaskSet)[src]

A load test must contain one or more GooseTaskSets. Each task set must be reigstered into Goose's global state with this method for it to run.

Example

    let mut goose_state = GooseState::initialize();
    let mut example_tasks = GooseTaskSet::new("ExampleTasks");
    example_tasks.register_task(GooseTask::new(example_task));
    goose_state.register_taskset(example_tasks);

pub fn set_host(self, host: &str) -> Self[src]

Optionally configure a default host for the load test. This is used if no per-GooseTaskSet host is defined, no --host CLI option is configurared, and if the GooseTask itself doesn't hard-code the host in its request. The host is prepended on all requests.

For example, your load test may default to running against your local development container, and the --host option could be used to override host to run the load test against production.

Example

    let mut goose_state = GooseState::initialize().set_host("local.dev");

pub fn execute(self)[src]

Execute the load test.

Example

    // Initial the global Goose State.
    let mut goose_state = GooseState::initialize();
 
    // Set up a simplistic load test with one task in one task set.
    let mut example_tasks = GooseTaskSet::new("ExampleTasks");
    example_tasks.register_task(GooseTask::new(example_task));
    goose_state.register_taskset(example_tasks);
 
    // Execute the load test as configured above.
    goose_state.execute();

Trait Implementations

impl Clone for GooseState[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,