import "github.com/andy2046/gopie/pkg/hyperloglog"
Package hyperloglog implements HyperLogLog cardinality estimation.
- type HyperLogLog
- func New(m uint) (*HyperLogLog, error)
- func NewGuess(stdErr float64) (*HyperLogLog, error)
- func (h *HyperLogLog) Add(data []byte)
- func (h *HyperLogLog) Count() uint64
- func (h *HyperLogLog) Merge(other *HyperLogLog) error
- func (h *HyperLogLog) Reset()
- func (h *HyperLogLog) SetHash(hasher hash.Hash32)
type HyperLogLog struct {
// contains filtered or unexported fields
}
HyperLogLog probabilistic data struct for cardinality estimation.
func New(m uint) (*HyperLogLog, error)
New creates a new HyperLogLog with m
registers bucket.
m
should be a power of two.
func NewGuess(stdErr float64) (*HyperLogLog, error)
NewGuess creates a new HyperLogLog within the given standard error.
func (h *HyperLogLog) Add(data []byte)
Add adds the data to the set.
func (h *HyperLogLog) Count() uint64
Count returns the estimated cardinality of the set.
func (h *HyperLogLog) Merge(other *HyperLogLog) error
Merge combines the HyperLogLog with the other.
func (h *HyperLogLog) Reset()
Reset restores the HyperLogLog to its original state.
func (h *HyperLogLog) SetHash(hasher hash.Hash32)
SetHash sets the hashing function.
Generated by godoc2md