implemented event and req
This commit is contained in:
7
pprof.go
7
pprof.go
@@ -2,18 +2,19 @@ package main
|
||||
|
||||
import (
|
||||
"github.com/pkg/profile"
|
||||
"utils.orly/interrupt"
|
||||
)
|
||||
|
||||
func startProfiler(mode string) {
|
||||
switch mode {
|
||||
case "cpu":
|
||||
prof := profile.Start(profile.CPUProfile)
|
||||
defer prof.Stop()
|
||||
interrupt.AddHandler(prof.Stop)
|
||||
case "memory":
|
||||
prof := profile.Start(profile.MemProfile)
|
||||
defer prof.Stop()
|
||||
interrupt.AddHandler(prof.Stop)
|
||||
case "allocation":
|
||||
prof := profile.Start(profile.MemProfileAllocs)
|
||||
defer prof.Stop()
|
||||
interrupt.AddHandler(prof.Stop)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user