func HTTPProf() {
    //log.Infof("pprof listen at: http://%s/debug/pprof/", app.httpprof)
    mux := http.NewServeMux()

    // register pprof handler
    mux.HandleFunc("/debug/pprof/", func(w http.ResponseWriter, r *http.Request) {
        http.DefaultServeMux.ServeHTTP(w, r)
    })

    // register metrics handler
    //mux.HandleFunc("/debug/vars", app.metricsHandler)

    endpoint := http.ListenAndServe("0.0.0.0:6060", mux)
    log.Debug("stop pprof server: %v", endpoint)

}

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code