lib/dynamoid/adapter.rb in dynamoid-0.0.2 vs lib/dynamoid/adapter.rb in dynamoid-0.0.3

- old
+ new

@@ -14,10 +14,15 @@ @adapter = Dynamoid::Adapter.const_get(Dynamoid::Config.adapter.camelcase) @adapter.connect! if @adapter.respond_to?(:connect!) end def method_missing(method, *args) - return @adapter.send(method, *args) if @adapter.respond_to?(method) + if @adapter.respond_to?(method) + start = Time.now + result = @adapter.send(method, *args) + Dynamoid.logger.info "((#{((Time.now - start) * 1000.0).round(2)} ms) #{method.to_s.split('_').collect(&:upcase).join(' ')}#{ " - #{args.join(',')}" unless args.empty? }" + return result + end super end end end \ No newline at end of file