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: document/test that Start restarts the profiler #1805

Merged
merged 1 commit into from
Mar 15, 2023

Conversation

nsrip-dd
Copy link
Contributor

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

What does this PR do?

Document that Start will restart the profiler with the given configuration if
the profiler was already running. Add a test to lock in this behavior.

This PR also removes the TestStartStopIdempotent test. This test made no
assertions, and at any rate Start was not idempotent to begin with.

Motivation

Start will first stop the profiler if it is already running, and the
re-start it with the given configuration. This behavior is not
documented. It is also not tested--the current test suite passes if
Start is changed to return early when the profiler is already active.
It is possible that there are apps out there which rely on this behavior
(some of our internal apps do), and it would be a breaking change for
these apps to make Start do nothing if the profiler is already started.
Given that there isn't a strong reason to change the behavior otherwise,
we should document it and make sure it's actually tested.

Describe how to test/QA your changes

See the unit test.

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.

Start will first stop the profiler if it is already running, and the
re-start it with the given configuration. This behaviour is not
documented. It is also not tested--the current test suite passes if
Start is changed to return early when the profiler is already active.
It is possible that there are apps out there which rely on this behavior
(some of our internal apps do), and it would be a breaking change for
these apps to make Start do nothing if the profiler is already started.
Given that there isn't a strong reason to change the behavior otherwise,
we should document it and make sure it's actually tested.

This commit adds a test to lock in this behavior. It also removes the
TestStartStopIdempotent test. This test made no assertions, and at any
rate Start was not idempotent to begin with.
@nsrip-dd nsrip-dd requested a review from a team as a code owner March 15, 2023 14:33
@nsrip-dd nsrip-dd added this to the v1.49.0 milestone Mar 15, 2023
@pr-commenter
Copy link

pr-commenter bot commented Mar 15, 2023

Benchmarks

Comparing candidate commit fbf59bb in PR branch nick.ripley/update-start-docs with baseline commit 1f7d47a in branch main.

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

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.

That's great. Thanks Nick! ❤️

@nsrip-dd nsrip-dd merged commit 1de4e96 into main Mar 15, 2023
@nsrip-dd nsrip-dd deleted the nick.ripley/update-start-docs branch March 15, 2023 21:05
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