Sha256: d5ef8f877f76328164104dcfece72785dc0f75f1f228f98e915795ab51e97a33

Contents?: true

Size: 1.38 KB

Versions: 21

Compression:

Stored size: 1.38 KB

Contents

# frozen_string_literal: true

module Datadog
  module Core
    module Environment
      # Reports YJIT primitive runtime statistics.
      module YJIT
        module_function

        # Inline code size
        def inline_code_size
          ::RubyVM::YJIT.runtime_stats[:inline_code_size]
        end

        # Outlined code size
        def outlined_code_size
          ::RubyVM::YJIT.runtime_stats[:outlined_code_size]
        end

        # GCed pages
        def freed_page_count
          ::RubyVM::YJIT.runtime_stats[:freed_page_count]
        end

        # GCed code size
        def freed_code_size
          ::RubyVM::YJIT.runtime_stats[:freed_code_size]
        end

        # Live pages
        def live_page_count
          ::RubyVM::YJIT.runtime_stats[:live_page_count]
        end

        # Code GC count
        def code_gc_count
          ::RubyVM::YJIT.runtime_stats[:code_gc_count]
        end

        # Size of memory region allocated for JIT code
        def code_region_size
          ::RubyVM::YJIT.runtime_stats[:code_region_size]
        end

        # Total number of object shapes
        def object_shape_count
          ::RubyVM::YJIT.runtime_stats[:object_shape_count]
        end

        def available?
          defined?(::RubyVM::YJIT) \
            && ::RubyVM::YJIT.enabled? \
            && ::RubyVM::YJIT.respond_to?(:runtime_stats)
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
ddtrace-1.23.3 lib/datadog/core/environment/yjit.rb
ddtrace-1.23.2 lib/datadog/core/environment/yjit.rb
datadog-2.1.0 lib/datadog/core/environment/yjit.rb
datadog-2.0.0 lib/datadog/core/environment/yjit.rb
ddtrace-1.23.1 lib/datadog/core/environment/yjit.rb
datadog-2.0.0.beta2 lib/datadog/core/environment/yjit.rb
ddtrace-1.22.0 lib/datadog/core/environment/yjit.rb
datadog-2.0.0.beta1 lib/datadog/core/environment/yjit.rb
ddtrace-1.21.1 lib/datadog/core/environment/yjit.rb
ddtrace-1.21.0 lib/datadog/core/environment/yjit.rb
ddtrace-1.20.0 lib/datadog/core/environment/yjit.rb
ddtrace-1.19.0 lib/datadog/core/environment/yjit.rb
ddtrace-1.18.0 lib/datadog/core/environment/yjit.rb
ddtrace-1.17.0 lib/datadog/core/environment/yjit.rb
ddtrace-1.16.2 lib/datadog/core/environment/yjit.rb
ddtrace-1.16.1 lib/datadog/core/environment/yjit.rb
ddtrace-1.16.0 lib/datadog/core/environment/yjit.rb
ddtrace-1.15.0 lib/datadog/core/environment/yjit.rb
ddtrace-1.14.0 lib/datadog/core/environment/yjit.rb
ddtrace-1.13.1 lib/datadog/core/environment/yjit.rb