[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:
Depends
is depended on by SERVER-84200 Complete TODO after SERVER-83174 (pre... Backlog
Duplicate
is duplicated by SERVER-79175 Improve AutoStatsTracker usage in dis... Closed
Related
related to SERVER-79175 Improve AutoStatsTracker usage in dis... Closed
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. 


Generated at Thu Feb 08 06:51:27 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.