top

package
v0.0.0-...-226b666 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HkConfigDefault = HkConfig{
	Workers: 1,
	Width:   2048,
	Depth:   5,
	Decay:   0.9,
}

HkConfigDefault is standard config.

Functions

func GetHK

func GetHK(k uint32, cfg HkConfig) *heavykeeper.TopK

GetHK returns initialized TopK by top length (k) and cfg struct.

Types

type HkConfig

type HkConfig struct {
	Workers int
	Width   uint32
	Depth   uint32
	Decay   float64
}

HkConfig defines heavy keeper settings besides K.

type Item

type Item struct {
	Name  string
	Count uint64
}

Item is top List single item.

type List

type List []Item

List is list of top items.

func GetListFromHK

func GetListFromHK(k uint32, hk *heavykeeper.TopK) List

GetListFromHK return List from heavykeeper's []minheap.Node. So we can forget about heavykeeper and work with it`s results.

func (List) WriteResults

func (l List) WriteResults(w io.Writer) error

WriteResults prints List into nice table.

Jump to

Keyboard shortcuts

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