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

XMLWordPrintableJSON

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

      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:
            [DO NOT USE] Backlog - Storage Execution Team
            Reporter:
            Jeremy Mikola
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: