pprofhandler/pprof.go
func PprofHandler(ctx *fasthttp.RequestCtx) {
	ctx.Response.Header.Set("Content-Type", "text/html")
	if strings.HasPrefix(string(ctx.Path()), "/debug/pprof/cmdline") {
		cmdline(ctx)
	} else if strings.HasPrefix(string(ctx.Path()), "/debug/pprof/profile") {
		profile(ctx)
	} else if strings.HasPrefix(string(ctx.Path()), "/debug/pprof/symbol") {
		symbol(ctx)
	} else if strings.HasPrefix(string(ctx.Path()), "/debug/pprof/trace") {
		trace(ctx)
	} else {
		for _, v := range rtp.Profiles() {
			ppName := v.Name()
			if strings.HasPrefix(string(ctx.Path()), "/debug/pprof/"+ppName) {
				namedHandler := fasthttpadaptor.NewFastHTTPHandlerFunc(pprof.Handler(ppName).ServeHTTP)
				namedHandler(ctx)
				return
			}
		}
		index(ctx)
	}
}
func PprofHandler(ctx *fasthttp.RequestCtx) {
	ctx.Response.Header.Set("Content-Type", "text/html")
	if strings.HasPrefix(string(ctx.Path()), "/debug/pprof/cmdline") {
		cmdline(ctx)
	} else if strings.HasPrefix(string(ctx.Path()), "/debug/pprof/profile") {
		profile(ctx)
	} else if strings.HasPrefix(string(ctx.Path()), "/debug/pprof/symbol") {
		symbol(ctx)
	} else if strings.HasPrefix(string(ctx.Path()), "/debug/pprof/trace") {
		trace(ctx)
	} else {
		for _, v := range rtp.Profiles() {
			ppName := v.Name()
			if strings.HasPrefix(string(ctx.Path()), "/debug/pprof/"+ppName) {
				namedHandler := fasthttpadaptor.NewFastHTTPHandlerFunc(pprof.Handler(ppName).ServeHTTP)
				namedHandler(ctx)
				return
			}
		}
		index(ctx)
	}
}
func PprofHandler ( ctx * fasthttp . RequestCtx ) { ctx . Response . Header . Set ( " " , " " ) if strings . HasPrefix ( string ( ctx . Path ( ) ) , " " ) { cmdline ( ctx ) } else if strings . HasPrefix ( string ( ctx . Path ( ) ) , " " ) { profile ( ctx ) } else if strings . HasPrefix ( string ( ctx . Path ( ) ) , " " ) { symbol ( ctx ) } else if strings . HasPrefix ( string ( ctx . Path ( ) ) , " " ) { trace ( ctx ) } else { for _ , v := range rtp . Profiles ( ) { ppName := v . Name ( ) if strings . HasPrefix ( string ( ctx . Path ( ) ) , " " + ppName ) { namedHandler := fasthttpadaptor . NewFastHTTPHandlerFunc ( pprof . Handler ( ppName ) . ServeHTTP ) namedHandler ( ctx ) return } } index ( ctx ) } }
// PprofHandler serves server runtime profiling data in the format expected by the pprof visualization tool.
//
// See https://golang.org/pkg/net/http/pprof/ for details.
PprofHandler serves server runtime profiling data in the format expected by the pprof visualization tool . See https : // golang . org / pkg / net / http / pprof / for details .