Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HeavyKeeper ¶
type HeavyKeeper struct {
// contains filtered or unexported fields
}
HeavyKeeper is a probabilistic data structure for top-k items.
func New ¶
func New(depth, width int, decay float64) *HeavyKeeper
New creates a new HeavyKeeper. depth: number of arrays (hash functions) width: number of buckets per array decay: probability of decay (0.9 means 90% chance to decay)
func (*HeavyKeeper) Query ¶
func (hk *HeavyKeeper) Query(key []byte) uint32
Query returns the estimated count for the key.
Click to show internal directories.
Click to hide internal directories.