diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-12-09 11:17:11 -0800 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-12-09 11:17:11 -0800 |
commit | e8c4939fb3366472021c1af1331bfdfe5d7a5d75 (patch) | |
tree | 0f1d9e20cb5a0e30820f6ccc8e9dd735e3273f1f /activeresource/lib/active_resource | |
parent | c3fe6ebbfaedff8d6dd8f590bdd237fac174faac (diff) | |
download | rails-e8c4939fb3366472021c1af1331bfdfe5d7a5d75.tar.gz rails-e8c4939fb3366472021c1af1331bfdfe5d7a5d75.tar.bz2 rails-e8c4939fb3366472021c1af1331bfdfe5d7a5d75.zip |
Benchmark.ms
Diffstat (limited to 'activeresource/lib/active_resource')
-rw-r--r-- | activeresource/lib/active_resource/connection.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activeresource/lib/active_resource/connection.rb b/activeresource/lib/active_resource/connection.rb index 273fee3286..85103b53c5 100644 --- a/activeresource/lib/active_resource/connection.rb +++ b/activeresource/lib/active_resource/connection.rb @@ -146,8 +146,8 @@ module ActiveResource def request(method, path, *arguments) logger.info "#{method.to_s.upcase} #{site.scheme}://#{site.host}:#{site.port}#{path}" if logger result = nil - time = Benchmark.realtime { result = http.send(method, path, *arguments) } - logger.info "--> %d %s (%d %.2fs)" % [result.code, result.message, result.body ? result.body.length : 0, time] if logger + ms = Benchmark.ms { result = http.send(method, path, *arguments) } + logger.info "--> %d %s (%d %.0fms)" % [result.code, result.message, result.body ? result.body.length : 0, ms] if logger handle_response(result) rescue Timeout::Error => e raise TimeoutError.new(e.message) |