Sub-second granularity logs

Niall O'Higgins niallo at metaweb.com
Thu Sep 10 23:54:39 CEST 2009


On Thu, Sep 10, 2009 at 09:33:09PM +0000, Poul-Henning Kamp wrote:
> All the internal timestamps are in nanosecond resolution, just
> find the right printf and fix the format.
> 
> Getting a timespec is just as expensive as getting a time_t, because
> time(2) simply calls clock_gettime(2) under your feet.

Ok great, of course what you say makes sense now that I think about
it.  So it should just be a matter of exposing this time in various
ways.

> Which shmrecord are we talking about ?

I have only started looking through the existing shmlog tags to see
exactly what corresponds to our needs, but basically we are looking
for millisecond accuracy at each of these points:

- When the cache received the request from the client
- When the request header was forwarded by the cache
- When the first byte of the response header was recieved back
- When the end of the response header was received or detected
- When the first byte of the response body was received or detected
- When the cache finished sending the response back to the client

Thanks!

-- 
Niall O'Higgins
Software Engineer
Metaweb Technologies, Inc.



More information about the varnish-misc mailing list