https://issues.apache.org/bugzilla/show_bug.cgi?id=56966

            Bug ID: 56966
           Summary: AccessLogValve's elapsed time has 15ms precision on
                    Windows
           Product: Tomcat 8
           Version: trunk
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: t...@tom-fitzhenry.me.uk

The problem:
AccessLogValve's elapsed time variables (%D and %T) calculate elapsed time
using System.currentTimeMillis()[0]. System.currentTimeMillis() only has a
precision of ~15ms on Windows.[1]

A potential fix:
Calculate elapsed time using a precision timer, such as System.nanoTime(),
which has a higher precision (dependent on OS).


References:
0. See
https://github.com/apache/tomcat/blob/3986c5dc894fda541aa1855503debe1a8c01fc9f/java/org/apache/catalina/connector/CoyoteAdapter.java#L266
, which gets fed into the 'time' parameter of
https://github.com/apache/tomcat/blob/99029882cb020f8d354ad4e2ef46e8edacb0c73d/java/org/apache/catalina/valves/AbstractAccessLogValve.java#L1183
1.
http://stackoverflow.com/questions/7859019/system-currenttimemillis-is-not-accurate-on-windows-xp

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to