cms

package
v0.3.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CMSketch

type CMSketch struct {
	// contains filtered or unexported fields
}

CMSketch is a Count-Min sketch implementation with 4-bit counters, heavily based on Damian Gryski's CM4 1.

func NewCMSketch

func NewCMSketch(numCounters int64) *CMSketch

func (*CMSketch) Clear

func (s *CMSketch) Clear()

Clear zeroes all counters.

func (*CMSketch) Estimate

func (s *CMSketch) Estimate(hashed uint64) int64

Estimate returns the value of the specified key.

func (*CMSketch) Increment

func (s *CMSketch) Increment(hashed uint64)

Increment increments the count(ers) for the specified key.

func (*CMSketch) Reset

func (s *CMSketch) Reset()

Reset halves all counter values.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL