pub struct MetricAggregator { /* private fields */ }Expand description
Aggregates per-frame metrics and computes derived statistics.
Implementations§
Source§impl MetricAggregator
impl MetricAggregator
Sourcepub fn new(session_id: u64, start_time_ms: i64, source_fps: f32) -> Self
pub fn new(session_id: u64, start_time_ms: i64, source_fps: f32) -> Self
Creates a new aggregator for session_id starting at start_time_ms.
Sourcepub fn counters(&self) -> Arc<TranscodeMetrics>
pub fn counters(&self) -> Arc<TranscodeMetrics>
Returns a shared reference to the atomic counters.
Sourcepub fn update_frame(&mut self, metric: FrameMetric)
pub fn update_frame(&mut self, metric: FrameMetric)
Records a new frame metric, updates ring buffer and atomic counters.
Sourcepub fn compute_rate(&self, current_time_ms: i64) -> EncodingRate
pub fn compute_rate(&self, current_time_ms: i64) -> EncodingRate
Computes current EncodingRate given the current wall-clock time.
Sourcepub fn rolling_avg_psnr(&self, window: usize) -> f32
pub fn rolling_avg_psnr(&self, window: usize) -> f32
Computes the rolling average PSNR over the last window frame metrics.
Clamps window to the available ring-buffer size.
Sourcepub fn export_csv(&self) -> String
pub fn export_csv(&self) -> String
Exports all per-frame metrics in CSV format.
Columns: frame_number,frame_type,encode_time_us,output_bits,psnr
Sourcepub fn to_prometheus(&self, session_id: u64) -> String
pub fn to_prometheus(&self, session_id: u64) -> String
Exports current session metrics in Prometheus text exposition format.
All metric names are prefixed oximedia_transcode_.
Sourcepub fn session(&self) -> &SessionMetrics
pub fn session(&self) -> &SessionMetrics
Returns a reference to the session metrics.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MetricAggregator
impl RefUnwindSafe for MetricAggregator
impl Send for MetricAggregator
impl Sync for MetricAggregator
impl Unpin for MetricAggregator
impl UnsafeUnpin for MetricAggregator
impl UnwindSafe for MetricAggregator
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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