diff options
| author | wuyuxiang <wuyuxiang@corp.netease.com> | 2020-04-28 14:10:23 +0800 |
|---|---|---|
| committer | wuyuxiang <wuyuxiang@corp.netease.com> | 2020-04-28 14:10:23 +0800 |
| commit | 6850d28d6b99155dca2da8fa8bbf76124f528fa4 (patch) | |
| tree | 2a6eb0dd50a530dfb72496a69715438c9aa15a44 /weed/util/pprof.go | |
| parent | 2a7957b4ca83fdb5232d761074e81dce6b99648f (diff) | |
| download | seaweedfs-6850d28d6b99155dca2da8fa8bbf76124f528fa4.tar.xz seaweedfs-6850d28d6b99155dca2da8fa8bbf76124f528fa4.zip | |
refacotr: move signal handling and pprof to grace package
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() - }) - } - -} |
