metrics

package
v0.0.0-...-685ff7f Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetricsServer

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

func NewMetricsServer

func NewMetricsServer() *MetricsServer

NewMetricsServer creates a new MetricsServer

func (*MetricsServer) GetHandler

func (m *MetricsServer) GetHandler() http.Handler

func (*MetricsServer) IncErrorCount

func (m *MetricsServer) IncErrorCount(query string)

IncErrorCount increments the error count for the given query

func (*MetricsServer) IncQueryCount

func (m *MetricsServer) IncQueryCount(query string)

IncQueryCount increments the query count for the given query

func (*MetricsServer) IncResponseStatusCount

func (m *MetricsServer) IncResponseStatusCount(status string)

IncResponseStatusCount increments the error count for the given query

func (*MetricsServer) ObserveResponseTime

func (m *MetricsServer) ObserveResponseTime(query string, duration float64)

ObserveResponseTime records the response time for the given query

func (*MetricsServer) PrometheusMetricsMiddleware

func (m *MetricsServer) PrometheusMetricsMiddleware(next http.Handler) http.Handler

PrometheusMetricsMiddleware is a middleware that records metrics for the given query

Jump to

Keyboard shortcuts

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