Skip to content

Commit f6db981

Browse files
authored
feat(profiling): reverse profile_session start/stop methods deprecation (#4162)
Revert back to using `start_profiler` and `stop_profiler` function names and deprecate the `*_session` ones instead. Prior PR that introduced the change we're undoing: #4056
1 parent 0d3bc3d commit f6db981

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

sentry_sdk/profiler/__init__.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
)
2626

2727
__all__ = [
28-
"start_profile_session",
29-
"start_profiler", # TODO: Deprecate this in favor of `start_profile_session`
30-
"stop_profile_session",
31-
"stop_profiler", # TODO: Deprecate this in favor of `stop_profile_session`
28+
"start_profile_session", # TODO: Deprecate this in favor of `start_profiler`
29+
"start_profiler",
30+
"stop_profile_session", # TODO: Deprecate this in favor of `stop_profiler`
31+
"stop_profiler",
3232
# DEPRECATED: The following was re-exported for backwards compatibility. It
3333
# will be removed from sentry_sdk.profiler in a future release.
3434
"MAX_PROFILE_DURATION_NS",

sentry_sdk/profiler/continuous_profiler.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -145,32 +145,32 @@ def try_profile_lifecycle_trace_start():
145145

146146
def start_profiler():
147147
# type: () -> None
148+
if _scheduler is None:
149+
return
148150

149-
# TODO: deprecate this as it'll be replaced by `start_profile_session`
150-
start_profile_session()
151+
_scheduler.manual_start()
151152

152153

153154
def start_profile_session():
154155
# type: () -> None
155-
if _scheduler is None:
156-
return
157156

158-
_scheduler.manual_start()
157+
# TODO: deprecate this as it'll be replaced by `start_profiler`
158+
start_profiler()
159159

160160

161161
def stop_profiler():
162162
# type: () -> None
163+
if _scheduler is None:
164+
return
163165

164-
# TODO: deprecate this as it'll be replaced by `stop_profile_session`
165-
stop_profile_session()
166+
_scheduler.manual_stop()
166167

167168

168169
def stop_profile_session():
169170
# type: () -> None
170-
if _scheduler is None:
171-
return
172171

173-
_scheduler.manual_stop()
172+
# TODO: deprecate this as it'll be replaced by `stop_profiler`
173+
stop_profiler()
174174

175175

176176
def teardown_continuous_profiler():

0 commit comments

Comments
 (0)