PLT-4357 adding performance monitoring (#4622)

* WIP

* WIP

* Adding metrics collection

* updating vendor packages

* Adding metrics to config

* Adding admin console page for perf monitoring

* Updating glide

* switching to tylerb/graceful
Этот коммит содержится в:
Corey Hulen
2016-11-22 11:05:54 -08:00
коммит произвёл Harrison Healey
родитель e033dcce8e
Коммит 7961599b2e
389 изменённых файлов: 76289 добавлений и 1023 удалений

Просмотреть файл

@@ -7,7 +7,6 @@ import (
"crypto/tls"
"net"
"net/http"
"net/http/pprof"
"strings"
"time"
@@ -37,20 +36,7 @@ const TIME_TO_WAIT_FOR_CONNECTIONS_TO_CLOSE_ON_SERVER_SHUTDOWN = time.Second
var Srv *Server
func AttachProfiler(router *mux.Router) {
router.HandleFunc("/debug/pprof/", pprof.Index)
router.HandleFunc("/debug/pprof/cmdline", pprof.Cmdline)
router.HandleFunc("/debug/pprof/profile", pprof.Profile)
router.HandleFunc("/debug/pprof/symbol", pprof.Symbol)
// Manually add support for paths linked to by index page at /debug/pprof/
router.Handle("/debug/pprof/goroutine", pprof.Handler("goroutine"))
router.Handle("/debug/pprof/heap", pprof.Handler("heap"))
router.Handle("/debug/pprof/threadcreate", pprof.Handler("threadcreate"))
router.Handle("/debug/pprof/block", pprof.Handler("block"))
}
func NewServer(enableProfiler bool) {
func NewServer() {
l4g.Info(utils.T("api.server.new_server.init.info"))
@@ -58,10 +44,6 @@ func NewServer(enableProfiler bool) {
Srv.Store = store.NewSqlStore()
Srv.Router = mux.NewRouter()
if enableProfiler {
AttachProfiler(Srv.Router)
l4g.Info("Enabled HTTP Profiler")
}
Srv.Router.NotFoundHandler = http.HandlerFunc(Handle404)
}