aboutsummaryrefslogtreecommitdiff
path: root/weed/util/pprof.go
diff options
context:
space:
mode:
authorwuyuxiang <wuyuxiang@corp.netease.com>2020-04-28 14:10:23 +0800
committerwuyuxiang <wuyuxiang@corp.netease.com>2020-04-28 14:10:23 +0800
commit6850d28d6b99155dca2da8fa8bbf76124f528fa4 (patch)
tree2a6eb0dd50a530dfb72496a69715438c9aa15a44 /weed/util/pprof.go
parent2a7957b4ca83fdb5232d761074e81dce6b99648f (diff)
downloadseaweedfs-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.go34
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()
- })
- }
-
-}