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: f64The average number of concurrent events.
x: f64The long-term arrival rate of events, in events/sec.
r: f64The average duration of events, in seconds.
Implementations§
Source§impl Measurement
impl Measurement
Sourcepub fn concurrency_and_latency(n: u32, r: Duration) -> Measurement
pub fn concurrency_and_latency(n: u32, r: Duration) -> Measurement
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.
Sourcepub fn concurrency_and_throughput(n: u32, x: f64) -> Measurement
pub fn concurrency_and_throughput(n: u32, x: f64) -> Measurement
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.
Sourcepub fn throughput_and_latency(x: f64, r: Duration) -> Measurement
pub fn throughput_and_latency(x: f64, r: Duration) -> Measurement
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§
Source§impl Clone for Measurement
impl Clone for Measurement
Source§fn clone(&self) -> Measurement
fn clone(&self) -> Measurement
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more