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

profiler: deprecate PprofDiff #1806

Merged
merged 5 commits into from
Mar 16, 2023
Merged

profiler: deprecate PprofDiff #1806

merged 5 commits into from
Mar 16, 2023

Conversation

nsrip-dd
Copy link
Contributor

@nsrip-dd nsrip-dd commented Mar 15, 2023

What does this PR do?

Deprecates the PprofDiff function. It will be removed in v1.50.0.

Motivation

The PprofDiff function was added to our public API unintentionally as
part of #1511. The function is only meant for internal use. This was
missed during code review, likely due to the size of the change and the
fact that most of our attention was devoted to making sure the core
parts of the change were implemented correctly.

This is an exception to our normal v1 compatibility guarantees. It is
very unlikely that any of our users depend on this function. It serves
no purpose in the context of the profiler's public API, and anybody who
might have a reason to use this function would probably have already
found a way to do what they want using the
github.com/google/pprof/profile package.

Describe how to test/QA your changes

N/A

Reviewer's Checklist

  • If known, an appropriate milestone has been selected; otherwise the Triage milestone is set.
  • Changed code has unit tests for its functionality.
  • If this interacts with the agent in a new way, a system test has been added.

Sorry, something went wrong.

The PprofDiff function was added to our public API unintentionally as
part of #1511. The function is only meant for internal use. This was
missed during code review, likely due to the size of the change and the
fact that most of our attention was devoted to making sure the core
parts of the change were implemented correctly.

This is an exception to our normal v1 compatibility guarantees. It is
very unlikely that any of our users depend on this function. It serves
no purpose in the context of the profiler's public API, and anybody who
might have a reason to use this function would probably have already
found a way to do what they want using the
github.com/google/pprof/profile package.
@nsrip-dd nsrip-dd added this to the v1.49.0 milestone Mar 15, 2023
@nsrip-dd
Copy link
Contributor Author

I've marked this as a draft, so we don't merge it right away. I personally think this is okay to do. However, we could mark this as deprecated instead, with a note that this was not intended to be part of our API. I know pkg.go.dev understands deprecation warnings, and I think some Go IDEs will also show you if you're using a deprecated function. Then we could remove it in a later release.

That could be more cautious than necessary, though. Thoughts?

felixge
felixge previously approved these changes Mar 15, 2023
Copy link
Member

@felixge felixge left a comment

Choose a reason for hiding this comment

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

LGTM. I think I'd slightly prefer the two release cycle deprecation-first removal strategy you mentioned. But if it's a PITA I'm also cool with ripping off this bandaid.

@pr-commenter
Copy link

pr-commenter bot commented Mar 15, 2023

Benchmarks

Comparing candidate commit b55aa1c in PR branch nick.ripley/remove-pprof-diff with baseline commit 7686ff9 in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 18 metrics, 0 unstable metrics.

Instead of making it private right away, make it deprecated instead, to
be removed in a later release. This should hopefully give users a chance
to notice that it's going away and stop using it before it's removed.
pkg.go.dev won't show it, and some IDEs and linters will flag use of
deprecated functions.
@nsrip-dd nsrip-dd changed the title profiler: make PprofDiff private profiler: deprecate PprofDiff Mar 15, 2023
@nsrip-dd
Copy link
Contributor Author

Not a PITA at all :) I think it's reasonable to deprecate it first. I've changed the PR to do so.

@nsrip-dd nsrip-dd marked this pull request as ready for review March 15, 2023 18:28
@nsrip-dd nsrip-dd requested a review from a team as a code owner March 15, 2023 18:28
Copy link
Member

@felixge felixge left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@nsrip-dd nsrip-dd added this pull request to the merge queue Mar 16, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Mar 16, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@nsrip-dd nsrip-dd merged commit 96b9f30 into main Mar 16, 2023
@nsrip-dd nsrip-dd deleted the nick.ripley/remove-pprof-diff branch March 16, 2023 18:32
@nsrip-dd nsrip-dd mentioned this pull request Oct 13, 2023
5 tasks
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.

None yet

2 participants