workqueue

package
v0.21.0 Latest Latest
Warning

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

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

Documentation

Overview

Package workqueue embeds metrics exposed by package k8s.io/client-go/util/workqueue.

Packages that make use of workqueue, e.g. runctl or tenantctl, must contribute a NameProvider that maps names of workqueues to subsystem names (i.e. metric name prefixes), so that workqueue metrics appear under the same prefix as other metrics from that package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterNameProvider

func RegisterNameProvider(provider NameProvider)

RegisterNameProvider registers a new NameProvider.

Types

type NameProvider

type NameProvider interface {
	/*
		Returns the subsystem name to be used for Prometheus workqueue metrics for
		the given queue name. If the given queue name is not identified to belong to
		the name provider's package, return value `ok` must be `false`.
	*/
	GetSubsystemFor(queueName string) (subsystem string, ok bool)
}

NameProvider is the interface for name providers contributed by packages that make use of k8s.io/client-go/util/workqueue.

type NameProviderFunc

type NameProviderFunc func(queueName string) (subsystem string, ok bool)

NameProviderFunc is an adapter that allows to use functions with the right signature as NameProvider.

func (NameProviderFunc) GetSubsystemFor

func (f NameProviderFunc) GetSubsystemFor(queueName string) (string, bool)

GetSubsystemFor implements interface NameProvider.

Jump to

Keyboard shortcuts

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