Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-83174

AutoStatsTracker contract is unclear

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution

      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. 

            Assignee:
            backlog-query-execution [DO NOT USE] Backlog - Query Execution
            Reporter:
            haley.connelly@mongodb.com Haley Connelly
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: