【问题标题】:Rails 3.0.12 Performance test issuesRails 3.0.12 性能测试问题
【发布时间】:2012-05-13 06:55:29
【问题描述】:

我正在尝试运行基准测试和性能测试,但没有显示指标...

红宝石-v:

ruby 1.9.2p320 (2012-04-20 revision 35421) [x86_64-linux]

rvm 列表:

=> ruby-1.9.2-p320-perf [ x86_64 ]

运行rake test:profile的结果:

BrowsingTest#test_homepage (130 ms warmup)
        process_time: 18446744073.71 sec
              memory: unsupported
             objects: unsupported
BrowsingTest#test_intel_companies_newstats (34 ms warmup)
        process_time: 26 ms
              memory: unsupported
             objects: unsupported

并运行rake test:benchmark

BrowsingTest#test_homepage (103 ms warmup)
           wall_time: 23 ms
              memory: 0.00 KB
             objects: 0
             gc_runs: 0
             gc_time: 0.00 ms
BrowsingTest#test_intel_companies_newstats (31 ms warmup)
           wall_time: 9 ms
              memory: 0.00 KB
             objects: 0
             gc_runs: 0
             gc_time: 0.00 ms

我的宝石文件

group :test do
    gem 'capybara'

    # for performance tests
    gem 'ruby-prof', :git => 'git://github.com/wycats/ruby-prof.git'
    gem 'test-unit'
end

当我尝试运行时:

rvm install 1.9.2 --patch gcdata --name perf

我明白了:

Installing Ruby from source to: /home/victor/.rvm/rubies/ruby-1.9.2-p320-perf, this may take a while depending on your cpu(s)...

ruby-1.9.2-p320-perf - #fetching 
ruby-1.9.2-p320-perf - #extracting ruby-1.9.2-p320 to /home/victor/.rvm/src/ruby-1.9.2-p320-perf
ruby-1.9.2-p320-perf - #extracted to /home/victor/.rvm/src/ruby-1.9.2-p320-perf
Patch 'gcdata' not found.

【问题讨论】:

    标签: ruby ruby-on-rails-3 testing performance-testing


    【解决方案1】:

    确实你需要打补丁的 gc。 但此补丁不适用于所有红宝石。对于 ruby​​ 1.9.2,您必须使用补丁 290。 所以以下应该可以正常工作

    rvm install 1.9.2-p290 --patch gcdata
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-04-05
    • 1970-01-01
    • 1970-01-01
    • 2013-10-01
    • 1970-01-01
    • 2015-02-22
    • 1970-01-01
    • 2012-11-25
    相关资源
    最近更新 更多