作者热门文章
- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
我有一个运行在 4.1.6 和 Ruby 2.1.3 上的 Rails 应用程序。有时在某些请求上他们需要很长时间,但并非总是如此。当我检查 newrelic 时,我仍然无法识别或追踪慢度线。
最佳答案
查看 perftools - 您可以使用 googles perftools,或 ruby specific implementation .关于它有一篇很好的文章 here
它贯穿您的应用程序并通过确定各个方法调用所花费的时间来发现瓶颈。你会得到这样的输出:
Total: 23 samples
18 78.3% 78.3% 18 78.3% BigDecimal#div
4 17.4% 95.7% 4 17.4% BigDecimal#*
1 4.3% 100.0% 23 100.0% BigMath#PI
0 0.0% 100.0% 23 100.0% BigMath.PI
在这种情况下,您需要花一些时间查看 BigDecimal
中的 div
方法
关于ruby-on-rails - 如何识别 Rails 应用程序中的慢行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26590126/
我是一名优秀的程序员,十分优秀!