r5549 - in trunk/varnish-cache: bin/varnishncsa doc/sphinx/reference
tfheen at varnish-cache.org
tfheen at varnish-cache.org
Wed Nov 17 09:01:24 CET 2010
Author: tfheen
Date: 2010-11-17 09:01:23 +0100 (Wed, 17 Nov 2010)
New Revision: 5549
Modified:
trunk/varnish-cache/bin/varnishncsa/varnishncsa.c
trunk/varnish-cache/doc/sphinx/reference/varnishncsa.rst
Log:
Add hitmiss and handling formats to varnishncsa
Make it possible to add a hit/miss item to varnishncsa as well as a
hit/miss/pass/pipe item.
Modified: trunk/varnish-cache/bin/varnishncsa/varnishncsa.c
===================================================================
--- trunk/varnish-cache/bin/varnishncsa/varnishncsa.c 2010-11-16 15:09:50 UTC (rev 5548)
+++ trunk/varnish-cache/bin/varnishncsa/varnishncsa.c 2010-11-17 08:01:23 UTC (rev 5549)
@@ -102,6 +102,7 @@
char *df_u; /* %u, Remote user */
char *df_ttfb; /* Time to first byte */
const char *df_hitmiss; /* Whether this is a hit or miss */
+ const char *df_handling; /* How the request was handled (hit/miss/pass/pipe) */
int active; /* Is log line in an active trans */
int complete; /* Is log line complete */
int matched; /* Did log line match */
@@ -429,6 +430,24 @@
lp->df_Host = trimline(next, end);
break;
+ case SLT_VCL_call:
+ if(!lp->active)
+ break;
+ if (strncmp(ptr, "hit", len) == 0) {
+ lp->df_hitmiss = "hit";
+ lp->df_handling = "hit";
+ } else if (strncmp(ptr, "miss", len) == 0) {
+ lp->df_hitmiss = "miss";
+ lp->df_handling = "miss";
+ } else if (strncmp(ptr, "pass", len) == 0) {
+ lp->df_hitmiss = "miss";
+ lp->df_handling = "pass";
+ } else if (strncmp(ptr, "pipe", len) == 0) {
+ lp->df_hitmiss = "miss";
+ lp->df_handling = "pipe";
+ }
+ break;
+
case SLT_Length:
if (!lp->active)
break;
@@ -647,6 +666,14 @@
fprintf(fo, "%s", lp->df_ttfb);
p += 9+15;
break;
+ } else if (strncmp(what, "hitmiss}x", 9) == 0) {
+ fprintf(fo, "%s", lp->df_hitmiss);
+ p += 9+8;
+ break;
+ } else if (strncmp(what, "handling}x", 10) == 0) {
+ fprintf(fo, "%s", lp->df_handling);
+ p += 9+9;
+ break;
}
}
/* Fall through if we haven't handled something */
Modified: trunk/varnish-cache/doc/sphinx/reference/varnishncsa.rst
===================================================================
--- trunk/varnish-cache/doc/sphinx/reference/varnishncsa.rst 2010-11-16 15:09:50 UTC (rev 5548)
+++ trunk/varnish-cache/doc/sphinx/reference/varnishncsa.rst 2010-11-17 08:01:23 UTC (rev 5549)
@@ -96,6 +96,14 @@
Varnish:time_firstbyte
Time to the first byte from the backend arrived
+ Varnish:hitmiss
+ Whether the request was a cache hit or miss. Pipe
+ and pass are considered misses.
+
+ Varnish:handling
+ How the request was handled, whether it was a
+ cache hit, miss, pass or pipe.
+
-o Filter log output to request groups that match a regular
expression on a specified tag.
More information about the varnish-commit
mailing list