class

Filament::Stats::SpaceSavingSketch

Inherits Reference < Object

Space-Saving stream sketch finding top-K frequent elements in streaming traffic

Constructors

new(k : Int32 = 100)
Source

Instance methods

heavy_hitter?(key : String, phi : Float64 = 0.05) : Bool

Checks if an item represents a true heavy hitter (exceeds threshold phi of total traffic)

Source
items
Source
top(n : Int32 = 10) : Array(HeavyHitterItem)

Returns top N frequent items sorted by frequency count

Source
total_volume
Source
update(key : String, weight : UInt64 = 1_u64) : Nil

Updates sketch with observed item and weight (bytes or packet count)

Source