lib/mongo/admin.rb
# Return the current database profiling level.
Return the current database profiling level.
Return the current database profiling level .
def profiling_level
          oh = OrderedHash.new
          oh[:profile] = -1
          doc = @db.db_command(oh)
          raise "Error with profile command: #{doc.inspect}" unless @db.ok?(doc) && doc['was'].kind_of?(Numeric)
          case doc['was'].to_i
          when 0
            :off
          when 1
            :slow_only
          when 2
            :all
          else
            raise "Error: illegal profiling level value #{doc['was']}"
          end
        end
def profiling_level oh = OrderedHash . new oh [ :profile ] = - 1 doc = @db . db_command ( oh ) raise "Error with profile command: #{doc.inspect}" unless @db . ok? ( doc ) && doc [ 'was' ] . kind_of? ( Numeric ) case doc [ 'was' ] . to_i when 0 :off when 1 :slow_only when 2 :all else raise "Error: illegal profiling level value #{doc['was']}" end end
Return the current database profiling level.
Return the current database profiling level .