pub struct BenchMeasurement {
pub engine: String,
pub format: String,
pub throughput_samples: Vec<f64>,
pub ttft_samples: Vec<f64>,
pub throughput_stats: Option<BenchStats>,
pub ttft_stats: Option<BenchStats>,
pub gpu_util: Option<f64>,
pub gpu_mem_mb: Option<f64>,
}Expand description
Single benchmark measurement with multi-iteration statistics
Fields§
§engine: StringEngine name (APR, Ollama, llama.cpp)
format: StringFormat (GGUF, APR)
throughput_samples: Vec<f64>Throughput samples (tokens/second)
ttft_samples: Vec<f64>Time to first token samples (milliseconds)
throughput_stats: Option<BenchStats>Computed throughput statistics
ttft_stats: Option<BenchStats>Computed TTFT statistics
gpu_util: Option<f64>GPU utilization percentage (if available)
gpu_mem_mb: Option<f64>GPU memory used in MB (if available)
Implementations§
Source§impl BenchMeasurement
impl BenchMeasurement
Sourcepub fn add_throughput_sample(&mut self, tps: f64)
pub fn add_throughput_sample(&mut self, tps: f64)
Add a throughput sample
Sourcepub fn add_ttft_sample(&mut self, ttft_ms: f64)
pub fn add_ttft_sample(&mut self, ttft_ms: f64)
Add a TTFT sample
Sourcepub fn with_throughput(self, tps: f64) -> Self
pub fn with_throughput(self, tps: f64) -> Self
Set single throughput value (for backwards compatibility)
Sourcepub fn with_throughput_samples(self, samples: Vec<f64>) -> Self
pub fn with_throughput_samples(self, samples: Vec<f64>) -> Self
Set throughput from multiple iterations
Sourcepub fn with_ttft_samples(self, samples: Vec<f64>) -> Self
pub fn with_ttft_samples(self, samples: Vec<f64>) -> Self
Set TTFT from multiple iterations
Sourcepub fn compute_stats(&mut self, outlier_threshold: f64)
pub fn compute_stats(&mut self, outlier_threshold: f64)
Compute statistics from samples
Sourcepub fn mean_throughput(&self) -> f64
pub fn mean_throughput(&self) -> f64
Get mean throughput
Trait Implementations§
Source§impl Clone for BenchMeasurement
impl Clone for BenchMeasurement
Source§fn clone(&self) -> BenchMeasurement
fn clone(&self) -> BenchMeasurement
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BenchMeasurement
impl RefUnwindSafe for BenchMeasurement
impl Send for BenchMeasurement
impl Sync for BenchMeasurement
impl Unpin for BenchMeasurement
impl UnwindSafe for BenchMeasurement
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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