Rob*_*ert 4 ruby-on-rails performance-testing ruby-on-rails-3
我想为我的rails 3应用程序进行性能测试,我根据rails在线指南进行了尝试
rake test:profile
Run Code Online (Sandbox Code Playgroud)
它给出了一些输出:
Specify ruby-prof as application's dependency in Gemfile to run benchmarks.
Loaded suite /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/rake_test_loader
Started
.
Finished in 0.326233 seconds.
1 tests, 0 assertions, 0 failures, 0 errors, 0 skips
Run Code Online (Sandbox Code Playgroud)
但根据指南,应该有类似的东西:
BrowsingTest#test_homepage (31 ms warmup)
wall_time: 6 ms
memory: 437.27 KB
objects: 5,514
gc_runs: 0
gc_time: 19 ms
Run Code Online (Sandbox Code Playgroud)
以及在app的tmp/performance dir中生成的一些日志文件,在我的情况下不存在.
性能测试是在我的应用程序的test\performance目录中生成的示例测试browse_test.rb:
require 'test_helper'
require 'rails/performance_test_help'
# Profiling results for each test method are written to tmp/performance.
class BrowsingTest < ActionDispatch::PerformanceTest
def test_homepage
get '/'
end
end
Run Code Online (Sandbox Code Playgroud)
我的rails版本是3.0.10.任何人都可以给我一些提示或提示吗?
Nyc*_*cen 10
有完全相同的问题,并通过运行解决它
rvm install 1.9.2-p290 --patch gcdata # Make sure you have the same patch version
Run Code Online (Sandbox Code Playgroud)
(注意:不确定这一步有多少,因为我有错误,但因为它是我所做的一部分......)
添加到我的gemfile
gem 'ruby-prof', :git => 'git://github.com/wycats/ruby-prof.git'
gem 'test-unit'
Run Code Online (Sandbox Code Playgroud)
当然还在跑步
bundle install
Run Code Online (Sandbox Code Playgroud)
一些阅读帮助了我
| 归档时间: |
|
| 查看次数: |
1738 次 |
| 最近记录: |