Implement special handling of Duration in logv2

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.3.4
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • Dev Tools 2020-01-27
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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}]
      

            Assignee:
            Henrik Edin
            Reporter:
            Henrik Edin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: