Help us shape the future of Go! Take the 2026 Go Developer Survey

labelset

package
v1.21.1 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LabelSetTracker

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

func NewLabelSetTracker

func NewLabelSetTracker() *LabelSetTracker

NewLabelSetTracker initializes a LabelSetTracker to keep track of active labelset limits.

func (*LabelSetTracker) Track

func (m *LabelSetTracker) Track(userId string, hash uint64, labelSet labels.Labels)

Track accepts userID, label set and hash of the label set limit.

func (*LabelSetTracker) UpdateMetrics

func (m *LabelSetTracker) UpdateMetrics(userSet map[string]map[uint64]struct{}, deleteMetricFunc func(user, labelSetStr string, removeUser bool))

UpdateMetrics cleans up dangling user and label set from the tracker as well as metrics. It takes a function for user to customize the metrics cleanup logic when either a user or a specific label set is removed. If a user is removed then removeUser is set to true.

Jump to

Keyboard shortcuts

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