add profiling support for sdk
This commit is contained in:
@ -483,11 +483,11 @@ func Version() string {
|
|||||||
return SDK_VERSION
|
return SDK_VERSION
|
||||||
}
|
}
|
||||||
func StartProfiling(storePath string) {
|
func StartProfiling(storePath string) {
|
||||||
if isProfiling {
|
if !isProfiling {
|
||||||
|
isProfiling = true
|
||||||
if storePath == "" {
|
if storePath == "" {
|
||||||
storePath = "."
|
storePath = "."
|
||||||
}
|
}
|
||||||
isProfiling = true
|
|
||||||
cpuProfilingFile, _ = os.Create(filepath.Join(storePath, "cpu.prof"))
|
cpuProfilingFile, _ = os.Create(filepath.Join(storePath, "cpu.prof"))
|
||||||
memProfilingFile, _ = os.Create(filepath.Join(storePath, "memory.prof"))
|
memProfilingFile, _ = os.Create(filepath.Join(storePath, "memory.prof"))
|
||||||
blockProfilingFile, _ = os.Create(filepath.Join(storePath, "block.prof"))
|
blockProfilingFile, _ = os.Create(filepath.Join(storePath, "block.prof"))
|
||||||
|
|||||||
Reference in New Issue
Block a user