Assert various performance metrics on a block of code
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.gitignore
Gemfile
Gemfile.lock
README.rdoc
Rakefile
assert_performance.gemspec

README.rdoc

assert_performance

assert_performance supplies test/unit assertions for verifying that blocks of code have certain performance characteristics. For example, you can write something like this in a test:

assert_performance :max_queries => 1, :max_time => 50 do
  Person.find_by_id(1)
end

and it will verify that the block of code only performs one active_record query and takes less than 50 ms.