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

Defined Under Namespace

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

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Methods included from GCStatistics

gc_statistics

Methods included from RubyProfiler

ruby_profiler

Class Method Details

.gc_statistics?Boolean

Returns:

  • (Boolean)


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

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)


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

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