Chris, thanks for the valve wrapper! I played around now for some time, wrapped the response, attached some Action hook. But still not sure where i can "grab" the time for the "first byte" leaving tomcat to the client.
I call now the response.getContentCount() method in every ActionHook action method. every buffer write i get an ACTION_COMMIT code: 3 event if the response is larger than 8184 bytes i get more ACTION_COMMIT code: 3 events (size of response/8184 = quantity of ACTION_COMMIT code: 3 events). Is the first ACTION_COMMIT code: 3 event sent after the client response to the first write ? LE. On 13.01.2010, at 16:43, Christopher Schultz wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > LE, > > On 1/13/2010 9:23 AM, LE wrote: >> I am able to write my own "AccessLogValve Class" but i have no idea >> how to get the "first byte" of the response. > > You have to wrap the response in an object which can record the time of > the first byte being written to the output stream (or writer). > > If you want to implement this as a Filter, the > HttpServletResponseWrapper object is a good starting place. If you must > use a Valve, Tomcat provides no such wrapped class for you: you'll have > to use your own. Fortunately, some kind soul has written such a class > and posted it into Tomcat's bug tracker: > > https://issues.apache.org/bugzilla/show_bug.cgi?id=45014 > > - -chris > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.10 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iEYEARECAAYFAktN6ikACgkQ9CaO5/Lv0PBoOwCgwKDk2KK1KtvUJXNUoHjNowy0 > KlUAn2rR14AN0N1b0hgRUtDxbUv7NVQ4 > =Jexl > -----END PGP SIGNATURE----- > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org