Struct balter::RunStatistics

source ·
pub struct RunStatistics {
    pub concurrency: usize,
    pub goal_tps: u32,
    pub actual_tps: f64,
    pub latency_p50: Duration,
    pub latency_p90: Duration,
    pub latency_p95: Duration,
    pub latency_p99: Duration,
    pub error_rate: f64,
    pub tps_limited: bool,
}
Expand description

Run Statistics for a given Scenario

Fields§

§concurrency: usize§goal_tps: u32§actual_tps: f64§latency_p50: Duration§latency_p90: Duration§latency_p95: Duration§latency_p99: Duration§error_rate: f64§tps_limited: bool

Trait Implementations§

source§

impl Clone for RunStatistics

source§

fn clone(&self) -> RunStatistics

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T, F> ConfigurableScenario<RunStatistics> for Scenario<T>
where T: Fn() -> F + Send + 'static + Clone + Sync, F: Future<Output = ()> + Send,

source§

fn tps(self, tps: u32) -> Self

Run the scenario at the specified TPS.

§Example
use balter::prelude::*;
use std::time::Duration;

#[tokio::main]
async fn main() {
    my_scenario()
        // Scale scenario until 5K TPS
        .tps(5_000)
        .await;
}

#[scenario]
async fn my_scenario() {
}
§Panics

This function will panic if the provided TPS is zero

source§

fn error_rate(self, error_rate: f64) -> Self

Run the scenario increasing TPS until a custom error rate is reached.

§Example
use balter::prelude::*;
use std::time::Duration;

#[tokio::main]
async fn main() {
    my_scenario()
        // Scale scenario until 25% error rate
        .error_rate(0.25)
        .await;
}

#[scenario]
async fn my_scenario() {
}
§Panics

This function will panic if the error_rate is not between 0 and 1.

source§

fn latency(self, latency: Duration, quantile: f64) -> Self

Run the scenario up to the specified latency, given a quantile.

§Example
use balter::prelude::*;
use std::time::Duration;
use std::num::NonZeroU32;

#[tokio::main]
async fn main() {
    my_scenario()
        // Scale scenario until p95 latency is 200ms
        .latency(Duration::from_millis(200), 0.95)
        .await;
}

#[scenario]
async fn my_scenario() {
}
§Panics

This function will panic if the quantile is not between 0 and 1.

source§

fn duration(self, duration: Duration) -> Self

Run the scenario for the given duration.

NOTE: This method doesn’t make much sense without one of the other load-testing methods (tps()/error_rate()/latency())

§Example
use balter::prelude::*;
use std::time::Duration;
use std::num::NonZeroU32;

#[tokio::main]
async fn main() {
    my_scenario()
        .tps(10_000)
        .duration(Duration::from_secs(120))
        .await;
}

#[scenario]
async fn my_scenario() {
}
source§

fn hint(self, hint: Hint) -> Self

Apply a hint for how to run the Scenario

By default Balter attempts to autoscale all parameters to find the optimal values for various scenarios. However, this process can be slow due to the control loop processes underneath (and the requirements to be adaptable to all sorts of timing characteristics).

This method allows providing hints to Balter to speed up finding optimal parameters. See Hint for more information.

source§

impl Debug for RunStatistics

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Default for RunStatistics

source§

fn default() -> RunStatistics

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromRef<T> for T
where T: Clone,

source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

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

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

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
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,