metrics

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MetricRecorder     *telemetry.MetricsRecorder
	Logger             *logger.Logger
	Service            string
	GroupedStatus      bool
	DisableMeasureSize bool
	HandlerID          string
}

type Middleware

type Middleware struct {
	// contains filtered or unexported fields
}

func NewHTTPMetric

func NewHTTPMetric(cfg Config) Middleware

func (Middleware) Handler

func (m Middleware) Handler(h http.Handler) http.Handler

Handler returns an measuring standard http.Handler.

func (Middleware) Measure

func (m Middleware) Measure(ctx context.Context, handlerID string, reporter Reporter, next func())

type Reporter

type Reporter interface {
	Method() string
	URLPath() string
	StatusCode() int
	BytesWritten() int64
}

Jump to

Keyboard shortcuts

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