[SERVER-53216] Report number of databases in resource consumption serverStatus section Created: 03/Dec/20  Updated: 29/Oct/23  Resolved: 15/Dec/20

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

Type: Improvement 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:
Related
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2020-12-28
Participants:

 Description   

Report the number of databases that have globally-aggregated metrics in the 'resourceConsumption' serverStatus section.

This information is already accessible by using the following aggregation pipeline:

> db.aggregate([{$operationMetrics: {}}, {$count: "num"}]);
{ "num" : 42 }

This comes from a Cloud request to put this diagnostic information in serverStatus for consumers that are already fetching the serverStatus periodically.



 Comments   
Comment by Louis Williams [ 17/Dec/20 ]

bruce.lucas,  just an FYI that this change diverges from our previous discussion in SERVER-51668. This section is now reported by default, but only when the server parameter to aggregate metrics is enabled (off by default). The metrics I just added should provide some helpful memory usage diagnostics.

Comment by Githook User [ 15/Dec/20 ]

Author:

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

Message: SERVER-53216 Report number of databases in resource consumption serverStatus section
Branch: master
https://github.com/mongodb/mongo/commit/e9ba0db9a0b5f4e7116670118cf10184a14f2e40

Comment by Louis Williams [ 15/Dec/20 ]

When the aggregateOperationResourceConsumptionMetrics serverParameter is enabled,  serverStatus will include the following section:

{ ...
  "resourceConsumption": {
    // Total amount of active CPU time spent by operations that have collected metrics
    cpuNanos: 0,
    // Approximate memory usage for metrics, in bytes. Excludes overhead of storage.
    memUsage: 0,
    // The number of per-database metrics held in memory.
    numMetrics: 0,
  }
}

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