@@ -7,15 +7,15 @@ import (
7
7
"github.com/labstack/echo"
8
8
)
9
9
10
- // Wrap adds several routes from package `net/http/pprof` to *echo.Echo object
10
+ // Wrap adds several routes from package `net/http/pprof` to *echo.Echo object.
11
11
func Wrap (e * echo.Echo ) {
12
12
WrapGroup ("" , e .Group ("" ))
13
13
}
14
14
15
- // Wrapper make sure we are backward compatible
15
+ // Wrapper make sure we are backward compatible.
16
16
var Wrapper = Wrap
17
17
18
- // WrapGroup adds several routes from package `net/http/pprof` to *echo.Group object
18
+ // WrapGroup adds several routes from package `net/http/pprof` to *echo.Group object.
19
19
func WrapGroup (prefix string , g * echo.Group ) {
20
20
routers := []struct {
21
21
Method string
@@ -45,79 +45,79 @@ func WrapGroup(prefix string, g *echo.Group) {
45
45
}
46
46
}
47
47
48
- // IndexHandler will pass the call from /debug/pprof to pprof
48
+ // IndexHandler will pass the call from /debug/pprof to pprof.
49
49
func IndexHandler () echo.HandlerFunc {
50
50
return func (ctx echo.Context ) error {
51
51
pprof .Index (ctx .Response ().Writer , ctx .Request ())
52
52
return nil
53
53
}
54
54
}
55
55
56
- // HeapHandler will pass the call from /debug/pprof/heap to pprof
56
+ // HeapHandler will pass the call from /debug/pprof/heap to pprof.
57
57
func HeapHandler () echo.HandlerFunc {
58
58
return func (ctx echo.Context ) error {
59
59
pprof .Handler ("heap" ).ServeHTTP (ctx .Response (), ctx .Request ())
60
60
return nil
61
61
}
62
62
}
63
63
64
- // GoroutineHandler will pass the call from /debug/pprof/goroutine to pprof
64
+ // GoroutineHandler will pass the call from /debug/pprof/goroutine to pprof.
65
65
func GoroutineHandler () echo.HandlerFunc {
66
66
return func (ctx echo.Context ) error {
67
67
pprof .Handler ("goroutine" ).ServeHTTP (ctx .Response ().Writer , ctx .Request ())
68
68
return nil
69
69
}
70
70
}
71
71
72
- // BlockHandler will pass the call from /debug/pprof/block to pprof
72
+ // BlockHandler will pass the call from /debug/pprof/block to pprof.
73
73
func BlockHandler () echo.HandlerFunc {
74
74
return func (ctx echo.Context ) error {
75
75
pprof .Handler ("block" ).ServeHTTP (ctx .Response ().Writer , ctx .Request ())
76
76
return nil
77
77
}
78
78
}
79
79
80
- // ThreadCreateHandler will pass the call from /debug/pprof/threadcreate to pprof
80
+ // ThreadCreateHandler will pass the call from /debug/pprof/threadcreate to pprof.
81
81
func ThreadCreateHandler () echo.HandlerFunc {
82
82
return func (ctx echo.Context ) error {
83
83
pprof .Handler ("threadcreate" ).ServeHTTP (ctx .Response ().Writer , ctx .Request ())
84
84
return nil
85
85
}
86
86
}
87
87
88
- // CmdlineHandler will pass the call from /debug/pprof/cmdline to pprof
88
+ // CmdlineHandler will pass the call from /debug/pprof/cmdline to pprof.
89
89
func CmdlineHandler () echo.HandlerFunc {
90
90
return func (ctx echo.Context ) error {
91
91
pprof .Cmdline (ctx .Response ().Writer , ctx .Request ())
92
92
return nil
93
93
}
94
94
}
95
95
96
- // ProfileHandler will pass the call from /debug/pprof/profile to pprof
96
+ // ProfileHandler will pass the call from /debug/pprof/profile to pprof.
97
97
func ProfileHandler () echo.HandlerFunc {
98
98
return func (ctx echo.Context ) error {
99
99
pprof .Profile (ctx .Response ().Writer , ctx .Request ())
100
100
return nil
101
101
}
102
102
}
103
103
104
- // SymbolHandler will pass the call from /debug/pprof/symbol to pprof
104
+ // SymbolHandler will pass the call from /debug/pprof/symbol to pprof.
105
105
func SymbolHandler () echo.HandlerFunc {
106
106
return func (ctx echo.Context ) error {
107
107
pprof .Symbol (ctx .Response ().Writer , ctx .Request ())
108
108
return nil
109
109
}
110
110
}
111
111
112
- // TraceHandler will pass the call from /debug/pprof/trace to pprof
112
+ // TraceHandler will pass the call from /debug/pprof/trace to pprof.
113
113
func TraceHandler () echo.HandlerFunc {
114
114
return func (ctx echo.Context ) error {
115
115
pprof .Trace (ctx .Response ().Writer , ctx .Request ())
116
116
return nil
117
117
}
118
118
}
119
119
120
- // MutexHandler will pass the call from /debug/pprof/mutex to pprof
120
+ // MutexHandler will pass the call from /debug/pprof/mutex to pprof.
121
121
func MutexHandler () echo.HandlerFunc {
122
122
return func (ctx echo.Context ) error {
123
123
pprof .Handler ("mutex" ).ServeHTTP (ctx .Response ().Writer , ctx .Request ())
0 commit comments