Skip to main content

MeasureLifecycleExt

Trait MeasureLifecycleExt 

Source
pub trait MeasureLifecycleExt<This>
where This: HttpServerAlg, This::Error: Into<LifecycleError>,
{ // 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§

Source

fn time_closing<Compile>( self, compile: Compile, closing: Closing, rounds: u64, ) -> impl Future<Output = Duration>
where Compile: FnMut() -> This::Program,

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.

Source

fn time_handover<Compile>( self, compile: Compile, load: Handover, rounds: u64, ) -> impl Future<Output = Duration>
where Compile: FnMut() -> This::Program,

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§

Source§

impl<This> MeasureLifecycleExt<This> for This
where This: HttpServerAlg, This::Error: Into<LifecycleError>,

Measures the lifecycle of a concrete HTTP server.