Documentation ¶
Index ¶
- type MetricsServer
- func (m *MetricsServer) GetHandler() http.Handler
- func (m *MetricsServer) IncErrorCount(query string)
- func (m *MetricsServer) IncQueryCount(query string)
- func (m *MetricsServer) IncResponseStatusCount(status string)
- func (m *MetricsServer) ObserveResponseTime(query string, duration float64)
- func (m *MetricsServer) PrometheusMetricsMiddleware(next http.Handler) http.Handler
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
Click to show internal directories.
Click to hide internal directories.