class Mysql2::Result

The best kind of instrumentation is in the actual db provider, however we don’t want to double instrument

Public Instance Methods

each(*args, &blk) click to toggle source
# File lib/patches/db/mysql2/alias_method.rb, line 7
def each(*args, &blk)
  return each_without_profiling(*args, &blk) unless defined?(@miniprofiler_sql_id)

  start        = Process.clock_gettime(Process::CLOCK_MONOTONIC)
  result       = each_without_profiling(*args, &blk)
  elapsed_time = SqlPatches.elapsed_time(start)

  @miniprofiler_sql_id.report_reader_duration(elapsed_time)
  result
end
Also aliased as: each_without_profiling
each_without_profiling(*args, &blk)
Alias for: each