apiserverk8s.io/apiserver/pkg/util/configmetrics Index | Files

package configmetrics

import "k8s.io/apiserver/pkg/util/configmetrics"

Index

Functions

func NewConfigInfoCustomCollector

func NewConfigInfoCustomCollector(desc *metrics.Desc, hashProvider HashProvider) metrics.StableCollector

NewConfigInfoCustomCollector creates a custom collector for config hash info metrics. This eliminates the need for state management and locks by collecting metrics on demand.

Types

type AtomicHashProvider

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

AtomicHashProvider implements HashProvider using a single atomic pointer to a slice

func NewAtomicHashProvider

func NewAtomicHashProvider() *AtomicHashProvider

NewAtomicHashProvider creates a new atomic hash provider

func (*AtomicHashProvider) GetCurrentHashes

func (h *AtomicHashProvider) GetCurrentHashes() []string

func (*AtomicHashProvider) SetHashes

func (h *AtomicHashProvider) SetHashes(hashes ...string)

type HashProvider

type HashProvider interface {
	GetCurrentHashes() []string
	SetHashes(hashes ...string)
}

HashProvider is an interface for getting the current config hash values

Source Files

info_collector.go

Version
v0.35.0-alpha.0
Published
Aug 6, 2025
Platform
js/wasm
Imports
4 packages
Last checked
1 hour ago

Tools for package owners.