struct

Filament::Capture::RingBufferStats

Inherits Struct < Value < Object

Keeps running statistics about buffer utilization. Useful for diagnosing performance problems: if total_dropped is high, you need either a bigger buffer or a faster consumer.

Constructors

new(total_pushed : UInt64 = 0_u64, total_dropped : UInt64 = 0_u64, high_watermark : UInt32 = 0_u32, total_popped : UInt64 = 0_u64)
Source

Instance methods

drop_rate

Drop rate as a fraction between 0.0 and 1.0. Returns 0.0 if nothing has been pushed yet (to avoid division by zero).

Source
high_watermark

The maximum number of items that were in the buffer at any one time. If this equals capacity, the buffer filled up at some point.

Source
to_s(io : IO) : Nil

Human-readable summary for logging.

Source
total_dropped

Total number of items that were overwritten before the consumer could read them. This is data loss and should ideally be zero.

Source
total_popped

Total number of items successfully popped from the buffer

Source
total_pushed

Total number of items successfully pushed into the buffer since creation (including ones later overwritten)

Source
watermark_percent(capacity : UInt32) : Float64

Percentage of capacity that was used at the peak.

Source