Commit 2b85b01b authored by Geoff Simmons's avatar Geoff Simmons

varnishevent: monitoring stats for writer threads include bytes written

parent 367e8492
...@@ -76,10 +76,11 @@ static char *obuf = NULL; ...@@ -76,10 +76,11 @@ static char *obuf = NULL;
static pthread_mutex_t reopen_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t reopen_lock = PTHREAD_MUTEX_INITIALIZER;
/* stats */ /* stats */
static unsigned deqs = 0; static unsigned long deqs = 0;
static unsigned waits = 0; static unsigned long bytes = 0;
static unsigned writes = 0; static unsigned long waits = 0;
static unsigned errors = 0; static unsigned long writes = 0;
static unsigned long errors = 0;
typedef struct writer_data_s { typedef struct writer_data_s {
unsigned magic; unsigned magic;
...@@ -166,6 +167,7 @@ wrt_write(logline_t *ll) ...@@ -166,6 +167,7 @@ wrt_write(logline_t *ll)
} }
writes++; writes++;
bytes += VSB_len(os);
MON_StatsUpdate(STATS_WRITTEN); MON_StatsUpdate(STATS_WRITTEN);
/* clean up */ /* clean up */
...@@ -276,8 +278,10 @@ WRT_Stats(void) ...@@ -276,8 +278,10 @@ WRT_Stats(void)
if (!run) return; if (!run) return;
LOG_Log(LOG_INFO, LOG_Log(LOG_INFO,
"Writer (%s): seen=%u writes=%u errors=%u waits=%u free=%u", "Writer (%s): seen=%lu writes=%lu bytes=%lu errors=%lu waits=%lu"
statename[wrt_data.state], deqs, writes, errors, waits, wrt_nfree); " free=%u",
statename[wrt_data.state], deqs, writes, bytes, errors, waits,
wrt_nfree);
} }
int int
......
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