-
Notifications
You must be signed in to change notification settings - Fork 6
/
pprof.go
88 lines (87 loc) · 2.61 KB
/
pprof.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
package httpx
//import (
// "github.com/gofiber/fiber/v2"
// "net/http/pprof"
//)
//
//func RegisterPprof(route fiber.Router) {
// route = route.Group("/debug/pprof")
// route.Get("/", indexHandler())
// route.Get("/heap", heapHandler())
// route.Get("/goroutine", goroutineHandler())
// route.Get("/block", blockHandler())
// route.Get("/threadcreate", threadCreateHandler())
// route.Get("/cmdline", cmdlineHandler())
// route.Get("/profile", profileHandler())
// route.Get("/symbol", symbolHandler())
// route.Get("/symbol", symbolHandler())
// route.Get("/trace", traceHandler())
// route.Get("/mutex", mutexHandler())
// route.Get("/allocs", allocsHandler())
//
//}
//
//// IndexHandler will pass the call from /debug/pprof to pprof
//func indexHandler() fiber.Handler {
// return func(ctx *fiber.Ctx) error {
// pprof.Index(ctx.Writer, ctx.Request)
// }
//}
//
//// HeapHandler will pass the call from /debug/pprof/heap to pprof
//func heapHandler() fiber.Handler {
// return gin.WrapH(pprof.Handler("heap"))
//}
//
//// GoroutineHandler will pass the call from /debug/pprof/goroutine to pprof
//func allocsHandler() fiber.Handler {
// return gin.WrapH(pprof.Handler("allocs"))
//}
//
//// GoroutineHandler will pass the call from /debug/pprof/goroutine to pprof
//func goroutineHandler() fiber.Handler {
// return gin.WrapH(pprof.Handler("goroutine"))
//}
//
//// BlockHandler will pass the call from /debug/pprof/block to pprof
//func blockHandler() fiber.Handler {
// return gin.WrapH(pprof.Handler("block"))
//}
//
//// ThreadCreateHandler will pass the call from /debug/pprof/threadcreate to pprof
//func threadCreateHandler() fiber.Handler {
// return gin.WrapH(pprof.Handler("threadcreate"))
//}
//
//// CmdlineHandler will pass the call from /debug/pprof/cmdline to pprof
//func cmdlineHandler() fiber.Handler {
// return func(ctx *gin.Context) {
// pprof.Cmdline(ctx.Writer, ctx.Request)
// }
//}
//
//// ProfileHandler will pass the call from /debug/pprof/profile to pprof
//func profileHandler() fiber.Handler {
// return func(ctx *gin.Context) {
// pprof.Profile(ctx.Writer, ctx.Request)
// }
//}
//
//// SymbolHandler will pass the call from /debug/pprof/symbol to pprof
//func symbolHandler() fiber.Handler {
// return func(ctx *gin.Context) {
// pprof.Symbol(ctx.Writer, ctx.Request)
// }
//}
//
//// TraceHandler will pass the call from /debug/pprof/trace to pprof
//func traceHandler() fiber.Handler {
// return func(ctx *gin.Context) {
// pprof.Trace(ctx.Writer, ctx.Request)
// }
//}
//
//// MutexHandler will pass the call from /debug/pprof/mutex to pprof
//func mutexHandler() fiber.Handler {
// return gin.WrapH(pprof.Handler("mutex"))
//}