Add core packages, configuration system, and initial application structure
This commit is contained in:
19
pprof.go
Normal file
19
pprof.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/pkg/profile"
|
||||
)
|
||||
|
||||
func startProfiler(mode string) {
|
||||
switch mode {
|
||||
case "cpu":
|
||||
prof := profile.Start(profile.CPUProfile)
|
||||
defer prof.Stop()
|
||||
case "memory":
|
||||
prof := profile.Start(profile.MemProfile)
|
||||
defer prof.Stop()
|
||||
case "allocation":
|
||||
prof := profile.Start(profile.MemProfileAllocs)
|
||||
defer prof.Stop()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user