Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No expected output for my performance testing

I want to do a performance test for my rails 3 app and I did a try according to the rails online guide

rake test:profile

and it gave some output as:

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

But according to the guide, there should be something like:

BrowsingTest#test_homepage (31 ms warmup)
           wall_time: 6 ms
              memory: 437.27 KB
             objects: 5,514
             gc_runs: 0
             gc_time: 19 ms

and also some log files produced in app's tmp/performance dir, which doesn't exist in my case.

The performance test is the generated sample test, browsing_test.rb, in my app's test\performance dir:

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

And my rails version is 3.0.10. Can anyone give me some tips or hints?

like image 762
Robert Avatar asked Dec 28 '22 13:12

Robert


1 Answers

Had the exact same issue, and solved it by running

rvm install 1.9.2-p290 --patch gcdata # Make sure you have the same patch version

(note: not sure how much that step helped since I had an error, but since it's part of what I did...)

Adding to my gemfile

gem 'ruby-prof', :git => 'git://github.com/wycats/ruby-prof.git'
gem 'test-unit'

And of course running

bundle install

Some reading that helped me

  • http://rubylearning.com/blog/2011/08/14/performance-testing-rails-applications-how-to/
  • https://rails.lighthouseapp.com/projects/8994/tickets/4171-fresh-rails-3-app-cannot-run-performance-tests
  • http://guides.rubyonrails.org/performance_testing.html#installing-gc-patched-mri
like image 141
Arnaud Avatar answered Jan 08 '23 15:01

Arnaud