From 8529d4e6d4a77442f5c53de6eea1add862a546ee Mon Sep 17 00:00:00 2001 From: phk Date: Fri, 14 Jul 2006 12:22:44 +0000 Subject: [PATCH] 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 --- varnish-cache/bin/varnishd/shmlog.c | 1 + varnish-cache/include/shmlog.h | 4 ++++ 2 files changed, 5 insertions(+) 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. -- 2.39.5