diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2005-07-03 08:32:34 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2005-07-03 08:32:34 +0000 |
commit | 5bc1e39b35da6ed7eaef8e215c57c75acb154f76 (patch) | |
tree | 52f47227bf08c9b9337d7e663c8e691bbf9a7f74 /activerecord/lib/active_record/connection_adapters | |
parent | 45c4b07f5a4e1d7c058d19345c0d0f808ce1abe7 (diff) | |
download | rails-5bc1e39b35da6ed7eaef8e215c57c75acb154f76.tar.gz rails-5bc1e39b35da6ed7eaef8e215c57c75acb154f76.tar.bz2 rails-5bc1e39b35da6ed7eaef8e215c57c75acb154f76.zip |
r1612@asus: jeremy | 2005-07-03 04:35:59 -0700
don't include Benchmark into AbstractAdapter directly. call Benchmark.realtime instead of bm = Benchmark.measure, bm.real
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1630 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rwxr-xr-x | activerecord/lib/active_record/connection_adapters/abstract_adapter.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb index 459b05413c..18891a28ce 100755 --- a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb @@ -258,8 +258,6 @@ module ActiveRecord class AbstractAdapter @@row_even = true - include Benchmark - def initialize(connection, logger = nil) # :nodoc: @connection, @logger = connection, logger @runtime = 0 @@ -397,9 +395,9 @@ module ActiveRecord if block_given? if @logger and @logger.level <= Logger::INFO result = nil - bm = measure { result = yield } - @runtime += bm.real - log_info(sql, name, bm.real) + seconds = Benchmark.realtime { result = yield } + @runtime += seconds + log_info(sql, name, seconds) result else yield |