varnish-dev Digest, Vol 96, Issue 14

Martin Blix Grydeland martin at varnish-software.com
Mon Mar 24 13:18:41 CET 2014


Find reply in line:

On 24 March 2014 12:45, Phil Stanhope <stanhope at gmail.com> wrote:

> Having been doing a tremendous amount of timestamp related work recently
> (outside of Varnish), I really like how Martin has done this.
>
> My feedback is that i think that the timestamp should always be first and
> the label second. The reason for me is that you have a natural sort
> ordering (particularly if the timestamp has 6 digits of precision). When
> scanning a streaming version of timestamps being emitted your eye can see
> the labels. But if things start shifting left/right because the labels are
> not of uniform length it gets very hard to absorb.
>

Agreed on the eye strain, though I chose to put it as the first field
followed by a colon specifically to mimic the way we log HTTP headers. This
because the log query language has a concept of a key-value record parsing
that can then also be used with the timestamps, allowing you to match
queries on specific timestamps.

So to log transactions that has spent more than half a second on the
waitinglist, you can do:
varnishlog -q 'Timestamp:waitinglist[3] > 0.5'



> Alternatively, I could argue that all fixed with fields should be
> sequential -- and the variable width label be the last field.
>
> The other thing that I've done is when serializing this type of
> information for debugging purposes to actually calculate and include the
> running delta -- even though it's obvious that it can calculated after the
> fact. Typically it will be .000003 -- very small number of micro seconds.
> It's when that delta gets big that it jumps out at you and don't have to do
> any math in your head -- instead focus on why that particular operation
> took as long as it did.
>

This is what the last field is being used for ("Time since last
timestamp"). It will be the delta to the last timestamp issued on this
transaction.

Martin


-- 
<http://varnish-software.com>*Martin Blix Grydeland*
Senior Developer | Varnish Software AS
Cell: +47 21 98 92 60
We Make Websites Fly!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-dev/attachments/20140324/8109c4ee/attachment-0001.html>


More information about the varnish-dev mailing list