cache

package
v0.11.2-rc1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LfuMessageCache

func (LfuMessageCache) Get

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

type MessageMetadata

type MessageMetadata struct {
	IsAlarm           bool
	Uuid              string
	GroupDedupeKey    string
	Fingerprint       string
	SourceFingerprint string
	Severity          int32
}

Jump to

Keyboard shortcuts

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