Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8287275

JFR: Add RecordedObject::getOffsetDateTime(String)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 20
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
      jfr

      Description

      The JFR API provides meant to get a java.time.Instant (UTC) from a field in a RecordedEvent. The file format stores the time zone offset, but it's currently not exposed.

      When visualising events, it's sometimes desirable to do it in the time zone where the event was recorded. One of the benefit of using OffsetDateTime is that it can easily be converted to other representations.

      toLocalDateTime()
      toLocalTime()
      toInstant()
      toOffsetTime()
      toZonedDateTime()

      OffsetDateTime is probably what makes the most sense to use when serializing data, for example to a database. The 'jfr' command line tool writes timestamps in JSON and XML using a package private version of RecordedObject::getOffsetDateTime(String).

      By making the method public, tools outside the JDK could get access to the same information.

        Attachments

          Activity

            People

            Assignee:
            egahlin Erik Gahlin
            Reporter:
            egahlin Erik Gahlin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: