Skip to content

Commit ca714a5

Browse files
committed
reverse profile_session start/stop methods deprecation
1 parent bc54a1d commit ca714a5

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

sentry_sdk/profiler/__init__.py

Lines changed: 4 additions & 4 deletions
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

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -145,32 +145,34 @@ def try_profile_lifecycle_trace_start():
145145

146146
def start_profiler():
147147
# type: () -> None
148+
if _scheduler is None:
149+
return
150+
151+
_scheduler.manual_start()
148152

149-
# TODO: deprecate this as it'll be replaced by `start_profile_session`
150-
start_profile_session()
151153

152154

153155
def start_profile_session():
154156
# type: () -> None
155-
if _scheduler is None:
156-
return
157157

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

160161

161162
def stop_profiler():
162163
# type: () -> None
164+
if _scheduler is None:
165+
return
163166

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

167169

168170
def stop_profile_session():
169171
# type: () -> None
170-
if _scheduler is None:
171-
return
172172

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

175177

176178
def teardown_continuous_profiler():

0 commit comments

Comments
 (0)