From fcbfa8ad862f11f5dda37a8ea3a0ac6e5e06785e Mon Sep 17 00:00:00 2001 From: Nate Berkopec Date: Wed, 8 Oct 2025 13:08:41 +0900 Subject: [PATCH 1/3] Change default profiler interval to 1000 microseconds 10 ms is not a very useful profiler interval, so change it back to the StackProf default. --- sentry-ruby/lib/sentry/profiler.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sentry-ruby/lib/sentry/profiler.rb b/sentry-ruby/lib/sentry/profiler.rb index d1fd733f7..77ca39b8d 100644 --- a/sentry-ruby/lib/sentry/profiler.rb +++ b/sentry-ruby/lib/sentry/profiler.rb @@ -10,8 +10,8 @@ class Profiler VERSION = "1" PLATFORM = "ruby" - # 101 Hz in microseconds - DEFAULT_INTERVAL = 1e6 / 101 + # 1000 Hz in microseconds + DEFAULT_INTERVAL = 1000 MICRO_TO_NANO_SECONDS = 1e3 MIN_SAMPLES_REQUIRED = 2 From b62d5fd13cad573c92288116768b239ed5df0925 Mon Sep 17 00:00:00 2001 From: Nate Berkopec Date: Wed, 8 Oct 2025 13:16:31 +0900 Subject: [PATCH 2/3] Changelog/test --- CHANGELOG.md | 6 +++++- sentry-ruby/spec/sentry/profiler_spec.rb | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6451cefc9..a93fd776f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## Unreleased + +- Change default Stackprof profiler interval to 1000 microseconds ([#2742](https://github.com/getsentry/sentry-ruby/pull/2742)) + ## 5.28.0 ### Features @@ -7,7 +11,7 @@ ### Miscellaneous - Deprecate all Metrics related APIs [#2726](https://github.com/getsentry/sentry-ruby/pull/2726) - + Sentry [no longer has the Metrics Beta offering](https://sentry.zendesk.com/hc/en-us/articles/26369339769883-Metrics-Beta-Ended-on-October-7th) so all the following APIs linked to Metrics have been deprecated and will be removed in the next major. diff --git a/sentry-ruby/spec/sentry/profiler_spec.rb b/sentry-ruby/spec/sentry/profiler_spec.rb index 310ae0d59..0fa0c4b97 100644 --- a/sentry-ruby/spec/sentry/profiler_spec.rb +++ b/sentry-ruby/spec/sentry/profiler_spec.rb @@ -55,7 +55,7 @@ subject.set_initial_sample_decision(true) expect(StackProf).to receive(:start).with( - interval: 1e6 / 101, + interval: Profiler::DEFAULT_INTERVAL, mode: :wall, raw: true, aggregate: false From f512bd940bb8e9d444b033ffe86b2f592b2eb91d Mon Sep 17 00:00:00 2001 From: Nate Berkopec Date: Wed, 8 Oct 2025 13:27:31 +0900 Subject: [PATCH 3/3] Not clear to me how to actually run the tests so I'm gonna go with what I know works --- sentry-ruby/spec/sentry/profiler_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sentry-ruby/spec/sentry/profiler_spec.rb b/sentry-ruby/spec/sentry/profiler_spec.rb index 0fa0c4b97..d5a548912 100644 --- a/sentry-ruby/spec/sentry/profiler_spec.rb +++ b/sentry-ruby/spec/sentry/profiler_spec.rb @@ -55,7 +55,7 @@ subject.set_initial_sample_decision(true) expect(StackProf).to receive(:start).with( - interval: Profiler::DEFAULT_INTERVAL, + interval: 1000, mode: :wall, raw: true, aggregate: false