Skip to content

Commit

Permalink
Merge pull request #35 from airbnb/darnaut/gc-stats
Browse files Browse the repository at this point in the history
Add option to enable garbage collection instrumentation
  • Loading branch information
darnaut authored Jul 20, 2017
2 parents 7d24bd5 + fbd99be commit 1bef1d2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions config.ru
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ log.level = Logger::INFO unless opts['debug']

opts['log'] = log

# Enable GC stats
if opts['gc_stats']
if defined? GC::Profiler && GC::Profiler.respond_to?(:enable)
GC::Profiler.enable
elsif GC.respond_to?(:enable_stats)
GC.enable_stats
end
end

# prepare statsd
require 'statsd-ruby'
STATSD = Statsd.new(opts['statsd_host'], opts['statsd_port'])
Expand Down

0 comments on commit 1bef1d2

Please sign in to comment.