Struct goose::metrics::GooseMetrics [−][src]
Metrics collected during a Goose load test.
Example
use goose::prelude::*; fn main() -> Result<(), GooseError> { let goose_metrics: GooseMetrics = GooseAttack::initialize()? .register_taskset(taskset!("ExampleUsers") .register_task(task!(example_task)) ) .execute()?; // It is now possible to do something with the metrics collected by Goose. // For now, we'll just pretty-print the entire object. println!("{:#?}", goose_metrics); Ok(()) } async fn example_task(user: &GooseUser) -> GooseTaskResult { let _goose = user.get("/").await?; Ok(()) }
Fields
hash: u64
A hash of the load test, useful to verify if different metrics are from the same load test.
started: Option<DateTime<Local>>
The system timestamp of when the load test started.
duration: usize
How many seconds the load test ran.
users: usize
Total number of users simulated during this load test.
requests: GooseRequestMetrics
Goose request metrics.
tasks: GooseTaskMetrics
Goose task metrics.
display_percentile: bool
Flag indicating whether or not to display percentile. Because we’re deriving Default, this defaults to false.
display_status_codes: bool
Flag indicating whether or not to display status_codes. Because we’re deriving Default, this defaults to false.
display_metrics: bool
Flag indicating whether or not to display metrics, set to false on Workers. This defaults to false because we’re deriving Default.
Implementations
impl GooseMetrics
[src]
pub fn initialize_task_metrics(
&mut self,
task_sets: &[GooseTaskSet],
config: &GooseConfiguration
)
[src]
&mut self,
task_sets: &[GooseTaskSet],
config: &GooseConfiguration
)
Create a new GooseMetrics object.
pub fn print(&self)
[src]
Consumes and display all metrics from a completed load test.
Example
use goose::prelude::*; fn main() -> Result<(), GooseError> { GooseAttack::initialize()? .register_taskset(taskset!("ExampleUsers") .register_task(task!(example_task)) ) .execute()? .print(); Ok(()) } async fn example_task(user: &GooseUser) -> GooseTaskResult { let _goose = user.get("/").await?; Ok(()) }
pub fn print_running(&self)
[src]
Consumes and displays metrics from a running load test.
pub fn fmt_requests(&self, fmt: &mut Formatter<'_>) -> Result
[src]
Optionally prepares a table of requests and fails.
pub fn fmt_tasks(&self, fmt: &mut Formatter<'_>) -> Result
[src]
Optionally prepares a table of tasks.
pub fn fmt_task_times(&self, fmt: &mut Formatter<'_>) -> Result
[src]
Optionally prepares a table of task times.
pub fn fmt_response_times(&self, fmt: &mut Formatter<'_>) -> Result
[src]
Optionally prepares a table of response times.
pub fn fmt_percentiles(&self, fmt: &mut Formatter<'_>) -> Result
[src]
Optionally prepares a table of slowest response times within several percentiles.
pub fn fmt_status_codes(&self, fmt: &mut Formatter<'_>) -> Result
[src]
Optionally prepares a table of response status codes.
Trait Implementations
impl Clone for GooseMetrics
[src]
fn clone(&self) -> GooseMetrics
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for GooseMetrics
[src]
impl Default for GooseMetrics
[src]
fn default() -> GooseMetrics
[src]
impl Display for GooseMetrics
[src]
Auto Trait Implementations
impl RefUnwindSafe for GooseMetrics
impl Send for GooseMetrics
impl Sync for GooseMetrics
impl Unpin for GooseMetrics
impl UnwindSafe for GooseMetrics
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,