r516 - trunk/varnish-cache/bin/varnishstat

phk at projects.linpro.no phk at projects.linpro.no
Thu Jul 20 12:10:25 CEST 2006


Author: phk
Date: 2006-07-20 12:10:24 +0200 (Thu, 20 Jul 2006)
New Revision: 516

Modified:
   trunk/varnish-cache/bin/varnishstat/varnishstat.c
Log:
Show also average since start


Modified: trunk/varnish-cache/bin/varnishstat/varnishstat.c
===================================================================
--- trunk/varnish-cache/bin/varnishstat/varnishstat.c	2006-07-20 09:58:11 UTC (rev 515)
+++ trunk/varnish-cache/bin/varnishstat/varnishstat.c	2006-07-20 10:10:24 UTC (rev 516)
@@ -30,7 +30,7 @@
 	struct varnish_stats copy;
 	intmax_t ju;
 	struct timespec ts;
-	double tt, lt, hit, miss, ratio;
+	double tt, lt, hit, miss, ratio, up;
 	double a1, a2, a3;
 	unsigned n1, n2, n3;
 	time_t rt;
@@ -52,6 +52,7 @@
 		lt = tt - lt;
 
 		rt = ts.tv_sec - VSL_stats->start_time;
+		up = rt;
 
 		move(0,0);
 		i = 0;
@@ -83,7 +84,8 @@
 
 #define MAC_STAT(n,t,f,d) \
 		ju = VSL_stats->n; \
-		printw("%12ju  %10.2f " d "\n", ju, (ju - (intmax_t)copy.n)/lt); \
+		printw("%12ju  %10.2f %10.2f " d "\n", \
+		    ju, (ju - (intmax_t)copy.n)/lt, ju / up); \
 		copy.n = ju;
 #include "stat_field.h"
 #undef MAC_STAT




More information about the varnish-commit mailing list