Skip to content

Commit 2724d65

Browse files
authored
chore(profiling): Change continuous profile buffer size (#3987)
This ~lowers the sampling frequency of continuous profiles to 21Hz and~ increases the buffer size to 1 minute to match the desired settings for continuous profiling.
1 parent 91bf322 commit 2724d65

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

sentry_sdk/profiler/continuous_profiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ def teardown(self):
407407
self.buffer = None
408408

409409

410-
PROFILE_BUFFER_SECONDS = 10
410+
PROFILE_BUFFER_SECONDS = 60
411411

412412

413413
class ProfileBuffer:

sentry_sdk/transport.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ def _request(
720720

721721
try:
722722
import httpcore
723-
import h2 # type: ignore # noqa: F401
723+
import h2 # noqa: F401
724724
except ImportError:
725725
# Sorry, no Http2Transport for you
726726
class Http2Transport(HttpTransport):

tests/profiler/test_continuous_profiler.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def test_continuous_profiler_auto_start_and_manual_stop(
200200

201201
with sentry_sdk.start_transaction(name="profiling"):
202202
with sentry_sdk.start_span(op="op"):
203-
time.sleep(0.05)
203+
time.sleep(0.1)
204204

205205
assert_single_transaction_with_profile_chunks(envelopes, thread)
206206

@@ -211,7 +211,7 @@ def test_continuous_profiler_auto_start_and_manual_stop(
211211

212212
with sentry_sdk.start_transaction(name="profiling"):
213213
with sentry_sdk.start_span(op="op"):
214-
time.sleep(0.05)
214+
time.sleep(0.1)
215215

216216
assert_single_transaction_without_profile_chunks(envelopes)
217217

@@ -221,7 +221,7 @@ def test_continuous_profiler_auto_start_and_manual_stop(
221221

222222
with sentry_sdk.start_transaction(name="profiling"):
223223
with sentry_sdk.start_span(op="op"):
224-
time.sleep(0.05)
224+
time.sleep(0.1)
225225

226226
assert_single_transaction_with_profile_chunks(envelopes, thread)
227227

0 commit comments

Comments
 (0)