middlewares

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HTTPServerLatency = func(logger *zerolog.Logger) middlewares.Middleware {
	return func(next http.HandlerFunc) http.HandlerFunc {
		return func(w http.ResponseWriter, r *http.Request) {
			var methodPath = r.Method + " " + r.URL.Path
			var startedAt = time.Now()

			next.ServeHTTP(w, r)

			metrics.HistogramObserverServer(methodPath, nil).Observe(time.Since(startedAt).Seconds())
		}
	}
}

HTTPServerLatency .

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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