File tree Expand file tree Collapse file tree 1 file changed +2
-19
lines changed
Expand file tree Collapse file tree 1 file changed +2
-19
lines changed Original file line number Diff line number Diff line change 33require 'securerandom'
44
55module Sentry
6- class NoopProfiler
7- def initialize ( _configuration ) ; end
8- def start ; end
9- def stop ; end
10- def set_initial_sample_decision ( _transaction_sampled ) ; end
11-
12- def profile_context
13- { }
14- end
15-
16- def to_hash
17- { }
18- end
19- end
20-
21- class StackProfProfiler < NoopProfiler
6+ class Profiler
227 VERSION = '1'
238 PLATFORM = 'ruby'
249 # 101 Hz in microseconds
@@ -32,7 +17,7 @@ def initialize(configuration)
3217 @started = false
3318 @sampled = nil
3419
35- @profiling_enabled = configuration . profiling_enabled?
20+ @profiling_enabled = defined? ( StackProf ) && configuration . profiling_enabled?
3621 @profiles_sample_rate = configuration . profiles_sample_rate
3722 @project_root = configuration . project_root
3823 @app_dirs_pattern = configuration . app_dirs_pattern || Backtrace ::APP_DIRS_PATTERN
@@ -238,6 +223,4 @@ def split_module(name)
238223 [ function , mod ]
239224 end
240225 end
241-
242- Profiler = defined? ( StackProf ) ? StackProfProfiler : NoopProfiler
243226end
You can’t perform that action at this time.
0 commit comments