Sha256: 327b805ed448a46ebfb9de3723fbcd0036892607df3a37744ef6dca99c424773

Contents?: true

Size: 769 Bytes

Versions: 32

Compression:

Stored size: 769 Bytes

Contents

# encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.

module NewRelic
  class Control
    module Profiling

      # A flag used in dev mode to indicate if profiling is available
      def profiling?
        @profiling
      end

      def profiling_available?
        @profiling_available ||=
          begin
            require 'ruby-prof'
            true
          rescue LoadError; end
      end
      # Set the flag for capturing profiles in dev mode.  If RubyProf is not
      # loaded a true value is ignored.
      def profiling=(val)
        @profiling = profiling_available? && val && defined?(RubyProf)
      end
    end
    include Profiling
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
newrelic_rpm-3.7.2.195 lib/new_relic/control/profiling.rb
newrelic_rpm-3.7.2.192 lib/new_relic/control/profiling.rb
newrelic_rpm-3.7.2.190.beta lib/new_relic/control/profiling.rb
newrelic_rpm-3.7.1.188 lib/new_relic/control/profiling.rb
newrelic_rpm-3.7.1.182 lib/new_relic/control/profiling.rb
newrelic_rpm-3.7.1.180 lib/new_relic/control/profiling.rb
newrelic_rpm-3.7.0.177 lib/new_relic/control/profiling.rb
newrelic_rpm-3.7.0.174.beta lib/new_relic/control/profiling.rb
newrelic_rpm-3.6.9.171 lib/new_relic/control/profiling.rb
newrelic_rpm-3.6.8.168 lib/new_relic/control/profiling.rb
newrelic_rpm-3.6.8.164 lib/new_relic/control/profiling.rb
newrelic_rpm-3.6.7.159 lib/new_relic/control/profiling.rb
newrelic_rpm-3.6.7.159.beta lib/new_relic/control/profiling.rb
newrelic_rpm-3.6.7.152 lib/new_relic/control/profiling.rb
newrelic_rpm-3.6.6.147 lib/new_relic/control/profiling.rb
newrelic_rpm-3.6.5.130 lib/new_relic/control/profiling.rb
newrelic_rpm-3.6.4.122 lib/new_relic/control/profiling.rb
newrelic_rpm-3.6.4.113.beta lib/new_relic/control/profiling.rb
newrelic_rpm-3.6.3.111 lib/new_relic/control/profiling.rb
newrelic_rpm-3.6.3.106 lib/new_relic/control/profiling.rb