Method: Mongo::DB#profiling_level

Defined in:
lib/jmongo/db.rb

#profiling_levelObject



240
241
242
243
244
245
246
247
248
# File 'lib/jmongo/db.rb', line 240

def profiling_level
  oh = BSON::OrderedHash.new
  oh['profile'] = -1
  doc = command(oh, :check_response => false)
  raise "Error with profile command: #{doc.inspect}" unless ok?(doc) && doc['was'].kind_of?(Numeric)
  was = ProfileLevel[doc['was'].to_i]
  raise "Error: illegal profiling level value #{doc['was']}" if was.nil?
  was.to_sym
end