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: f64The model’s coefficient of contention, σ.
kappa: f64The model’s coefficient of crosstalk/coherency, κ.
lambda: f64The model’s coefficient of performance, λ.
Implementations§
Source§impl Model
impl Model
Sourcepub fn build(measurements: &[Measurement]) -> Model
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.
Sourcepub fn throughput_at_concurrency(&self, n: u32) -> f64
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”.
Sourcepub fn latency_at_concurrency(&self, n: u32) -> f64
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”.
Sourcepub fn max_concurrency(&self) -> u32
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”.
Sourcepub fn max_throughput(&self) -> f64
pub fn max_throughput(&self) -> f64
Calculate the maximum expected throughput the system can handle, X{max}.
Sourcepub fn latency_at_throughput(&self, x: f64) -> f64
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”.
Sourcepub fn throughput_at_latency(&self, r: Duration) -> f64
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”.
Sourcepub fn concurrency_at_latency(&self, r: Duration) -> f64
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”.
Sourcepub fn concurrency_at_throughput(&self, x: f64) -> f64
pub fn concurrency_at_throughput(&self, x: f64) -> f64
Calculate the expected number of concurrent events at a particular throughput, N(X).
Sourcepub fn is_contention_constrained(&self) -> bool
pub fn is_contention_constrained(&self) -> bool
Whether or not the system is constrained by contention effects.
Sourcepub fn is_coherency_constrained(&self) -> bool
pub fn is_coherency_constrained(&self) -> bool
Whether or not the system is constrained by coherency effects.
Sourcepub fn is_limitless(&self) -> bool
pub fn is_limitless(&self) -> bool
Whether or not the system is linearly scalable.