Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

refactor instance type count resetting

  • Loading branch information...
commit dce25d05bd3ae014618f8ce77a7bd1a80b500f7a 1 parent 8c8b933
Eirik Dentz Sinclair & Noah Davis authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/oink/middleware.rb
View
4 lib/oink/middleware.rb
@@ -20,7 +20,6 @@ def call(env)
log_memory
log_activerecord
log_completed
- reset_objects_instantiated
[status, headers, body]
end
@@ -48,13 +47,14 @@ def log_activerecord
sorted_list = Oink::HashUtils.to_sorted_array(ActiveRecord::Base.instantiated_hash)
sorted_list.unshift("Total: #{ActiveRecord::Base.total_objects_instantiated}")
@logger.info("Instantiation Breakdown: #{sorted_list.join(' | ')}")
+ reset_objects_instantiated
end
end
private
def reset_objects_instantiated
- ActiveRecord::Base.reset_instance_type_count if @instruments.include?(:activerecord)
+ ActiveRecord::Base.reset_instance_type_count
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.