metricscollector

package
v1.23.14 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NumberOfEndpoints = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Subsystem: negControllerSubsystem,
			Name:      "number_of_endpoints",
			Help:      "The total number of endpoints",
		},
		[]string{"feature"},
	)
)

Functions

func RegisterMetrics

func RegisterMetrics()

Types

type LabelPropagationMetrics

type LabelPropagationMetrics struct {
	EndpointsWithAnnotation int
	NumberOfEndpoints       int
}

LabelPropagationMetrics contains aggregated label propagation related metrics.

type LabelPropagationStats

type LabelPropagationStats struct {
	EndpointsWithAnnotation int
	NumberOfEndpoints       int
}

LabelPropagationStat contains stats related to label propagation.

type SyncerMetrics

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

func FakeSyncerMetrics

func FakeSyncerMetrics() *SyncerMetrics

FakeSyncerMetrics creates new NegMetricsCollector with fixed 5 second metricsInterval, to be used in tests

func NewNegMetricsCollector

func NewNegMetricsCollector(exportInterval time.Duration, logger klog.Logger) *SyncerMetrics

NewNEGMetricsCollector initializes SyncerMetrics and starts a go routine to compute and export metrics periodically.

func (*SyncerMetrics) DeleteSyncer

func (sm *SyncerMetrics) DeleteSyncer(key negtypes.NegSyncerKey)

DeleteSyncer will reset any metrics for the syncer corresponding to `key`. It should be invoked when a Syncer has been stopped.

func (*SyncerMetrics) Run

func (sm *SyncerMetrics) Run(stopCh <-chan struct{})

func (*SyncerMetrics) SetLabelPropagationStats

func (sm *SyncerMetrics) SetLabelPropagationStats(key negtypes.NegSyncerKey, labelstatLabelPropagationStats LabelPropagationStats)

func (*SyncerMetrics) SetSyncerEPMetrics

func (sm *SyncerMetrics) SetSyncerEPMetrics(key negtypes.NegSyncerKey, endpointStat *negtypes.SyncerEPStat)

SetSyncerEPMetrics update the endpoint count based on the endpointStat

func (*SyncerMetrics) UpdateSyncer

func (sm *SyncerMetrics) UpdateSyncer(key negtypes.NegSyncerKey, syncResult *negtypes.NegSyncResult)

UpdateSyncer update the status of corresponding syncer based on the syncResult.

func (*SyncerMetrics) UpdateSyncerNegCount

func (sm *SyncerMetrics) UpdateSyncerNegCount(key negtypes.NegSyncerKey, negsByLocation map[string]int)

type SyncerMetricsCollector

type SyncerMetricsCollector interface {
	UpdateSyncer(key negtypes.NegSyncerKey, result *negtypes.NegSyncResult)
	SetSyncerEPMetrics(key negtypes.NegSyncerKey, epState *negtypes.SyncerEPStat)
	SetLabelPropagationStats(key negtypes.NegSyncerKey, labelstatLabelPropagationStats LabelPropagationStats)
	// Updates the number of negs per syncer per zone
	UpdateSyncerNegCount(key negtypes.NegSyncerKey, negByLocation map[string]int)
}

Jump to

Keyboard shortcuts

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