-
Type: Improvement
-
Resolution: Unresolved
-
Priority: 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...)