Is request time available in VCL?
Jos Boumans
jos at dwim.org
Wed Mar 27 01:00:32 CET 2013
Hi Jean-Baptiste,
it's not available in VCL, but you can get at it with
this Vmod I wrote for exactly that purpose:
https://www.varnish-cache.org/vmod/varnish-timers-get-timingduration-directly-varnish
Cheers,
-Jos
On 25 Jan 2011, at 11:40, Jean-Baptiste Quenot wrote:
> Hi,
>
> I'm using a varnishncsa patch that logs how long the server took to reply:
>
> case SLT_ReqEnd:
> if (sscanf(ptr, "%*u %*u.%*u %ld.%*u %lf %lf %lf", &l,
> &idle_t, &proc_t, &xmit_t) != 4) {
> lp->bogus = 1;
> } else {
> t = l;
> lp->df_D= (proc_t + xmit_t) * 1000000;
> localtime_r(&t, &lp->df_t);
> }
> /* got it all */
> return (0);
>
> I'd like to add a X-Varnish-Time header in the response to indicate
> the same number, for service health checks. Is this time information
> available in VCL?
>
> Thanks in advance,
> --
> Jean-Baptiste Quenot
>
> _______________________________________________
> varnish-dev mailing list
> varnish-dev at varnish-cache.org
> http://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev
More information about the varnish-dev
mailing list