Class: Mongo::Server::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/patches/db/mongo.rb

Overview

Mongo/Mongoid 5 patches

Instance Method Summary collapse

Instance Method Details

#dispatch_with_timing(*args, &blk) ⇒ Object Also known as: dispatch



3
4
5
6
7
8
9
10
# File 'lib/patches/db/mongo.rb', line 3

def dispatch_with_timing(*args, &blk)
  return dispatch_without_timing(*args, &blk) unless SqlPatches.should_measure?

  result, _record = SqlPatches.record_sql(args[0][0].payload.inspect) do
    dispatch_without_timing(*args, &blk)
  end
  return result
end