I have a Ruby on Rails app, and I want to monitor the GC with New Relic. The documentation on how to do this is very scarce.

I already have New Relic collecting data from my app. What I want is to add GC profiling. Can anyone explain to me how this is done?

有帮助吗?

解决方案

You can enable GC profiling instrumentation in New Relic using one of these calls in your application initialization:

  • MRI 1.9.2 or higher: GC::Profiler.enable
  • Ruby Enterprise Edition: GC.enable_stats

For your Rails application, you can either add this call to an initializer in config/initializers, or add it directly to your config/application.rb file.

You can find more information on this at Ruby agent: Garbage collection.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top