metrics

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheCollector

type CacheCollector[K comparable, V any] struct {
	// contains filtered or unexported fields
}

CacheCollector implements a prometheus.Collector for ttlcache.Cache.

func NewCacheCollector

func NewCacheCollector[K comparable, V any](cache *ttlcache.Cache[K, V], prefix string, variableLabels []string, constLabels prometheus.Labels) *CacheCollector[K, V]

NewCacheCollector creates a new CacheCollector for the specified cache. All metrics use the supplied variable and constant labels.

func (*CacheCollector[K, V]) Collect

func (collector *CacheCollector[K, V]) Collect(ch chan<- prometheus.Metric)

Collect implements the Collect method of a prometheus.Collector.

func (*CacheCollector[K, V]) Describe

func (collector *CacheCollector[K, V]) Describe(ch chan<- *prometheus.Desc)

Describe implements the Describe method of a prometheus.Collector.

Jump to

Keyboard shortcuts

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