-
Type: Task
-
Resolution: Won't Do
-
Priority: Major - P3
-
Affects Version/s: None
-
Labels:None
Documentation Request Summary:
No documentation summary in engineering ticket
Engineering Ticket Description:
ISSUE SUMMARY
This project improves the existing MongoDB diagnostics facilities by ensuring that the same diagnostic information is available across all operations.
Consistent reporting of metrics across user operations
All relevant metrics are supported for each command and operation (with a small list of exceptions below). These metrics are available in the slow diagnostic log, the profiler and db.currentOp().
Operations included
- count
- distinct
- find (command + OP_QUERY)
- findAndModify
- getMore (command + OP_GET_MORE)
- geoNear
- group
- mapReduce
- delete (command + OP_DELETE)
- update (command + OP_UPDATE)
Metrics covered
- keysExamined
- docsExamined
- reslen
- nreturned
- ntoreturn
- batchSize
- numYields
- cursorExhausted
- planSummary
- cursorid
- writeConflicts
- hasSortStage
- fromMultiPlanner
- replanned
- locks
- protocol
- millis
- ninserted (or 'upsert' for updates that result in an insert)
- multi
- nMatched
- nModified
- ndeleted
- ntoskip
- exhaust
- nmoved
- upsert
- execStats
Exceptions
- execStats is only available in the profiler output. It is not available in the slow diagnostics log or db.currentOp().
- execStats is not available for the aggregate command.
Introduction of new metrics
This project introduces 2 new metrics, 'keysInserted' and 'keysDeleted'. These metrics report the number of index keys inserted and deleted for all write operations. This replaces 'keyUpdates' which was not previously covered across write commands and is potentially misleading.
Removed metrics
This project removes the following metrics:
- fastmod: replaced by 'keysInserted', 'keysDeleted' and 'nmoved', which in combination can be used to derive this metric in a more granular, easy to understand manner.
- keyUpdates: replaced by 'keysInserted' and 'keysDeleted'.
- idhack: replaced by 'planSummary', which will report when the IDHACK stage is used.
- moved: obsoleted by the 'nmoved' metric.
See SERVER-23272 for the rationale behind this removal.
Deprecated metrics
- fastmodinsert: not considered generally useful for performance analysis.
Original description
Goals
- Improve existing diagnostics by ensuring that the same information is available across operations (e.g. we don't report planSummary for all operations).
- In other words, expose existing debug information more consistently.
Non-goals
- Collect additional debug information which we don't already collect.
- Major infrastructural changes to CurOp, the profiler, or the slow query log.
How
Part of the work for SERVER-10448 (a.k.a. "new explain"), completed for version 3.0, was to add a suite of functions capable of pulling summary statistics and debug information out of PlanExecutor (see explain.h). However, we use these functions in only a few places instead of uniformly populating CurOp with the available debug information. Using explain functionality to add the same stats to CurOp everywhere should be an easy win for diagnosability.
Details
This includes work for the following operations:
- count
- delete
- distinct
- find (OP_QUERY and command)
- findAndModify
- geoNear
- getMore (OP_GET_MORE and command)
- group
- update
The following fields will be added to CurOp for every operation once the operation completes:
- docsExamined
- hasBlockingSort
- idhack
- keysExamined
- nReturned
- planSummary
- documents
-
SERVER-17862 Unify stats reporting for log/profiler across CRUD operations
- Closed