diff options
Diffstat (limited to 'weed/util/pprof.go')
| -rw-r--r-- | weed/util/pprof.go | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/weed/util/pprof.go b/weed/util/pprof.go deleted file mode 100644 index a2621ceee..000000000 --- a/weed/util/pprof.go +++ /dev/null @@ -1,34 +0,0 @@ -package util - -import ( - "os" - "runtime" - "runtime/pprof" - - "github.com/chrislusf/seaweedfs/weed/glog" -) - -func SetupProfiling(cpuProfile, memProfile string) { - if cpuProfile != "" { - f, err := os.Create(cpuProfile) - if err != nil { - glog.Fatal(err) - } - pprof.StartCPUProfile(f) - OnInterrupt(func() { - pprof.StopCPUProfile() - }) - } - if memProfile != "" { - runtime.MemProfileRate = 1 - f, err := os.Create(memProfile) - if err != nil { - glog.Fatal(err) - } - OnInterrupt(func() { - pprof.WriteHeapProfile(f) - f.Close() - }) - } - -} |
