Help us shape the future of Go! Take the 2026 Go Developer Survey

topkcounter

package module
v0.0.0-...-9433f42 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2014 License: MIT Imports: 3 Imported by: 0

README

TopK Counter

January 20, 2014

See https://github.com/addthis/stream-lib

© ChannelMeter

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counted

type Counted interface {
	Count() int
	Value() string
}

type TopKCounter

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

func NewTopKCounter

func NewTopKCounter(capacity int64) *TopKCounter

func NewTopKCounterBytes

func NewTopKCounterBytes(buf []byte) (c *TopKCounter, err error)

func (*TopKCounter) Bytes

func (c *TopKCounter) Bytes() []byte

func (*TopKCounter) Offer

func (c *TopKCounter) Offer(item string) bool

func (*TopKCounter) OfferN

func (c *TopKCounter) OfferN(item string, increment int) bool

func (*TopKCounter) OfferReturnAll

func (c *TopKCounter) OfferReturnAll(item string, increment int) (bool, string)

func (*TopKCounter) OfferReturnDropped

func (c *TopKCounter) OfferReturnDropped(item string, increment int) string

func (*TopKCounter) Peek

func (c *TopKCounter) Peek(k int) []string

func (*TopKCounter) Size

func (c *TopKCounter) Size() int

func (*TopKCounter) TopK

func (c *TopKCounter) TopK(k int) []Counted

Directories

Path Synopsis
Package list implements a doubly linked list.
Package list implements a doubly linked list.

Jump to

Keyboard shortcuts

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