ari-ban / issue-test

0 stars 0 forks source link

AccessLogProbe requestMillis computation is wrong #1895

Closed arinban closed 7 years ago

arinban commented 7 years ago

In org.glassfish.grizzly.http.server.accesslog.AccessLogProbe.onRequestCompleteEvent(HttpServerFilter, Connection, Response) there is a mix between millis and nano in the last division:

final long timeStamp = System.currentTimeMillis();
final long nanoStamp = System.nanoTime();

final long responseNanos = requestNanos == null ? -1 : nanoStamp - requestNanos.longValue();
final Date requestMillis = new Date(timeStamp - (responseNanos / 1000000000L));

responseNanos should be divided by 1000000L instead of 1000000000L to be converted to millisecond.

As a result, the date at which the request was originated is wrong, and very close to the completion date instead.

Affected Versions

[2.3.23]

arinban commented 6 years ago
arinban commented 7 years ago

@glassfishrobot Commented Reported by Plonk42

arinban commented 7 years ago

@glassfishrobot Commented @rlubke said: Changes applied:

2.3.x: 5e7feb84b6dd6077ff7509d90f32d9d0f35b6a1f master: b577e3663149dac86cad4b469489c9b82677c4b0

arinban commented 7 years ago

@glassfishrobot Commented This issue was imported from java.net JIRA GRIZZLY-1895

arinban commented 7 years ago

@glassfishrobot Commented Marked as fixed on Tuesday, March 14th 2017, 11:05:04 am