Module: ActiveProfiling

Extended by:
GCStatistics, RubyProfiler
Defined in:
lib/active-profiling.rb,
lib/active-profiling/railtie.rb,
lib/active-profiling/version.rb,
lib/active-profiling/gc_statistics.rb,
lib/active-profiling/ruby_profiler.rb,
lib/active-profiling/ruby_profiler/output.rb

Defined Under Namespace

Modules: ActionController, ActiveRecord, GCStatistics, RubyProfiler Classes: Railtie

Constant Summary collapse

VERSION =
'2.0.2'

Class Method Summary collapse

Methods included from GCStatistics

gc_statistics

Methods included from RubyProfiler

ruby_profiler

Class Method Details

.gc_statistics?Boolean

Returns:

  • (Boolean)


5
6
7
8
9
10
11
# File 'lib/active-profiling.rb', line 5

def gc_statistics?
  if defined?(@has_gc_statistics)
    @has_gc_statistics
  else
    @has_gc_statistics = defined?(GC::Profiler) || GC.respond_to?(:enable_stats)
  end
end

.ruby_prof?Boolean

Returns:

  • (Boolean)


13
14
15
16
17
18
19
# File 'lib/active-profiling.rb', line 13

def ruby_prof?
  if defined?(@has_ruby_prof)
    @has_ruby_prof
  else
    @has_ruby_prof = defined?(RubyProf)
  end
end