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

Add support for CPU and heap profiling. #1318

Merged
merged 4 commits into from
May 4, 2018
Merged

Add support for CPU and heap profiling. #1318

merged 4 commits into from
May 4, 2018

Conversation

pgavlin
Copy link
Member

@pgavlin pgavlin commented May 3, 2018

These changes add a new flag to the CLI, --profiling, that enables
CPU and heap profiling of the CLI itself. The argument to this flag
serves as a prefix for the CPU and heap profile outputs; these profiles
are written to [filename].[pid].cpu and [filename].[pid].mem,
respectively.

These changes also fix an issue with cmdutil.RunFunc wherein any error
would prevent the command's post-run hooks from executing.

These changes add a new flag to the CLI, `--profiling`, that enables
CPU and heap profiling of the CLI itself. The argument to this flag
serves as a prefix for the CPU and heap profile outputs; these profiles
are written to `[filename].[pid].cpu` and `[filename].[pid].mem`,
respectively.

These changes also fix an issue with `cmdutil.RunFunc` wherein any error
would prevent the command's post-run hooks from executing.
@pgavlin pgavlin requested review from lukehoban and joeduffy May 3, 2018 22:35
@@ -46,13 +46,41 @@ func DetailedError(err error) string {
return msg
}

func runPostCommandHooks(c *cobra.Command, args []string) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps add comment with a reference to the source of this logic?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do.

@pgavlin pgavlin merged commit ded25b1 into master May 4, 2018
@pgavlin pgavlin deleted the Profiling branch May 4, 2018 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants