From: phk Date: Fri, 14 Jul 2006 12:22:44 +0000 (+0000) Subject: Put a starttime in shmem so varnishstat can show average rates. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8529d4e6d4a77442f5c53de6eea1add862a546ee;p=varnish Put a starttime in shmem so varnishstat can show average rates. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@474 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/shmlog.c b/varnish-cache/bin/varnishd/shmlog.c index 32e68e27..2aacd26d 100644 --- a/varnish-cache/bin/varnishd/shmlog.c +++ b/varnish-cache/bin/varnishd/shmlog.c @@ -134,6 +134,7 @@ VSL_Init(void) /* 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; } diff --git a/varnish-cache/include/shmlog.h b/varnish-cache/include/shmlog.h index 4add0e14..34d6ab52 100644 --- a/varnish-cache/include/shmlog.h +++ b/varnish-cache/include/shmlog.h @@ -9,6 +9,8 @@ #define SHMLOG_FILENAME "/tmp/_.vsl" +#include + #include "stats.h" struct shmloghead { @@ -17,6 +19,8 @@ struct shmloghead { unsigned hdrsize; + time_t starttime; + /* * Byte offset into the file where the fifolog starts * This allows the header to expand later.