|
@ -2,6 +2,7 @@ package util |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
"os" |
|
|
"os" |
|
|
|
|
|
"runtime" |
|
|
"runtime/pprof" |
|
|
"runtime/pprof" |
|
|
|
|
|
|
|
|
"github.com/chrislusf/seaweedfs/weed/glog" |
|
|
"github.com/chrislusf/seaweedfs/weed/glog" |
|
@ -19,6 +20,7 @@ func SetupProfiling(cpuProfile, memProfile string) { |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
if memProfile != "" { |
|
|
if memProfile != "" { |
|
|
|
|
|
runtime.MemProfileRate = 1 |
|
|
f, err := os.Create(memProfile) |
|
|
f, err := os.Create(memProfile) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
glog.Fatal(err) |
|
|
glog.Fatal(err) |
|
|