hyperloglog

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

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) Add

func (h *HyperLogLog) Add(data []byte)

Add adds the data to the set.

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.

Jump to

Keyboard shortcuts

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