Skip to content
This repository
Browse code

refactor instance type count resetting

  • Loading branch information...
commit dce25d05bd3ae014618f8ce77a7bd1a80b500f7a 1 parent 8c8b933
authored April 05, 2011

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. 4  lib/oink/middleware.rb
4  lib/oink/middleware.rb
@@ -20,7 +20,6 @@ def call(env)
20 20
       log_memory
21 21
       log_activerecord
22 22
       log_completed
23  
-      reset_objects_instantiated
24 23
       [status, headers, body]
25 24
     end
26 25
 
@@ -48,13 +47,14 @@ def log_activerecord
48 47
         sorted_list = Oink::HashUtils.to_sorted_array(ActiveRecord::Base.instantiated_hash)
49 48
         sorted_list.unshift("Total: #{ActiveRecord::Base.total_objects_instantiated}")
50 49
         @logger.info("Instantiation Breakdown: #{sorted_list.join(' | ')}")
  50
+        reset_objects_instantiated
51 51
       end
52 52
     end
53 53
 
54 54
   private
55 55
 
56 56
     def reset_objects_instantiated
57  
-      ActiveRecord::Base.reset_instance_type_count if @instruments.include?(:activerecord)
  57
+      ActiveRecord::Base.reset_instance_type_count
58 58
     end
59 59
 
60 60
   end

0 notes on commit dce25d0

Please sign in to comment.
Something went wrong with that request. Please try again.