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

Measure cpu time taken by operations

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Critical - P2
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.9.0
    • Component/s: Internal Code
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      Service arch 2020-10-19
    • Case:

      Description

      It would be valuable to measure cpu time consumed by an operation, both as it's running and rolled up by user (to measure resource consumption by a particular user). We could potentially expose this via currentOp, via server status metrics or perhaps in a custom agg pipeline (if by user).

      On linux pthread_getcpuclockid() offers a way to access cpu time consumed by a particular thread relatively easily. In turn, we could capture time at opCtx creation, then store the delta on each call to opCtx->checkForInterrupt, then flush the final value into the user level roll up at opCtx destruction.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              amirsaman.memaripour Amirsaman Memaripour
              Reporter:
              jason.carey Jason Carey
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              18 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: