pub(crate) struct Measured {
pub(crate) cpu_ms: f64,
pub(crate) wall_ms: f64,
pub(crate) frames: u64,
pub(crate) bytes: u64,
pub(crate) turns: u64,
pub(crate) messages: u64,
pub(crate) asks: u32,
pub(crate) pid: u32,
}Expand description
What one arm moved, and what it cost.
The denominator is not decoration: it is what tells a reader that the arm saw a conversation at all.
Fields§
§cpu_ms: f64§wall_ms: f64§frames: u64§bytes: u64§turns: u64§messages: u64§asks: u32§pid: u32The PID this arm was charged to, echoed from --pid.
Echoed rather than verified: nothing here checks that the process owns the port, so a recycled PID is charged and then named as the server. It is an address for a reader to check, not a claim.
Implementations§
Source§impl Measured
impl Measured
Sourcepub(crate) fn report(
&self,
arm: &str,
idle: &Measured,
window: Option<f64>,
) -> String
pub(crate) fn report( &self, arm: &str, idle: &Measured, window: Option<f64>, ) -> String
The line one arm reports.
Every row carries the build it was MEASURED WITH, the PID it charged, and - on the idle row, which every other arm is charged against - the window ASKED FOR rather than the one the clock measured, so a reader recomputing the charge from a lifted row gets a number slightly under the printed one. The divisor is the idle arm’s own wall time, which no row prints; the gap is milliseconds normally and wider under load, which is when someone is most likely to be recomputing.
The client’s build moves two of the figures, and the charge is only
as clean as the baseline. wall_ms is the client’s own and a debug
client reads 2,695 ms where a release one reads 1,250 on the same
server. charged_cpu_ms is cpu - idle_cpu * share, so where the
idle arm reads 0.0 the charge is insensitive to that build; where the
server has background work the baseline is non-zero, share moves
with the client’s wall, and the charge moves with it.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Measured
impl RefUnwindSafe for Measured
impl Send for Measured
impl Sync for Measured
impl Unpin for Measured
impl UnsafeUnpin for Measured
impl UnwindSafe for Measured
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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