[SERVER-56891] Provide global database-aggregated latency stats Created: 12/May/21  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: Diagnostics
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Eric Milkie Assignee: Backlog - Query Execution
Resolution: Unresolved Votes: 0
Labels: serverless-impact
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Execution
Participants:

 Description   

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...)



 Comments   
Comment by Steven Vannelli [ 06/Apr/22 ]

Removing 5.2 Desired fixVersion since I will be archiving it shortly.

Comment by Eric Milkie [ 12/May/21 ]

Correct, this should not be in server status or in FTDC.

Comment by Bruce Lucas (Inactive) [ 12/May/21 ]

It looks like you are intending to do this outside of serverStatus, and therefore outside of ftdc, correct? I just want to mention that that is important because of customers with a very large number of databases that will excessively inflate ftdc. If you do decide it will be in serverStatus, it can still be excluded from ftdc by passing the correct option to serverStatus at the point where it collects ftdc.

Generated at Thu Feb 08 05:40:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.