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

Implement special handling of Duration in logv2

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 4.3.4
    • None
    • None
    • None
    • Fully Compatible
    • Dev Tools 2020-01-27

    Description

      When logging duration objects we want special formatting to occur:

      "duration"_attr = Milliseconds(10)
      

      Should be formatted as:

      "durationMillis": 10

      Where the attribute name is updated with a unit suffix added and the value should just be the duration count.

      It creates an inconsistency we're determined is acceptable:

      When logging durations in containers, such as:

      std::vector<Milliseconds> vec = {Milliseconds(10), Milliseconds(50)};
      "things"_attr = vec

      There is no attribute name for each duration that we can update and the duration will instead be logged as an object instead of just a scalar:

      things: [{"durationMillis": 10}, {"durationMillis": 50}]
      

      Attachments

        Activity

          People

            henrik.edin@mongodb.com Henrik Edin
            henrik.edin@mongodb.com Henrik Edin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: