-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add profiling to help with OOM/performance investigations #207
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great! I'm going to use this today.
bincapz.go
Outdated
@@ -9,13 +9,15 @@ import ( | |||
"flag" | |||
"fmt" | |||
"io/fs" | |||
"log" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than adding a second logging library, please re-use the clog
import - even if, admittedly, I prefer the built-in Go library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in c978170
(#207).
pkg/profile/profile.go
Outdated
return stop, nil | ||
} | ||
|
||
func HandleProfileFlag(pf *bool) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move all flag handling to main
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in c978170
(#207).
log.Fatal("render failed", slog.Any("error", err)) | ||
} | ||
|
||
if *profileFlag { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This avoids os.Exit(1)
and defer
not playing nicely together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work!
…-dev#207) * Add profiling to help with OOM/performance * Profile doesn't need to be exported * Address PR comments
This is a quick PR to help with identifying the cause(s) of #204 which adds CPU and Memory profiling along with tracing.
If anything, I wanted the code to be available to aid with the investigation -- this doesn't necessarily need to be merged; however, as the number of capabilities grows it would be nice to have some insight into any causes of performance regressions.