Struct usl::Measurement[][src]

pub struct Measurement {
    pub n: f64,
    pub x: f64,
    pub r: f64,
}
Expand description

A simultaneous measurement of at least two of the parameters of Little’s Law: concurrency, throughput, and latency. The third parameter is inferred from the other two.

Measurement instances can be created from pairs of dimensional types: u32 for the number of concurrent events, f64 for the average rate of events, and Duration for the average duration of events:

use usl::Measurement;
use std::time::Duration;

let m: Measurement = (30, 1000.0).into();
let m: Measurement = (1000.0, 30).into();
let m: Measurement = (30, Duration::from_millis(200)).into();
let m: Measurement = (Duration::from_millis(200), 30).into();
let m: Measurement = (1000.0, Duration::from_millis(200)).into();
let m: Measurement = (Duration::from_millis(200), 1000.0).into();

Fields

n: f64

The average number of concurrent events.

x: f64

The long-term arrival rate of events, in events/sec.

r: f64

The average duration of events, in seconds.

Implementations

impl Measurement[src]

pub fn concurrency_and_latency(n: u32, r: Duration) -> Measurement[src]

Create a measurement of a system’s latency at a given level of concurrency. The throughput of the system is derived via Little’s Law.

pub fn concurrency_and_throughput(n: u32, x: f64) -> Measurement[src]

Create a measurement of a system’s throughput at a given level of concurrency. The latency of the system is derived via Little’s Law.

pub fn throughput_and_latency(x: f64, r: Duration) -> Measurement[src]

Create a measurement of a system’s latency at a given level of throughput. The concurrency of the system is derived via Little’s Law.

Trait Implementations

impl Clone for Measurement[src]

fn clone(&self) -> Measurement[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Measurement[src]

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

Formats the value using the given formatter. Read more

impl From<(Duration, f64)> for Measurement[src]

fn from(v: (Duration, f64)) -> Self[src]

Performs the conversion.

impl From<(Duration, u32)> for Measurement[src]

fn from(v: (Duration, u32)) -> Self[src]

Performs the conversion.

impl From<(f64, Duration)> for Measurement[src]

fn from(v: (f64, Duration)) -> Self[src]

Performs the conversion.

impl From<(f64, u32)> for Measurement[src]

fn from(v: (f64, u32)) -> Self[src]

Performs the conversion.

impl From<(u32, Duration)> for Measurement[src]

fn from(v: (u32, Duration)) -> Self[src]

Performs the conversion.

impl From<(u32, f64)> for Measurement[src]

fn from(v: (u32, f64)) -> Self[src]

Performs the conversion.

impl FromIterator<Measurement> for Model[src]

fn from_iter<T: IntoIterator<Item = Measurement>>(iter: T) -> Self[src]

Creates a value from an iterator. Read more

impl Copy for Measurement[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.