[SERVER-83174] AutoStatsTracker contract is unclear Created: 13/Nov/23 Updated: 26/Dec/23 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Haley Connelly | Assignee: | Backlog - Query Execution |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Assigned Teams: |
Query Execution
|
||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||
| Description |
|
There is no concrete contract outlining the responsibilities of the AutoStatsTracker and its resulting metrics. It's intended to be an RAII class to update diagnostic state on CurOp and report Top upon destruction. Today, the AutoStatsTracker (1) ensures metric reporting has begun for curOp (2) changes the databaseProfiling level and updates the _nss on curOp (3) updates the Top() command metrics on destruction. Ambiguities It implicitly ensures active metrics recording on curOp , but doesn't guarantee when metrics recording will end / know if it has already started for curOp(). It reports metrics to Top() upon destruction, but there is no guarantee when the metrics started recording - is the time elapsed tracked by curOp representative of the scope of the AutoStatsTracker? Additionally, its unclear when the AutoStatsTracker should be used and at what level in the code - when does an operation 'start' and and 'end', and what stats are of interest at what points in an operations trajectory. |