cache

package
v0.148.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	// Get returns the decision for the given id, and a boolean to indicate whether the key was found.
	// Returning a zero value for DecisionMetadata is valid for caches that do not store metadata.
	// Callers should check the boolean return value to determine if the key was found.
	Get(id pcommon.TraceID) (DecisionMetadata, bool)
	// Put sets the decision for a given id. If the key is already present, the decision is overwritten.
	Put(id pcommon.TraceID, metadata DecisionMetadata)
}

Cache is a cache implementation for the tailsamplingprocessor's decision cache.

func NewLRUDecisionCache

func NewLRUDecisionCache(size int) (Cache, error)

NewLRUDecisionCache returns a new lruDecisionCache. The size parameter indicates the amount of keys the cache will hold before it starts evicting the least recently used key.

func NewNopDecisionCache

func NewNopDecisionCache() Cache

type DecisionMetadata added in v0.143.0

type DecisionMetadata struct {
	PolicyName string
}

Jump to

Keyboard shortcuts

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