Module: Quandl::Cassandra::Batch::Logging::ClassMethods

Defined in:
lib/quandl/cassandra/batch/logging.rb

Instance Method Summary collapse

Instance Method Details

#execute(rows, &block) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/quandl/cassandra/batch/logging.rb', line 8

def execute(rows, &block)
  # log init
  statement = block.call(rows[0].collect{'?'})
  t1 = Time.now
  # call method
  r = super if defined?(super)
  # log write
  Quandl::Logger.debug("(#{t1.elapsed_ms}) ".blue + " [#{rows.count} rows] BATCH #{statement}")
  r
end