[SERVER-77184] Look into consolidating calls to CurOp::elapsedTimeExcludingPauses Created: 16/May/23  Updated: 29/Oct/23  Resolved: 18/Jul/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.0.0-rc8

Type: Task Priority: Major - P3
Reporter: Will Buerger Assignee: Maddie Zechar
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-76529 Separate execution time metric into t... Closed
Duplicate
is duplicated by SERVER-77191 Try to remove extra clock read for qu... Closed
Problem/Incident
Assigned Teams:
Query Optimization
Backwards Compatibility: Fully Compatible
Sprint: QO 2023-05-29, QO 2023-06-26, QO 2023-07-24
Participants:
Linked BF Score: 161

 Description   

We currently call CurOp::elapsedTimeExcludingPauses twice: (1) first in CurOp::setEndOfOpMetrics, (2) then in CurOp::completeAndLogOperation. We added (1) for query stats since (2) isn't called untilĀ after writeTelemetry. However, the cost of the system tick source (used to calculate the time elapsed) isn't negligible, so it'd be great to see if we can consolidate those two calls into one.

It'd be easiest to remove (2), but that would change behavior of the opDebug "executionTime" metric since it'd always be calculated slightly earlier in the completion of an operation. I'm not sure how we'd remove (1) without fundamentally changing query stats infrastructure.



 Comments   
Comment by Githook User [ 17/Jul/23 ]

Author:

{'name': 'Maddie Zechar', 'email': 'maddie.zechar@mongodb.com', 'username': 'madelinezec'}

Message: SERVER-77184 consolidate calls to CurOp::elapsedTimeExcludingPauses
Branch: master
https://github.com/mongodb/mongo/commit/170a13b4ee66883aa2fcdcbf436773badd7d86a8

Comment by Githook User [ 13/Jul/23 ]

Author:

{'name': 'liubov.molchanova', 'email': 'liubov.molchanova@mongodb.com', 'username': 'liubov-molchanova'}

Message: Revert "SERVER-77184 consolidate calls to CurOp::elapsedTimeExcludingPauses"

This reverts commit c3d6c8cef459caec3ac1a68efcdf87d84e95d8e0.
Branch: master
https://github.com/mongodb/mongo/commit/4e1e74f6d0ff99f5cc6c9bae3601ca769c1055d9

Comment by Githook User [ 12/Jul/23 ]

Author:

{'name': 'Maddie Zechar', 'email': 'maddie.zechar@mongodb.com', 'username': 'madelinezec'}

Message: SERVER-77184 consolidate calls to CurOp::elapsedTimeExcludingPauses
Branch: master
https://github.com/mongodb/mongo/commit/c3d6c8cef459caec3ac1a68efcdf87d84e95d8e0

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