topkapi

package module
v0.0.0-...-faec3f3 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2020 License: MIT Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

topkapi

Topkapi: Parallel and Fast Sketches for Finding Top-K Frequent Elements

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalHeavyHitter

type LocalHeavyHitter struct {
	Key   string
	Count uint64
}

type Sketch

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

func New

func New(delta, epsilon float64) (*Sketch, error)

New creates a new Topkapi Sketch with given error rate and confidence. Accuracy guarantees will be made in terms of a pair of user specified parameters, ε and δ, meaning that the error in answering a query is within a factor of ε with probability 1-δ

func NewTopK

func NewTopK(k, approxCorpusSize uint64, delta float64) (*Sketch, error)

NewTopK creates a sketch suitable for finding TopK in a corpus of a given size, with an error rate of delta.

func (*Sketch) Delta

func (sk *Sketch) Delta() float64

Delta is the probability for a measurement to be outside the epsilon range

func (*Sketch) Epsilon

func (sk *Sketch) Epsilon() float64

Epsilon is the approximate error range factor.

func (*Sketch) Insert

func (sk *Sketch) Insert(key string, count uint64)

Insert ...

func (*Sketch) Marshal

func (sk *Sketch) Marshal() ([]byte, error)

Marshal ...

func (*Sketch) Merge

func (sk *Sketch) Merge(other *Sketch) error

Merge ...

func (*Sketch) Result

func (sk *Sketch) Result(threshold uint64) []LocalHeavyHitter

Result ...

func (*Sketch) Unmarshal

func (sk *Sketch) Unmarshal(p []byte) error

Unmarshal ...

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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