Filament::Stats::SpaceSavingSketch
Inherits Reference < Object
Space-Saving stream sketch finding top-K frequent elements in streaming traffic
Constructors
new(k : Int32 = 100)
SourceInstance 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)
items
Sourcetop(n : Int32 = 10) : Array(HeavyHitterItem)
Returns top N frequent items sorted by frequency count
total_volume
Sourceupdate(key : String, weight : UInt64 = 1_u64) : Nil
Updates sketch with observed item and weight (bytes or packet count)