Skip to content

Commit

Permalink
moped is not as fast as it says
Browse files Browse the repository at this point in the history
  • Loading branch information
kml committed Jul 4, 2012
1 parent 213f466 commit a55b123
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/moped/node.rb
Expand Up @@ -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
Expand Down

0 comments on commit a55b123

Please sign in to comment.