您建议使用哪些工具来配置Rails应用程序?

lsd*_*sdr 45 ruby profiling ruby-on-rails

我一直在寻找Rails的分析工具.我正在玩和测试ruby-prof和railsbench,但是我对使用然后工作所需的调整和修改量感到沮丧.

虽然我不介意(很多)调整,但我想知道是否还有其他更直接易用的工具来分析Rails应用程序?你推荐哪些工具?

mwi*_*ams 44

您也可以使用内置的分析器:

$ ruby script/performance/profiler 'User.new' 5
  %   cumulative   self              self     total
 time   seconds   seconds    calls  ms/call  ms/call  name
189.25     1.76      1.76        1  1760.00  1760.00  Profiler__.start_profile
 43.01     2.16      0.40      115     3.48     3.91  ActiveRecord::ConnectionAdapters::Column#simplified_type
  8.60     2.24      0.08       15     5.33     8.67  Array#each
  7.53     2.31      0.07      115     0.61     5.39  ActiveRecord::ConnectionAdapters::Column#initialize
  6.45     2.37      0.06      115     0.52     0.52  ActiveRecord::ConnectionAdapters::Column#type_cast
  5.38     2.42      0.05      690     0.07     0.07  Regexp#===
  0.00     2.69      0.00       10     0.00     0.00  Process.times
  0.00     2.69      0.00       10     0.00     0.00  Benchmark.times
Run Code Online (Sandbox Code Playgroud)

请注意,对于Rails 3,您可以使用rails profiler.

  • 有没有办法通过探查器调用控制器操作或运行路由?我试过'get'/'`和其他变种,但无法让它工作. (2认同)
  • @ErikJ我今天有同样的需求,这是我最终使用的东西.https://gist.github.com/1389759您可以通过在控制台或调试器中向其发送请求来使用它来检查和分析您的应用.希望能帮助到你. (2认同)

Cor*_*rch 20

New Relic提供Rails分析,包括免费的'Lite'版本.

  • 此外,值得一提的是,您可以使用"开发人员"模式,该模式允许您在没有NewRelic帐户的情况下在本地使用它. (7认同)