@@ -278,28 +278,31 @@ func main() {
278
278
apiGroup .GET ("/devices/all" , GetDevices )
279
279
280
280
debugGroup := r .Group ("/debug" )
281
- pprofGroup := debugGroup .Group ("/pprof" , AuthRequired ())
282
- pprofGroup .GET ("/cmdline" , func (c * gin.Context ) {
283
- pprof .Cmdline (c .Writer , c .Request )
284
- })
285
- pprofGroup .GET ("/heap" , func (c * gin.Context ) {
286
- pprof .Index (c .Writer , c .Request )
287
- })
288
- pprofGroup .GET ("/block" , func (c * gin.Context ) {
289
- pprof .Index (c .Writer , c .Request )
290
- })
291
- pprofGroup .GET ("/mutex" , func (c * gin.Context ) {
292
- pprof .Index (c .Writer , c .Request )
293
- })
294
- pprofGroup .GET ("/trace" , func (c * gin.Context ) {
295
- pprof .Trace (c .Writer , c .Request )
296
- })
297
- pprofGroup .GET ("/profile" , func (c * gin.Context ) {
298
- pprof .Profile (c .Writer , c .Request )
299
- })
300
- pprofGroup .GET ("/symbol" , func (c * gin.Context ) {
301
- pprof .Symbol (c .Writer , c .Request )
302
- })
281
+
282
+ if cfg .Tuning .ProfileRoutes {
283
+ pprofGroup := debugGroup .Group ("/pprof" , AuthRequired ())
284
+ pprofGroup .GET ("/cmdline" , func (c * gin.Context ) {
285
+ pprof .Cmdline (c .Writer , c .Request )
286
+ })
287
+ pprofGroup .GET ("/heap" , func (c * gin.Context ) {
288
+ pprof .Index (c .Writer , c .Request )
289
+ })
290
+ pprofGroup .GET ("/block" , func (c * gin.Context ) {
291
+ pprof .Index (c .Writer , c .Request )
292
+ })
293
+ pprofGroup .GET ("/mutex" , func (c * gin.Context ) {
294
+ pprof .Index (c .Writer , c .Request )
295
+ })
296
+ pprofGroup .GET ("/trace" , func (c * gin.Context ) {
297
+ pprof .Trace (c .Writer , c .Request )
298
+ })
299
+ pprofGroup .GET ("/profile" , func (c * gin.Context ) {
300
+ pprof .Profile (c .Writer , c .Request )
301
+ })
302
+ pprofGroup .GET ("/symbol" , func (c * gin.Context ) {
303
+ pprof .Symbol (c .Writer , c .Request )
304
+ })
305
+ }
303
306
304
307
srv := & http.Server {
305
308
Addr : fmt .Sprintf (":%d" , cfg .Port ),
0 commit comments