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

Add programming support for tracepoints

    XMLWordPrintable

    Details

    • Story Points:
      2

      Description

      The aim is to provide a library that allows adding tracepoints to mongo servers. The primary intent for these tracepoints is to collect timing information (e.g., using ServiceContext::getFastClockSource) for an ongoing operation. The tracepoints must compile to a noop by default, unless requested otherwise at compile time.

      The following is a possible/suggested API design for the tracepoints.

      void someFunction() {
          // TracePoint(std::string name, Duration<T> loggingThreshold);
          auto tp = makeTracepoint("MyTracepoint", Milliseconds(100));
          runOperationA();
          tp.checkpoint("Checkpoint 1");
          runOperationB();
      }
      

      When enabled, the tracepoint must collect the timestamp at construction and at each checkpoint, and log the timestamps when the lifetime of the tracepoint object exceeds a threshold.

      For example, if running runOperationA and runOperationB takes more than 100 milliseconds, we expect to see a line similar to the following in mongo logs:

      { "Tracepoint exceeded its expected lifetime" , "attr": {"name": "MyTracepoint", "constructedAt": "timestamp", "destroyedAt": "timestamp", "Checkpoint 1": "timestamp", "expectedLifetimeMS": 100, "observedLifetimeMS": 101} }
      

      Acceptance criteria:

      • For the first pass, someone will do a POC timeboxed at 2 story points to answer some of the open questions

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              backlog-server-servicearch Backlog - Service Architecture
              Reporter:
              amirsaman.memaripour Amirsaman Memaripour
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated: