Created
July 10, 2014 08:31
-
-
Save fujimura/f4b4146da2f552ba81ed to your computer and use it in GitHub Desktop.
Idea of RSpec-ish benchmarking tool
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark_helper' | |
# Describe performance like RSpec-ish DSL | |
describe Api::Notifications do | |
before do | |
# Can use FactoryGirl to populate data | |
@me = create :user | |
create :post, author: @user | |
1000.times do | |
user = create :user | |
@me.subscribe! user | |
create :post, author: user | |
end | |
end | |
# Block run within #benchmark will be measured | |
benchmark "Receiving notification" do | |
get '/notifications' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment