Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-6428

db.serverStatus().recordStats should group databases under a key

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 2.2.0-rc1
    • Component/s: Diagnostics
    • Storage Execution

      The global totals (accessesNotInMemory and pageFaultExceptionsThrown) currently occupy the same namespace as the database stats, which allows for a conflict if a database were to be named "accessesNotInMemory". This isn't an issue for BSON, as it doesn't require keys to be unique, but it would pose a problem working with this as JSON. I suggest grouping the databases under another key.

      //Now
      > db.serverStatus().recordStats
      {
      	"accessesNotInMemory" : 0,
      	"pageFaultExceptionsThrown" : 0,
      	"local" : {
      		"accessesNotInMemory" : 0,
      		"pageFaultExceptionsThrown" : 0
      	},
      	"test" : {
      		"accessesNotInMemory" : 0,
      		"pageFaultExceptionsThrown" : 0
      	}
      }
      //Better
      > db.serverStatus().recordStats
      {
      	"accessesNotInMemory" : 0,
      	"pageFaultExceptionsThrown" : 0,
      	"databases" : {
      		"local" : {
      			"accessesNotInMemory" : 0,
      			"pageFaultExceptionsThrown" : 0
      		},
      		"test" : {
      			"accessesNotInMemory" : 0,
      			"pageFaultExceptionsThrown" : 0
      		}
      	}
      }
      
      

            Assignee:
            backlog-server-execution [DO NOT USE] Backlog - Storage Execution Team
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: