Permalink
Browse files

moped is not as fast as it says

  • Loading branch information...
1 parent 213f466 commit a55b123ea383552ca8ff98ce9f82d4c10bc890c3 @kml committed Jul 4, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/moped/node.rb
View
@@ -531,13 +531,13 @@ def logging(operations)
instrument_start = (logger = Moped.logger) && logger.debug? && Time.new
yield
ensure
- log_operations(logger, operations, Time.new - instrument_start) if instrument_start
+ log_operations(logger, operations, 1000 * (Time.new.to_f - instrument_start.to_f)) if instrument_start
end
- def log_operations(logger, ops, duration)
+ def log_operations(logger, ops, duration_ms)
prefix = " MOPED: #{resolved_address} "
indent = " "*prefix.length
- runtime = (" (%.4fms)" % duration)
+ runtime = (" (%.4fms)" % duration_ms)
if ops.length == 1
logger.debug prefix + ops.first.log_inspect + runtime

0 comments on commit a55b123

Please sign in to comment.