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)
SourceInstance 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).
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.
total_dropped
Total number of items that were overwritten before the consumer could read them. This is data loss and should ideally be zero.
total_pushed
Total number of items successfully pushed into the buffer since creation (including ones later overwritten)
watermark_percent(capacity : UInt32) : Float64
Percentage of capacity that was used at the peak.