cache

package
v5.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 29, 2025 License: MIT Imports: 3 Imported by: 0 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.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TagMapKey

func TagMapKey(tags map[string]string) uint64

TagMapKey generates a new key based on tags.

Types

type StringInterner

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

StringInterner interns strings.

func NewStringInterner

func NewStringInterner() *StringInterner

NewStringInterner creates a new StringInterner.

func (*StringInterner) Intern

func (i *StringInterner) Intern(s string) string

Intern interns s.

type TagCache

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

TagCache is an identity.Accumulator-based tag cache.

func NewTagCache

func NewTagCache() *TagCache

NewTagCache creates a new TagCache.

func (*TagCache) Get

func (c *TagCache) Get(key uint64) ([]m3thrift.MetricTag, bool)

Get returns the cached value for key.

func (*TagCache) Len

func (c *TagCache) Len() int

Len returns the size of the cache,

func (*TagCache) Set

func (c *TagCache) Set(key uint64, tslice []m3thrift.MetricTag) []m3thrift.MetricTag

Set attempts to set the value of key as tslice, returning either tslice or the pre-existing value if found.

Jump to

Keyboard shortcuts

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