Class: Appsignal::Probes::GvlProbe
- Includes:
- Helpers
- Defined in:
- lib/appsignal/probes/gvl.rb
Class Method Summary collapse
- .dependencies_present? ⇒ Boolean private
- .gvltools_0_2_or_newer? ⇒ Boolean private
- .ruby_3_2_or_newer? ⇒ Boolean private
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(appsignal: Appsignal, gvl_tools: ::GVLTools) ⇒ GvlProbe
constructor
A new instance of GvlProbe.
Constructor Details
#initialize(appsignal: Appsignal, gvl_tools: ::GVLTools) ⇒ GvlProbe
Returns a new instance of GvlProbe.
21 22 23 24 25 |
# File 'lib/appsignal/probes/gvl.rb', line 21 def initialize(appsignal: Appsignal, gvl_tools: ::GVLTools) Appsignal.logger.debug("Initializing GVL probe") @appsignal = appsignal @gvl_tools = gvl_tools end |
Class Method Details
.dependencies_present? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
7 8 9 |
# File 'lib/appsignal/probes/gvl.rb', line 7 def self.dependencies_present? defined?(::GVLTools) && gvltools_0_2_or_newer? && ruby_3_2_or_newer? && !Appsignal::System.jruby? end |
.gvltools_0_2_or_newer? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
12 13 14 |
# File 'lib/appsignal/probes/gvl.rb', line 12 def self.gvltools_0_2_or_newer? Gem::Version.new(::GVLTools::VERSION) >= Gem::Version.new("0.2.0") end |
.ruby_3_2_or_newer? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
17 18 19 |
# File 'lib/appsignal/probes/gvl.rb', line 17 def self.ruby_3_2_or_newer? Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.2.0") end |
Instance Method Details
#call ⇒ Object
27 28 29 30 |
# File 'lib/appsignal/probes/gvl.rb', line 27 def call probe_global_timer if @gvl_tools::GlobalTimer.enabled? probe_waiting_threads if @gvl_tools::WaitingThreads.enabled? end |