-
Notifications
You must be signed in to change notification settings - Fork 460
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 --profile-{cpu,mem}
flags
#1683
Add --profile-{cpu,mem}
flags
#1683
Conversation
6e76f2f
to
4e541d9
Compare
cmd/crictl/main.go
Outdated
if cpuProfilePath != "" { | ||
logrus.Infof("Creating CPU profile in: %s", cpuProfilePath) | ||
|
||
file, err := os.Create(cpuProfilePath) |
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.
so it will fail if file already exists? Should we simply override it instead of failing? It is kind of unusual for a command to fail if retried.
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.
No, it will re-use the file:
func Create(name string) (*File, error) {
return OpenFile(name, O_RDWR|O_CREATE|O_TRUNC, 0666)
}
653a1da
to
a4925a3
Compare
The flags allow debugging `crictl` with respect to CPU and memory consumption. Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
a4925a3
to
67d7a65
Compare
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: saschagrunert, SergeyKanzhelev The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
What this PR does / why we need it:
The flags allow debugging
crictl
with respect to CPU and memory consumption.Which issue(s) this PR fixes:
None
Special notes for your reviewer:
Users reported strange memory behavior when running
crictl ps
which is not reproducible for me. Adding the flags will give us more insights and could be beneficial to others.Does this PR introduce a user-facing change?