r506 - trunk/varnish-cache/bin/varnishtop

phk at projects.linpro.no phk at projects.linpro.no
Wed Jul 19 21:49:22 CEST 2006


Author: phk
Date: 2006-07-19 21:49:22 +0200 (Wed, 19 Jul 2006)
New Revision: 506

Modified:
   trunk/varnish-cache/bin/varnishtop/varnishtop.c
Log:
Update only once per second.


Modified: trunk/varnish-cache/bin/varnishtop/varnishtop.c
===================================================================
--- trunk/varnish-cache/bin/varnishtop/varnishtop.c	2006-07-19 19:48:23 UTC (rev 505)
+++ trunk/varnish-cache/bin/varnishtop/varnishtop.c	2006-07-19 19:49:22 UTC (rev 506)
@@ -45,7 +45,14 @@
 	int l;
 	double t = 0;
 	unsigned u = 0;
+	static time_t last;
+	time_t now;
 
+	now = time(NULL);
+	if (now == last)
+		return;
+	last = now;
+
 	erase();
 	l = 0;
 	mvprintw(0, 0, "list length %u\n", ntop);




More information about the varnish-commit mailing list