r474 - in trunk/varnish-cache: bin/varnishd include
phk at projects.linpro.no
phk at projects.linpro.no
Fri Jul 14 14:22:44 CEST 2006
Author: phk
Date: 2006-07-14 14:22:44 +0200 (Fri, 14 Jul 2006)
New Revision: 474
Modified:
trunk/varnish-cache/bin/varnishd/shmlog.c
trunk/varnish-cache/include/shmlog.h
Log:
Put a starttime in shmem so varnishstat can show average rates.
Modified: trunk/varnish-cache/bin/varnishd/shmlog.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/shmlog.c 2006-07-14 12:12:46 UTC (rev 473)
+++ trunk/varnish-cache/bin/varnishd/shmlog.c 2006-07-14 12:22:44 UTC (rev 474)
@@ -134,6 +134,7 @@
/* XXX check sanity of loghead */
logstart = (unsigned char *)loghead + loghead->start;
AZ(pthread_mutex_init(&vsl_mutex, NULL));
+ loghead->starttime = time(NULL);
VSL_stats = &loghead->stats;
}
Modified: trunk/varnish-cache/include/shmlog.h
===================================================================
--- trunk/varnish-cache/include/shmlog.h 2006-07-14 12:12:46 UTC (rev 473)
+++ trunk/varnish-cache/include/shmlog.h 2006-07-14 12:22:44 UTC (rev 474)
@@ -9,6 +9,8 @@
#define SHMLOG_FILENAME "/tmp/_.vsl"
+#include <time.h>
+
#include "stats.h"
struct shmloghead {
@@ -17,6 +19,8 @@
unsigned hdrsize;
+ time_t starttime;
+
/*
* Byte offset into the file where the fifolog starts
* This allows the header to expand later.
More information about the varnish-commit
mailing list