Documentation ¶
Overview ¶
Package hyperloglog implements HyperLogLog cardinality estimation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HyperLogLog ¶
type HyperLogLog struct {
// contains filtered or unexported fields
}
HyperLogLog probabilistic data struct for cardinality estimation.
func New ¶
func New(m uint) (*HyperLogLog, error)
New creates a new HyperLogLog with `m` registers bucket. `m` should be a power of two.
func NewGuess ¶
func NewGuess(stdErr float64) (*HyperLogLog, error)
NewGuess creates a new HyperLogLog within the given standard error.
func (*HyperLogLog) Count ¶
func (h *HyperLogLog) Count() uint64
Count returns the estimated cardinality of the set.
func (*HyperLogLog) Merge ¶
func (h *HyperLogLog) Merge(other *HyperLogLog) error
Merge combines the HyperLogLog with the other.
func (*HyperLogLog) Reset ¶
func (h *HyperLogLog) Reset()
Reset restores the HyperLogLog to its original state.
func (*HyperLogLog) SetHash ¶
func (h *HyperLogLog) SetHash(hasher hash.Hash32)
SetHash sets the hashing function.
Click to show internal directories.
Click to hide internal directories.