r861 - trunk/varnish-cache/bin/varnishhist

phk at projects.linpro.no phk at projects.linpro.no
Mon Aug 21 11:51:24 CEST 2006


Author: phk
Date: 2006-08-21 11:51:23 +0200 (Mon, 21 Aug 2006)
New Revision: 861

Modified:
   trunk/varnish-cache/bin/varnishhist/varnishhist.c
Log:
Adjusments to scale.

Refresh 1/sec max

Put more in the rolling buffer.





Modified: trunk/varnish-cache/bin/varnishhist/varnishhist.c
===================================================================
--- trunk/varnish-cache/bin/varnishhist/varnishhist.c	2006-08-21 09:49:43 UTC (rev 860)
+++ trunk/varnish-cache/bin/varnishhist/varnishhist.c	2006-08-21 09:51:23 UTC (rev 861)
@@ -19,10 +19,10 @@
 #include "shmlog.h"
 #include "varnishapi.h"
 
-#define HIST_LOW -55
-#define HIST_HIGH 20
+#define HIST_LOW -50
+#define HIST_HIGH 25
 #define HIST_W (1 + (HIST_HIGH - HIST_LOW))
-#define HIST_N 1000
+#define HIST_N 10000
 
 static unsigned char rr_hist[HIST_N];
 static unsigned next_hist;
@@ -34,7 +34,13 @@
 {
 	int x, y;
 	double m, r;
+	time_t t;
+	static time_t tl;
 
+	t = time(NULL);
+	if (t == tl)
+		return;
+	tl = t;
 	m = 0;
 	r = 0;
 	for (x = 0; x < HIST_W; x++) {
@@ -70,7 +76,11 @@
 	(void)spec;
 	if (tag != SLT_ReqEnd)
 		return (0);
+#if 0
+	i = sscanf(ptr, "%*d %*f %*f %*f %lf", &b);
+#else
 	i = sscanf(ptr, "%*d %*f %*f %lf", &b);
+#endif
 	assert(i == 1);
 	i = log(b) * c_hist;
 	if (i < HIST_LOW)




More information about the varnish-commit mailing list