[SERVER-50916] Implement aggregation stage to return resource consumption metrics Created: 14/Sep/20  Updated: 29/Oct/23  Resolved: 29/Sep/20

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.8.0

Type: Task Priority: Major - P3
Reporter: Louis Williams Assignee: Louis Williams
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2020-10-05
Participants:
Linked BF Score: 0

 Description   

Implement an agg pipeline stage "$operationMetrics" to return global resource consumption metrics.

This stage accepts a "clearMetrics" flag. When set to true, will clear the metrics after building the response to the command.

The command response format will be the following:

{ ok: 1, 
  cursor: {
    firstBatch: [ 
      { db: "<dbname>", 
        primaryMetrics: \{ docBytesRead: 0, docUnitsRead: 0, idxEntriesRead: 0, keysSorted: 0 }, 
        secondaryMetrics: \{ docBytesRead: 0, docUnitsRead: 0, idxEntriesRead: 0, keysSorted: 0 }, 
        cpuMillis: 0, 
        docBytesWritten: 0, 
        docUnitsWritten: 0, 
        docUnitsReturned: 0 }, 
      \{ ... } ] ,
    id : NumberLong("668860441858272439") 
  }
}



 Comments   
Comment by Githook User [ 29/Sep/20 ]

Author:

{'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}

Message: SERVER-50916 use long long instead of uint64 for BSON
Branch: master
https://github.com/mongodb/mongo/commit/126068ea383471608e9e1e76073048b749471643

Comment by Githook User [ 29/Sep/20 ]

Author:

{'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}

Message: SERVER-50916 Add $operationMetrics aggregation stage to return resource consumption metrics
Branch: master
https://github.com/mongodb/mongo/commit/53ccac3cf24d322aaaf1de27342d00f46600aaa4

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