Documentation ¶
Index ¶
- type LfuMessageCache
- func (l LfuMessageCache) Get(severity alertingv1.OpniSeverity, key string) (*alertingv1.MessageInstance, bool)
- func (l LfuMessageCache) Key(msgMeta MessageMetadata) string
- func (l LfuMessageCache) PartitionedKeys() map[alertingv1.OpniSeverity][]string
- func (l LfuMessageCache) Set(severity alertingv1.OpniSeverity, key string, alert config.Alert)
- type MessageCache
- type MessageMetadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LfuMessageCache ¶
type LfuMessageCache map[alertingv1.OpniSeverity]*lru.TwoQueueCache[string, *alertingv1.MessageInstance]
func (LfuMessageCache) Get ¶
func (l LfuMessageCache) Get(severity alertingv1.OpniSeverity, key string) (*alertingv1.MessageInstance, bool)
func (LfuMessageCache) Key ¶
func (l LfuMessageCache) Key(msgMeta MessageMetadata) string
func (LfuMessageCache) PartitionedKeys ¶
func (l LfuMessageCache) PartitionedKeys() map[alertingv1.OpniSeverity][]string
func (LfuMessageCache) Set ¶
func (l LfuMessageCache) Set(severity alertingv1.OpniSeverity, key string, alert config.Alert)
type MessageCache ¶
type MessageCache[L comparable, T any] interface { Get(layer L, key string) (T, bool) Set(layer L, key string, msg config.Alert) // returns all keys ordered by (severity, heuristic(frequency, recency) ) PartitionedKeys() map[L][]string Key(msg MessageMetadata) string }
layered LFU cache L : Layer T : message contents
func NewLFUMessageCache ¶
func NewLFUMessageCache(lub int) MessageCache[alertingv1.OpniSeverity, *alertingv1.MessageInstance]
Click to show internal directories.
Click to hide internal directories.