pub struct FrameTimeStats { /* private fields */ }Expand description
Frame time statistics with percentile analysis.
Based on Dean & Barroso (2013): “The Tail at Scale” - p99 latency is critical for interactive systems like games.
§Example
use jugar_web::loadtest::FrameTimeStats;
let mut stats = FrameTimeStats::new();
for i in 0..100 {
stats.record(i as f64 * 0.1 + 5.0);
}
let report = stats.report();
assert!(report.p50 < report.p99);Implementations§
Source§impl FrameTimeStats
impl FrameTimeStats
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create with pre-allocated capacity.
Sourcepub fn percentile(&self, p: f64) -> f64
pub fn percentile(&self, p: f64) -> f64
Get percentile value (0-100).
Common percentiles: p50 (median), p90, p95, p99.
Sourcepub fn report(&self) -> FrameTimeReport
pub fn report(&self) -> FrameTimeReport
Generate a summary report.
Trait Implementations§
Source§impl Clone for FrameTimeStats
impl Clone for FrameTimeStats
Source§fn clone(&self) -> FrameTimeStats
fn clone(&self) -> FrameTimeStats
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 moreSource§impl Debug for FrameTimeStats
impl Debug for FrameTimeStats
Auto Trait Implementations§
impl Freeze for FrameTimeStats
impl RefUnwindSafe for FrameTimeStats
impl Send for FrameTimeStats
impl Sync for FrameTimeStats
impl Unpin for FrameTimeStats
impl UnwindSafe for FrameTimeStats
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