diff --git a/lib/yabeda/gc.rb b/lib/yabeda/gc.rb index 0d8bb8e..8e6b89b 100644 --- a/lib/yabeda/gc.rb +++ b/lib/yabeda/gc.rb @@ -57,7 +57,9 @@ module GC stats = ::GC.stat stats.each do |stat_name, value| - __send__("gc_#{stat_name}").set(EMPTY_HASH, value) + next unless ::Yabeda.gc.respond_to?(stat_name) + + ::Yabeda.gc.__send__(stat_name).set(EMPTY_HASH, value) end end end