pub struct Plan {
pub calls: usize,
pub rate: f64,
pub most_in_flight: usize,
}Expand description
How much load to apply.
Fields§
§calls: usizeHow many calls to place in total.
rate: f64How many to start per second.
The arrival rate, not the concurrency: a rate of 50 with calls lasting two seconds settles at about a hundred in progress. Driving by rate rather than by concurrency is what makes a run reproducible — a harness that keeps N in flight speeds up when the system under test slows down, which is the opposite of a load test.
most_in_flight: usizeThe most to have in progress at once, whatever the rate says.
A backstop, not a target. Without it, a system that has stopped answering entirely accumulates every call the plan asks for and the harness runs out of sockets before the thing it is testing does.
Implementations§
Source§impl Plan
impl Plan
Sourcepub fn interval(&self) -> Duration
pub fn interval(&self) -> Duration
The gap between two calls starting.
rate is a public field, so it can be anything a caller can write — and
Duration::from_secs_f64 panics on NaN or on a value too large to represent. A
denormal rate such as 1e-300 reaches the second case. A load harness that panics on
its own configuration is not a load harness, so both collapse to “as fast as possible”,
which is what a nonsensical rate most nearly means.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Plan
impl RefUnwindSafe for Plan
impl Send for Plan
impl Sync for Plan
impl Unpin for Plan
impl UnsafeUnpin for Plan
impl UnwindSafe for Plan
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more