You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using dump path that does not exist, for example
holmes.WithDumpPath("./tmp"),
Expected behavior:
The goroutine should be dumped successfully.
Current behavior:
Will encounter error like
2022-03-29 17:07:06,609 [ERROR] failed to write profile to file(tmp/goroutine..20220329170706.609.log), err: pprof goroutine open file failed : open tmp/goroutine..20220329170706.609.log: no such file or directory
Source Code
package main
import (
"fmt"
"runtime"
"time"
"mosn.io/holmes"
mlog "mosn.io/pkg/log"
)
func main() {
logger := holmes.NewStdLogger()
logger.SetLogLevel(mlog.INFO)
h, _ := holmes.New(
holmes.WithCollectInterval("1s"),
holmes.WithTextDump(),
holmes.WithDumpPath("./tmp"),
// dump will happen when current_goroutine_num > 500 && current_goroutine_num < 1500
holmes.WithGoroutineDump(500, 0, 500, 1500, 40*time.Second),
holmes.WithLogger(logger),
)
h.EnableGoroutineDump()
h.Start()
spawnGoroutine(490)
for {
fmt.Println(time.Now(), "Number of goroutines:", runtime.NumGoroutine())
spawnGoroutine(10)
time.Sleep(10 * time.Second)
}
}
func spawnGoroutine(n int64) {
for i := int64(0); i < n; i++ {
go func() {
time.Sleep(500 * time.Minute)
}()
}
}
When using dump path that does not exist, for example
Expected behavior:
The goroutine should be dumped successfully.
Current behavior:
Will encounter error like
Source Code
go.mod
The text was updated successfully, but these errors were encountered: