Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add withDumpTo logs #93

Merged
merged 13 commits into from
Mar 31, 2022
4 changes: 3 additions & 1 deletion doc/zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ h, _ := holmes.New(
holmes.WithCollectInterval("5s"),
holmes.WithDumpPath("/tmp"),
holmes.WithTextDump(),
holmes.WithDumpToLogger(true),
holmes.WithGoroutineDump(10, 25, 2000, 10*1000, time.Minute),
)
h.EnableGoroutineDump()
Expand All @@ -94,7 +95,8 @@ h.Stop()

* WithCollectInterval("5s") 每5s采集一次当前应用的各项指标,该值建议设置为大于1s。
* WithDumpPath("/tmp") profile文件保存路径。
* WithTextDump() profile的内容将会输出到日志中。
* WithTextDump() 以文本格式保存profile内容。
* WithDumpToLogger() profile内容将会输出到日志。
* WithGoroutineDump(10, 25, 2000, 100*1000, time.Minute) 当goroutine指标满足以下条件时,将会触发dump操作。
current_goroutine_num > `10` && current_goroutine_num < `100*1000` &&
current_goroutine_num > `125`% * previous_average_goroutine_num or current_goroutine_num > `2000`.
Expand Down
2 changes: 2 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ h, _ := holmes.New(
holmes.WithCollectInterval("5s"),
holmes.WithDumpPath("/tmp"),
holmes.WithTextDump(),
holmes.WithDumpToLogger(true),
holmes.WithGoroutineDump(10, 25, 2000, 10*1000,time.Minute),
)
h.EnableGoroutineDump()
Expand All @@ -67,6 +68,7 @@ h.Stop()
* WithCollectInterval("5s") means the system metrics are collected once 5 seconds
* WithDumpPath("/tmp") means the dump binary file(binary mode) will write content to `/tmp` dir.
* WithTextDump() means not in binary mode, so it's text mode profiles
* WithDumpToLogger() means profiles information will be outputted to logger.
* WithGoroutineDump(10, 25, 2000, 100*1000,time.Minute) means dump will happen when current_goroutine_num > 10 &&
current_goroutine_num < `100*1000` && current_goroutine_num > `125%` * previous_average_goroutine_num or current_goroutine_num > `2000`,
`time.Minute` means once a dump happened, the next dump will not happen before cooldown
Expand Down