Documentation ¶
Index ¶
Constants ¶
View Source
const DecayTableLen = 1 << 8
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HeavyKeeper ¶
type HeavyKeeper struct {
// contains filtered or unexported fields
}
HeavyKeeper algorithm structure.
See: https://www.usenix.org/system/files/conference/atc18/atc18-gong.pdf
func (*HeavyKeeper) Expelled ¶
func (hk *HeavyKeeper) Expelled() <-chan Item
func (*HeavyKeeper) Fading ¶
func (hk *HeavyKeeper) Fading()
func (*HeavyKeeper) List ¶
func (hk *HeavyKeeper) List() []Item
func (*HeavyKeeper) Total ¶
func (hk *HeavyKeeper) Total() uint64
type TopK ¶
type TopK interface { // Add adds an item to the list of top k. // It returns two values: // - The first return value represents if the item had been added successfully. // - The second return value is the expelled item if any item was expelled. Add(item string, incr uint32) (string, bool) // Lists returns all the items in the top k. List() []Item // Total returns the total count of the items. Total() uint64 // Expelled watches at the expelled items. Expelled() <-chan Item // Fading reduces count for the specified scene. Fading() }
TopK algorithm interface.
Click to show internal directories.
Click to hide internal directories.