hll

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: MIT Imports: 4 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 New

func New(stderr float64) *Counter

New creates a new HyperLogLog counter.

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.

type Group

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

Group represents a group of counters.

func NewGroup

func NewGroup(stderr float64) *Group

NewGroup creates a new group of counters.

func (*Group) New

func (a *Group) New() *Counter

New creates a new counter.

func (*Group) Result

func (a *Group) 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