From 70d4799e842e29d270fe601ef2e21131365737ee Mon Sep 17 00:00:00 2001 From: Marc Fournier Date: Tue, 28 Oct 2014 18:28:56 +0100 Subject: [PATCH] varnish: monitor 2 purge-relatad metrics added in V4 --- src/varnish.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/varnish.c b/src/varnish.c index bdff16a9..517258e2 100644 --- a/src/varnish.c +++ b/src/varnish.c @@ -271,7 +271,10 @@ static void varnish_monitor (const user_config_t *conf, /* {{{ */ #endif /* HTTP header overflows */ varnish_submit_derive (conf->instance, "objects", "total_objects", "header_overflow", stats->losthdr); -#if !HAVE_VARNISH_V4 +#if HAVE_VARNISH_V4 + /* N purged objects */ + varnish_submit_derive (conf->instance, "objects", "total_objects", "purged", stats->n_obj_purged); +#else /* Objects sent with sendfile */ varnish_submit_derive (conf->instance, "objects", "total_objects", "sent_sendfile", stats->n_objsendfile); /* Objects sent with write */ @@ -481,6 +484,8 @@ static void varnish_monitor (const user_config_t *conf, /* {{{ */ varnish_submit_derive (conf->instance, "totals", "total_bytes", "pipe_in", stats->s_pipe_in); /* Piped bytes to client */ varnish_submit_derive (conf->instance, "totals", "total_bytes", "pipe_out", stats->s_pipe_out); + /* Number of purge operations */ + varnish_submit_derive (conf->instance, "totals", "total_operations", "purges", stats->n_purges); #else /* Total header bytes */ varnish_submit_derive (conf->instance, "totals", "total_bytes", "header-bytes", stats->s_hdrbytes); -- 2.30.2