Commit 353d6e99 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Put a starttime in shmem so varnishstat can show average rates.


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@474 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 38c08103
...@@ -134,6 +134,7 @@ VSL_Init(void) ...@@ -134,6 +134,7 @@ VSL_Init(void)
/* XXX check sanity of loghead */ /* XXX check sanity of loghead */
logstart = (unsigned char *)loghead + loghead->start; logstart = (unsigned char *)loghead + loghead->start;
AZ(pthread_mutex_init(&vsl_mutex, NULL)); AZ(pthread_mutex_init(&vsl_mutex, NULL));
loghead->starttime = time(NULL);
VSL_stats = &loghead->stats; VSL_stats = &loghead->stats;
} }
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
#define SHMLOG_FILENAME "/tmp/_.vsl" #define SHMLOG_FILENAME "/tmp/_.vsl"
#include <time.h>
#include "stats.h" #include "stats.h"
struct shmloghead { struct shmloghead {
...@@ -17,6 +19,8 @@ struct shmloghead { ...@@ -17,6 +19,8 @@ struct shmloghead {
unsigned hdrsize; unsigned hdrsize;
time_t starttime;
/* /*
* Byte offset into the file where the fifolog starts * Byte offset into the file where the fifolog starts
* This allows the header to expand later. * This allows the header to expand later.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment