Rails 4 内存分析 [英] Rails 4 memory profiling

查看:40
本文介绍了Rails 4 内存分析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要分析 rails 4 应用程序的内存使用情况(使用 ruby​​ MRI).一点点谷歌搜索让我进入了 http://guides.rubyonrails.org/v3.2.13/performance_testing.html

I need to profile the memory usage of a rails 4 application (using ruby MRI). A little bit of googling made me step into http://guides.rubyonrails.org/v3.2.13/performance_testing.html

我有两个问题:

  • 是否与 rails 4 兼容
  • 我正在使用 rspec.似乎我的 rake test 测试不可用(rails generator performance_test).例如,当我输入 rake test:profile 时,我收到 不知道如何构建任务 'test:profile'.有人知道如何解决这个问题吗?
  • Is it compatible with rails 4
  • I am using rspec. It seems that my rake test tasts are not available (neither rails generator performance_test). When I type rake test:profile for instance, I receive Don't know how to build task 'test:profile'. Does anybody know how to fix this ?

预先感谢您的帮助.

推荐答案

Oink 是我使用的东西导轨 4.

Oink is something I use with Rails 4.

Oink 向 rails 添加内存和活动记录实例化信息在运行时记录并提供一个可执行文件来帮助消化增强的日志.

Oink adds memory and active record instantiation information to rails log during runtime and provides an executable to help digest the enhanced logs.

给定一个最小阈值和一个指标(内存或活动记录实例化),oink 可执行报告:

Given a minimum threshold and a metric (memory or active record instantiation), the oink executable reports:

单次请求超过阈值的前十名metric,按超过阈值最多的请求排序

The top ten single requests which exceeded the threshold for the metric, ordered by the request which exceeded the threshold the most

每个动作超过指标阈值的次数,按超过阈值的动作排序

The number of times each action exceeded the threshold for the metric, ordered by the action which exceeded the threshold the most

(在详细模式下)超过的请求产生的日志行门槛

(in verbose mode) The log lines produced by requests which exceeded the threshold

这篇关于Rails 4 内存分析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆