diff --git a/sentry_sdk/profiler/__init__.py b/sentry_sdk/profiler/__init__.py index 0bc63e3a6d..c146dd3a97 100644 --- a/sentry_sdk/profiler/__init__.py +++ b/sentry_sdk/profiler/__init__.py @@ -1,7 +1,5 @@ from sentry_sdk.profiler.continuous_profiler import ( - start_profile_session, start_profiler, - stop_profile_session, stop_profiler, ) from sentry_sdk.profiler.transaction_profiler import ( @@ -25,9 +23,7 @@ ) __all__ = [ - "start_profile_session", # TODO: Deprecate this in favor of `start_profiler` "start_profiler", - "stop_profile_session", # TODO: Deprecate this in favor of `stop_profiler` "stop_profiler", # DEPRECATED: The following was re-exported for backwards compatibility. It # will be removed from sentry_sdk.profiler in a future release. diff --git a/sentry_sdk/profiler/continuous_profiler.py b/sentry_sdk/profiler/continuous_profiler.py index 47f63d8f59..1619925bd2 100644 --- a/sentry_sdk/profiler/continuous_profiler.py +++ b/sentry_sdk/profiler/continuous_profiler.py @@ -151,13 +151,6 @@ def start_profiler(): _scheduler.manual_start() -def start_profile_session(): - # type: () -> None - - # TODO: deprecate this as it'll be replaced by `start_profiler` - start_profiler() - - def stop_profiler(): # type: () -> None if _scheduler is None: @@ -166,13 +159,6 @@ def stop_profiler(): _scheduler.manual_stop() -def stop_profile_session(): - # type: () -> None - - # TODO: deprecate this as it'll be replaced by `stop_profiler` - stop_profiler() - - def teardown_continuous_profiler(): # type: () -> None stop_profiler() diff --git a/tests/profiler/test_continuous_profiler.py b/tests/profiler/test_continuous_profiler.py index 7f1ede0bd1..fa55b0be5f 100644 --- a/tests/profiler/test_continuous_profiler.py +++ b/tests/profiler/test_continuous_profiler.py @@ -11,9 +11,7 @@ get_profiler_id, setup_continuous_profiler, start_profiler, - start_profile_session, stop_profiler, - stop_profile_session, ) from tests.conftest import ApproxDict @@ -209,21 +207,6 @@ def assert_single_transaction_without_profile_chunks(envelopes): pytest.param("gevent", marks=requires_gevent), ], ) -@pytest.mark.parametrize( - ["start_profiler_func", "stop_profiler_func"], - [ - pytest.param( - start_profile_session, - stop_profile_session, - id="start_profile_session/stop_profile_session", - ), - pytest.param( - start_profiler, - stop_profiler, - id="start_profiler/stop_profiler (deprecated)", - ), - ], -) @pytest.mark.parametrize( "make_options", [ @@ -236,8 +219,6 @@ def test_continuous_profiler_auto_start_and_manual_stop( sentry_init, capture_envelopes, mode, - start_profiler_func, - stop_profiler_func, make_options, teardown_profiling, ): @@ -258,7 +239,7 @@ def test_continuous_profiler_auto_start_and_manual_stop( assert_single_transaction_with_profile_chunks(envelopes, thread) for _ in range(3): - stop_profiler_func() + stop_profiler() envelopes.clear() @@ -268,7 +249,7 @@ def test_continuous_profiler_auto_start_and_manual_stop( assert_single_transaction_without_profile_chunks(envelopes) - start_profiler_func() + start_profiler() envelopes.clear() @@ -286,21 +267,6 @@ def test_continuous_profiler_auto_start_and_manual_stop( pytest.param("gevent", marks=requires_gevent), ], ) -@pytest.mark.parametrize( - ["start_profiler_func", "stop_profiler_func"], - [ - pytest.param( - start_profile_session, - stop_profile_session, - id="start_profile_session/stop_profile_session", - ), - pytest.param( - start_profiler, - stop_profiler, - id="start_profiler/stop_profiler (deprecated)", - ), - ], -) @pytest.mark.parametrize( "make_options", [ @@ -313,8 +279,6 @@ def test_continuous_profiler_manual_start_and_stop_sampled( sentry_init, capture_envelopes, mode, - start_profiler_func, - stop_profiler_func, make_options, teardown_profiling, ): @@ -331,7 +295,7 @@ def test_continuous_profiler_manual_start_and_stop_sampled( thread = threading.current_thread() for _ in range(3): - start_profiler_func() + start_profiler() envelopes.clear() @@ -345,7 +309,7 @@ def test_continuous_profiler_manual_start_and_stop_sampled( assert get_profiler_id() is not None, "profiler should be running" - stop_profiler_func() + stop_profiler() # the profiler stops immediately in manual mode assert get_profiler_id() is None, "profiler should not be running" @@ -368,21 +332,6 @@ def test_continuous_profiler_manual_start_and_stop_sampled( pytest.param("gevent", marks=requires_gevent), ], ) -@pytest.mark.parametrize( - ["start_profiler_func", "stop_profiler_func"], - [ - pytest.param( - start_profile_session, - stop_profile_session, - id="start_profile_session/stop_profile_session", - ), - pytest.param( - start_profiler, - stop_profiler, - id="start_profiler/stop_profiler (deprecated)", - ), - ], -) @pytest.mark.parametrize( "make_options", [ @@ -394,8 +343,6 @@ def test_continuous_profiler_manual_start_and_stop_unsampled( sentry_init, capture_envelopes, mode, - start_profiler_func, - stop_profiler_func, make_options, teardown_profiling, ): @@ -409,7 +356,7 @@ def test_continuous_profiler_manual_start_and_stop_unsampled( envelopes = capture_envelopes() - start_profiler_func() + start_profiler() with sentry_sdk.start_span(name="profiling"): with sentry_sdk.start_span(op="op"): @@ -417,7 +364,7 @@ def test_continuous_profiler_manual_start_and_stop_unsampled( assert_single_transaction_without_profile_chunks(envelopes) - stop_profiler_func() + stop_profiler() @pytest.mark.parametrize( @@ -538,21 +485,6 @@ def test_continuous_profiler_auto_start_and_stop_unsampled( ), ], ) -@pytest.mark.parametrize( - ["start_profiler_func", "stop_profiler_func"], - [ - pytest.param( - start_profile_session, - stop_profile_session, - id="start_profile_session/stop_profile_session", - ), - pytest.param( - start_profiler, - stop_profiler, - id="start_profiler/stop_profiler (deprecated)", - ), - ], -) @pytest.mark.parametrize( "make_options", [ @@ -563,8 +495,6 @@ def test_continuous_profiler_auto_start_and_stop_unsampled( def test_continuous_profiler_manual_start_and_stop_noop_when_using_trace_lifecyle( sentry_init, mode, - start_profiler_func, - stop_profiler_func, class_name, make_options, teardown_profiling, @@ -580,11 +510,11 @@ def test_continuous_profiler_manual_start_and_stop_noop_when_using_trace_lifecyl with mock.patch( f"sentry_sdk.profiler.continuous_profiler.{class_name}.ensure_running" ) as mock_ensure_running: - start_profiler_func() + start_profiler() mock_ensure_running.assert_not_called() with mock.patch( f"sentry_sdk.profiler.continuous_profiler.{class_name}.teardown" ) as mock_teardown: - stop_profiler_func() + stop_profiler() mock_teardown.assert_not_called()