Skip to content

Measure with nanoseconds in HttpExchangeTracer  #21742

@dreis2211

Description

@dreis2211

Hi,

I just noticed that HttpExchangeTracer.sendingResponse is working with milliseconds or more specifically with System.currentTimeMillis in order to track the taken time.

As System.currentTimeMillis can be subject of time drift, I wonder if System.nanoTime should be used. Unfortunately, it's not simply done with just switching to the latter because we can't work with nano-time and Instant like it's done at the moment. There need to be changes to HttpTrace as well, which potentially means migration work for people with a persistent store and a custom HttpTraceRepository.

In theory this would also obsolete HttpTrace.getTimestamp, but probably it's okay to keep it to have an actual time representation of when the request/response exchange happened.

I've done a first draft before I open an actual PR.

Let me know what you think.

Cheers,
Christoph

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: supersededAn issue that has been superseded by another

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions