metricsregistry

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package metricsregistry provides utilities for working with dynamically created metrics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Registry

type Registry interface {
	GetOrRegisterCounter(name string) kitmetrics.Counter
	GetOrRegisterGauge(name string) kitmetrics.Gauge
	GetOrRegisterHistogram(name string, buckets int) kitmetrics.Histogram
	GetOrRegisterExplicitHistogram(name string, fn metrics.DistributionFunc) kitmetrics.Histogram
}

A Registry holds references to a set of metrics by name. It's guaranteed to keep returning the same metric given the same name and type. All implementations are also required to be thread safe.

func New

func New(p metrics.Provider) Registry

New creates a Registry given a metrics.Provider.

func NewPrefixed

func NewPrefixed(r Registry, prefix string) Registry

NewPrefixed creates a new Registry backed by r with all created metric names prefixed with prefix + ".".

Jump to

Keyboard shortcuts

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