- 
    Type:Task 
- 
    Resolution: Fixed
- 
    Priority:Major - P3 
- 
    Affects Version/s: None
- 
    Component/s: None
- 
    None
- 
        Query Integration
- 
        Fully Compatible
- 
        200
- 
        None
- 
        None
- 
        None
- 
        None
- 
        None
- 
        None
- 
        None
The work in this ticket is to 1) write a test that runs an aggregation with explain("executionStats") containing a $group on mongos and 2) verify that the explain output contains memory metrics from the shards and mongos (maxUsedMemBytes in the fields)
SERVER-102384 will add memory metrics to the explain execution stats output for the standalone case.
After SERVER-102382 goes in, we should make sure that when explain("executionStats") is run on a mongos, it should reflect local memory use on a mongos process, not the total memory rolled up from shards. When explain execution stats is run in a sharded case, the "shards" portion of the output should have the memory statistics corresponding to their local memory use
- depends on
- 
                    SERVER-102382 Move memory stats from OpCtx to ClientCursor for sharded multi-batch -         
- Closed
 
-         
- 
                    SERVER-102384 Add memory stats for $group to explain execution stats -         
- Closed
 
-         
- related to
- 
                    SERVER-105958 Add memory tracking test for sharded $setWindowFields -         
- Closed
 
-