timedtagmap

package
v0.0.0-...-b8a1a0e Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INVALID_TAG_ID     = -1
	ALL_TAG_ID_INVALID = -1
	MIN_TTL            = 4  // 需要保证足够大的时间窗口,避免时间乱序时计算错误
	MAX_TTL            = 32 // 需要用32bit表示是否invalid
)

Variables

This section is empty.

Functions

func ReleaseTagIDSlice

func ReleaseTagIDSlice(ti []TagID)

Types

type TTMCounter

type TTMCounter struct {
	Hit      uint64 `statsd:"hit,count"`
	Miss     uint64 `statsd:"miss,count"`
	Expire   uint64 `statsd:"expire,count"`
	TagCount uint64 `statsd:"tag_count,gauge"`
	Cap      uint64 `statsd:"cap,gauge"`
}

type TagID

type TagID int32

func AcquireTagIDSlice

func AcquireTagIDSlice(ttl int) []TagID

type TagIDPair

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

type TimedTagMap

type TimedTagMap struct {
	utils.Closable
	// contains filtered or unexported fields
}

func NewTimedTagMap

func NewTimedTagMap(name string, thread int, ttl int) *TimedTagMap

func (*TimedTagMap) GetCounter

func (m *TimedTagMap) GetCounter() interface{}

func (*TimedTagMap) GetID

func (m *TimedTagMap) GetID(tag string, timestamp int) int

Jump to

Keyboard shortcuts

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