Model

Struct Model 

Source
pub struct Model {
    pub sigma: f64,
    pub kappa: f64,
    pub lambda: f64,
}
Expand description

A Universal Scalability Law model.

Can be built from an explicit slice of Measurement instances via Model::build or via collect on an iterator of Measurement instances or measurement tuples:

let m: usl::Model = vec![
    (10, 30.0),
    (20, 80.0),
    (30, 100.0),
    (40, 140.0),
    (50, 160.0),
    (60, 222.0),
].iter().collect();

Fields§

§sigma: f64

The model’s coefficient of contention, σ.

§kappa: f64

The model’s coefficient of crosstalk/coherency, κ.

§lambda: f64

The model’s coefficient of performance, λ.

Implementations§

Source§

impl Model

Source

pub fn build(measurements: &[Measurement]) -> Model

Build a model whose parameters are generated from the given measurements.

Finds a set of coefficients for the equation y = λx/(1+σ(x-1)+κx(x-1)) which best fit the observed values using unconstrained least-squares regression. The resulting values for λ, κ, and σ are the parameters of the returned model.

Source

pub fn throughput_at_concurrency(&self, n: u32) -> f64

Calculate the expected throughput given a number of concurrent events, X(N).

See “Practical Scalability Analysis with the Universal Scalability Law, Equation 3”.

Source

pub fn latency_at_concurrency(&self, n: u32) -> f64

Calculate the expected mean latency given a number of concurrent events, R(N).

See “Practical Scalability Analysis with the Universal Scalability Law, Equation 6”.

Source

pub fn max_concurrency(&self) -> u32

Calculate the maximum expected number of concurrent events the system can handle, N{max}.

See “Practical Scalability Analysis with the Universal Scalability Law, Equation 4”.

Source

pub fn max_throughput(&self) -> f64

Calculate the maximum expected throughput the system can handle, X{max}.

Source

pub fn latency_at_throughput(&self, x: f64) -> f64

Calculate the expected mean latency given a throughput, R(X).

See “Practical Scalability Analysis with the Universal Scalability Law, Equation 8”.

Source

pub fn throughput_at_latency(&self, r: Duration) -> f64

Calculate the expected throughput given a mean latency, X(R).

See “Practical Scalability Analysis with the Universal Scalability Law, Equation 9”.

Source

pub fn concurrency_at_latency(&self, r: Duration) -> f64

Calculate the expected number of concurrent events at a particular mean latency, N(R).

See “Practical Scalability Analysis with the Universal Scalability Law, Equation 10”.

Source

pub fn concurrency_at_throughput(&self, x: f64) -> f64

Calculate the expected number of concurrent events at a particular throughput, N(X).

Source

pub fn is_contention_constrained(&self) -> bool

Whether or not the system is constrained by contention effects.

Source

pub fn is_coherency_constrained(&self) -> bool

Whether or not the system is constrained by coherency effects.

Source

pub fn is_limitless(&self) -> bool

Whether or not the system is linearly scalable.

Trait Implementations§

Source§

impl Clone for Model

Source§

fn clone(&self) -> Model

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Model

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'a> FromIterator<&'a (Duration, f64)> for Model

Source§

fn from_iter<T: IntoIterator<Item = &'a (Duration, f64)>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl<'a> FromIterator<&'a (Duration, u32)> for Model

Source§

fn from_iter<T: IntoIterator<Item = &'a (Duration, u32)>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl<'a> FromIterator<&'a (f64, Duration)> for Model

Source§

fn from_iter<T: IntoIterator<Item = &'a (f64, Duration)>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl<'a> FromIterator<&'a (f64, u32)> for Model

Source§

fn from_iter<T: IntoIterator<Item = &'a (f64, u32)>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl<'a> FromIterator<&'a (u32, Duration)> for Model

Source§

fn from_iter<T: IntoIterator<Item = &'a (u32, Duration)>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl<'a> FromIterator<&'a (u32, f64)> for Model

Source§

fn from_iter<T: IntoIterator<Item = &'a (u32, f64)>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl FromIterator<Measurement> for Model

Source§

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

Creates a value from an iterator. Read more
Source§

impl Copy for Model

Auto Trait Implementations§

§

impl Freeze for Model

§

impl RefUnwindSafe for Model

§

impl Send for Model

§

impl Sync for Model

§

impl Unpin for Model

§

impl UnwindSafe for Model

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.