applicationprofile

package
v0.3.10 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultPreStopCacheSize is the default maximum number of containers to track
	DefaultPreStopCacheSize = 1000
	// DefaultPreStopCacheTTL is the default time-to-live for cache entries
	DefaultPreStopCacheTTL = 5 * time.Minute
)

Variables

This section is empty.

Functions

func AP

func AP(objectCache objectcache.ObjectCache, config config.Config) cel.EnvOption

func New

func New(objectCache objectcache.ObjectCache, config config.Config) libraries.Library

Types

type PreStopHookCache added in v0.3.8

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

PreStopHookCache tracks which containers have had their preStop hook triggered. It uses an LRU cache with time-based expiration to automatically clean up old entries and limit memory usage.

func GetPreStopHookCache added in v0.3.8

func GetPreStopHookCache() *PreStopHookCache

GetPreStopHookCache returns the global preStop hook cache singleton. The cache is lazily initialized with default settings on first call.

func NewPreStopHookCache added in v0.3.8

func NewPreStopHookCache(maxSize int, ttl time.Duration) *PreStopHookCache

NewPreStopHookCache creates a new preStop hook cache with the specified maximum size and TTL duration.

func (*PreStopHookCache) Len added in v0.3.8

func (c *PreStopHookCache) Len() int

Len returns the current number of entries in the cache.

func (*PreStopHookCache) MarkPreStopTriggered added in v0.3.8

func (c *PreStopHookCache) MarkPreStopTriggered(containerID string)

MarkPreStopTriggered marks that the preStop hook was triggered for the given container ID. The entry will automatically expire after the cache's TTL duration.

func (*PreStopHookCache) Remove added in v0.3.8

func (c *PreStopHookCache) Remove(containerID string)

Remove removes a container ID from the cache.

func (*PreStopHookCache) WasPreStopTriggered added in v0.3.8

func (c *PreStopHookCache) WasPreStopTriggered(containerID string) bool

WasPreStopTriggered returns true if the preStop hook was triggered for the given container ID and the entry has not yet expired.

Jump to

Keyboard shortcuts

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