metrics

package
v0.0.0-...-fc07508 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMiddleware

func NewMiddleware(mp Provider, skipPaths ...string) gin.HandlerFunc

Types

type Provider

type Provider interface {
	// RecordApiCount increases count of api request with given code, method, path labels
	RecordApiCount(code int, method, path string)

	// RecordApiLatency observes given elapsed mills with given code, method, path labels
	RecordApiLatency(code int, method, path string, elapsed time.Duration)

	// RecordCache increases count of cache request with given key, hit
	RecordCache(key string, hit bool)
}

func NewProvider

func NewProvider(conf *config.Config) Provider

NewProvider returns a new Provider with given conf config.Config.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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