Skip to content

Instantly share code, notes, and snippets.

@caglar10ur
Created December 1, 2013 06:00
Show Gist options
  • Save caglar10ur/7729076 to your computer and use it in GitHub Desktop.
Save caglar10ur/7729076 to your computer and use it in GitHub Desktop.
martini with pprof
package main
import (
"github.com/codegangsta/martini"
"net/http/pprof"
)
func main() {
m := martini.Classic()
m.Get("/debug/pprof", pprof.Index)
m.Get("/debug/pprof/cmdline", pprof.Cmdline)
m.Get("/debug/pprof/profile", pprof.Profile)
m.Get("/debug/pprof/symbol", pprof.Symbol)
m.Post("/debug/pprof/symbol", pprof.Symbol)
m.Get("/debug/pprof/block", pprof.Handler("block").ServeHTTP)
m.Get("/debug/pprof/heap", pprof.Handler("heap").ServeHTTP)
m.Get("/debug/pprof/goroutine", pprof.Handler("goroutine").ServeHTTP)
m.Get("/debug/pprof/threadcreate", pprof.Handler("threadcreate").ServeHTTP)
m.Run()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment