hll

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package hll provides the analysis of a near-optimal cardinality estimation algorithm.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

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

Counter represents a HyperLogLog counter.

func Merge

func Merge(cs ...*Counter) *Counter

Merge merges the cloned counters.

func New

func New(stderr float64) *Counter

New creates a new HyperLogLog counter.

func (*Counter) Clone

func (a *Counter) Clone() *Counter

Clone clones a counter without data that can be merged later.

func (*Counter) CountBytes

func (a *Counter) CountBytes(v []byte)

CountBytes counts the bytes type key.

func (*Counter) CountString

func (a *Counter) CountString(v string)

CountString counts the string type key.

func (*Counter) CountUint

func (a *Counter) CountUint(v uint64)

CountUint counts the uint64 type key.

func (*Counter) Result

func (a *Counter) Result() float64

Result returns the estimation result.

Jump to

Keyboard shortcuts

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