GC::Profiler available in ruby19
This commit is contained in:
parent
bec7cf2d1f
commit
2443b65101
@ -4,15 +4,12 @@ module Performance
|
||||
module Metrics
|
||||
class Base
|
||||
protected
|
||||
# Ruby 1.9 with GC::Profiler
|
||||
if defined?(GC::Profiler)
|
||||
def with_gc_stats
|
||||
GC::Profiler.enable
|
||||
GC.start
|
||||
yield
|
||||
ensure
|
||||
GC::Profiler.disable
|
||||
end
|
||||
def with_gc_stats
|
||||
GC::Profiler.enable
|
||||
GC.start
|
||||
yield
|
||||
ensure
|
||||
GC::Profiler.disable
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user