Extract metrics to own package and refactor implementations

This commit is contained in:
Marco Jantke 2017-08-23 20:46:03 +02:00 committed by Traefiker
parent c1b5b740ff
commit e6c2040ea8
19 changed files with 599 additions and 797 deletions

View file

@ -23,7 +23,7 @@ import (
)
var (
metrics = thoas_stats.New()
stats = thoas_stats.New()
statsRecorder *middlewares.StatsRecorder
)
@ -174,7 +174,7 @@ type healthResponse struct {
}
func (provider *WebProvider) getHealthHandler(response http.ResponseWriter, request *http.Request) {
health := &healthResponse{Data: metrics.Data()}
health := &healthResponse{Data: stats.Data()}
if statsRecorder != nil {
health.Stats = statsRecorder.Data()
}