Start a simpler replacement for davecheney's profile package
This commit is contained in:
parent
ba83f65ddf
commit
1e4862ace8
|
@ -0,0 +1,19 @@
|
|||
package profile
|
||||
|
||||
import (
|
||||
"log"
|
||||
"net/http"
|
||||
_ "net/http/pprof"
|
||||
"os"
|
||||
)
|
||||
|
||||
func init() {
|
||||
if httpAddr := os.Getenv("GOPROF"); httpAddr != "" {
|
||||
go func() {
|
||||
err := http.ListenAndServe(httpAddr, nil)
|
||||
if err != nil {
|
||||
log.Print(err)
|
||||
}
|
||||
}()
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue