pub trait MeasureLifecycleExt<This>{
// Required methods
fn time_closing<Compile>(
self,
compile: Compile,
closing: Closing,
rounds: u64,
) -> impl Future<Output = Duration>
where Compile: FnMut() -> This::Program;
fn time_handover<Compile>(
self,
compile: Compile,
load: Handover,
rounds: u64,
) -> impl Future<Output = Duration>
where Compile: FnMut() -> This::Program;
}Expand description
Measures the lifecycle of a concrete HTTP server.
Required Methods§
Sourcefn time_closing<Compile>(
self,
compile: Compile,
closing: Closing,
rounds: u64,
) -> impl Future<Output = Duration>
fn time_closing<Compile>( self, compile: Compile, closing: Closing, rounds: u64, ) -> impl Future<Output = Duration>
Closes rounds servers, each holding one request, and answers how long the closing took.
Opening a server and holding a request on it is setup, and so is dropping what a round left
behind. Only close, and end where Closing::ending states one, is timed.
A round drops its server rather than ending it, since close has already taken the address
back and whatever is still draining has nothing left to answer to. Ending it instead would
cost every round a drain it is not measuring.
Sourcefn time_handover<Compile>(
self,
compile: Compile,
load: Handover,
rounds: u64,
) -> impl Future<Output = Duration>
fn time_handover<Compile>( self, compile: Compile, load: Handover, rounds: u64, ) -> impl Future<Output = Duration>
Hands one address from a server to the next rounds times, and answers how long it took.
A handover is close then open on the same address: what a caller replacing a server
needs, and nothing more. Handover::RequestHeld holds its connection off the clock.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl<This> MeasureLifecycleExt<This> for This
Measures the lifecycle of a concrete HTTP server.