Skip to content

Instantly share code, notes, and snippets.

@woodbridge
Created July 17, 2012 14:37
Show Gist options
  • Select an option

  • Save woodbridge/3129776 to your computer and use it in GitHub Desktop.

Select an option

Save woodbridge/3129776 to your computer and use it in GitHub Desktop.
require 'pivotal-tracker'
require './lib/formats/large_text'
require 'benchmark'
KEY = '1cce9f8bc294bcd160a7767304da5b68'
PivotalTracker::Client.token = KEY
PivotalTracker::Client.use_ssl = true
test_proj = PivotalTracker::Project.find(398049)
def story_set_of_size(proj, n)
stories = proj.stories.all
ret = []
n.times { ret << stories.sample }
ret
end
Benchmark.bm do |b|
b.report "10 stories" do
stories = story_set_of_size test_proj, 10
LargeTextCardPrinter.new(stories, "10").write_to
end
b.report "30 stories" do
stories = story_set_of_size test_proj, 30
LargeTextCardPrinter.new(stories, "30").write_to
end
b.report "60 stories" do
stories = story_set_of_size test_proj, 60
LargeTextCardPrinter.new(stories, "60").write_to
end
# b.report "500 stories" do
# stories = story_set_of_size test_proj, 500
# LargeTextCardPrinter.new(stories, "500").write_to
# end
#
# b.report "1000 stories" do
# stories = story_set_of_size test_proj, 1000
# LargeTextCardPrinter.new(stories, "1000").write_to
# end
#
# b.report "10,000 stories" do
# stories = story_set_of_size test_proj, 10000
# LargeTextCardPrinter.new(stories, "10,000").write_to
# end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment