<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -30,6 +30,7 @@ module Rack
     def initialize(app, options = {})
       @app = app
       @printer = parse_printer(options[:printer])
+      @times = (options[:times] || 1).to_i
     end
 
     def call(env)
@@ -58,10 +59,12 @@ module Rack
 
       def profile(env, mode)
         RubyProf.measure_mode = RubyProf.const_get(mode.upcase)
-        result = RubyProf.profile { @app.call(env) }
-        headers = headers(@printer, env, mode)
-        body = print(@printer, result)
-        [200, headers, body]
+
+        result = RubyProf.profile do
+          @times.times { @app.call(env) }
+        end
+
+        [200, headers(@printer, env, mode), print(@printer, result)]
       end
 
       def print(printer, result)</diff>
      <filename>lib/rack/profiler.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,6 +9,7 @@ context 'Rack::Profiler' do
   specify 'printer defaults to RubyProf::CallTreePrinter' do
     profiler = Rack::Profiler.new(nil)
     profiler.instance_variable_get('@printer').should == RubyProf::CallTreePrinter
+    profiler.instance_variable_get('@times').should == 1
   end
   
   specify 'CallTreePrinter has correct headers' do  </diff>
      <filename>test/spec_rack_profiler.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>5aeb545d6a91ec37bff569ce41a578bfb94ed86f</id>
    </parent>
  </parents>
  <author>
    <name>Jeremy Kemper</name>
    <email>jeremy@bitsweat.net</email>
  </author>
  <url>http://github.com/rtomayko/rack-contrib/commit/af0d3d137bc39f13221bf16130628b007f007cd2</url>
  <id>af0d3d137bc39f13221bf16130628b007f007cd2</id>
  <committed-date>2008-12-18T17:07:21-08:00</committed-date>
  <authored-date>2008-12-18T17:07:21-08:00</authored-date>
  <message>Add 'times' option to run the profiled app more than once</message>
  <tree>6e65ecb7d7628d3adfd771505a6a40ffaf9075a8</tree>
  <committer>
    <name>Jeremy Kemper</name>
    <email>jeremy@bitsweat.net</email>
  </committer>
</commit>
