metricsutil

package
v0.0.0-...-0f9ccff Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

type Metrics interface {
	IncRequestCounter(method, endpoint, status string)
	IncUserCreationCounter()
	ObserveRequestDuration(method, endpoint string, duration float64)
}

type PrometheusMetrics

type PrometheusMetrics struct {
	RequestCounter      *prometheus.CounterVec
	UserCreationCounter prometheus.Counter
	RequestDuration     *prometheus.HistogramVec
}

func NewPrometheusMetrics

func NewPrometheusMetrics() *PrometheusMetrics

func (*PrometheusMetrics) IncRequestCounter

func (pm *PrometheusMetrics) IncRequestCounter(method, endpoint, status string)

func (*PrometheusMetrics) IncUserCreationCounter

func (pm *PrometheusMetrics) IncUserCreationCounter()

func (*PrometheusMetrics) ObserveRequestDuration

func (pm *PrometheusMetrics) ObserveRequestDuration(method, endpoint string, duration float64)

Jump to

Keyboard shortcuts

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