[undertow-dev] About response time in access log

lanabe lanabe.lanabe at gmail.com
Mon Dec 9 09:13:05 EST 2013


Hi, everyone.

Now Undertow AccessLogHandler is not supported Response time(%D/%T), right?

I simply implemented it, but I'm not sure..

https://github.com/emag/undertow/commit/6401d61e3fcb5ce739ce4f30ae0d6fb3ad68cc37

My code is

1) Add startTime:long field in HttpServerExchange
2) Initialize startTime and assign System.currentTimeMillis to it in
HttpServerExchange#<init>
3) Create ResponseTimeAttribute and its readAttribute return
(System.currentTimeMillis - exchage.getStartTime)

Is it too simple?

-----
I checked handler chain stack trace on WildFly Beta1.

(default I/O-3)
io.undertow.server.handlers.resource.ResourceHandler.handleRequest(ResourceHandler.java:76)
(default I/O-3)
io.undertow.server.handlers.PathHandler.handleRequest(PathHandler.java:90)
(default I/O-3)
io.undertow.server.handlers.accesslog.AccessLogHandler.handleRequest(AccessLogHandler.java:93)
[...]

 <Some Handlers> -> AccessLogHandler -> PathHandler -> ResourceHandler

If PathHandler and ResourceHandler(or another process) take a long time, my
idea doesn't work.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20131209/b8bab1d3/attachment.html 


More information about the undertow-dev mailing list