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

Provide global database-aggregated latency stats

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Diagnostics
    • Query Execution

      The global latency stats Server Status section currently aggregates all the latency information known to the server.
      We have a need for the same information except aggregated by database.

      For example, today we have:

      db.serverStatus().opLatencies
      {
      	"reads" : {
      		"latency" : NumberLong(9404373),
      		"ops" : NumberLong(90552)
      	},
      	"writes" : {
      		"latency" : NumberLong(4846358),
      		"ops" : NumberLong(22579)
      	},
      	"commands" : {
      		"latency" : NumberLong(8227275),
      		"ops" : NumberLong(108682)
      	},
      	"transactions" : {
      		"latency" : NumberLong(0),
      		"ops" : NumberLong(0)
      	}
      }
      

      I'm hoping to get a response like this, probably using an aggregation stage like $collStats:

      use admin
      db.system.aggregate( [ { $globalLatencyStats: { latencyStats: { } } } ] );
      {[{    "db" : "firstdb",
      	"reads" : {
      		"latency" : NumberLong(9404373),
      		"ops" : NumberLong(90552)
      	},
      	"writes" : {
      		"latency" : NumberLong(4846358),
      		"ops" : NumberLong(22579)
      	},
      	"commands" : {
      		"latency" : NumberLong(8227275),
      		"ops" : NumberLong(108682)
      	},
      	"transactions" : {
      		"latency" : NumberLong(0),
      		"ops" : NumberLong(0)
      	}},
         {    "db" : "seconddb",
      	"reads" : {
      		"latency" : NumberLong(9404373),
      		"ops" : NumberLong(90552)
      	},
      	"writes" : {
      (etc...)
      
      

            Assignee:
            backlog-query-execution [DO NOT USE] Backlog - Query Execution
            Reporter:
            milkie@mongodb.com Eric Milkie
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: