summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 248a90e)
raw | patch | inline | side by side (parent: 248a90e)
author | Jérôme Renard <jerome.renard@gmail.com> | |
Fri, 4 Jun 2010 16:25:52 +0000 (18:25 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Mon, 7 Jun 2010 12:40:47 +0000 (14:40 +0200) |
src/collectd.conf.in | patch | blob | history | |
src/types.db | patch | blob | history | |
src/varnish.c | patch | blob | history |
diff --git a/src/collectd.conf.in b/src/collectd.conf.in
index d2f7bfbfa77c97f9c034935f68f24f0b407d6964..efa2af4c1d4cc8568bff03454315f9ba2aff37ee 100644 (file)
--- a/src/collectd.conf.in
+++ b/src/collectd.conf.in
# MonitorConnections yes
# MonitorESI yes
# MonitorBackend yes
+# MonitorFetch yes
#</Plugin>
#<Plugin vmem>
diff --git a/src/types.db b/src/types.db
index 99e96e9809c1f5b3f4fa85f376be22f7391b3233..375ac7cee7fdf2d727c46023edb28ba3d974f768 100644 (file)
--- a/src/types.db
+++ b/src/types.db
varnish_connections value:GAUGE:0:U
varnish_esi value:GAUGE:0:U
varnish_backend_connections value:GAUGE:0:U
+varnish_fetch value:GAUGE:0:U
virt_cpu_total ns:COUNTER:0:256000000000
virt_vcpu ns:COUNTER:0:1000000000
vmpage_action value:COUNTER:0:4294967295
diff --git a/src/varnish.c b/src/varnish.c
index 3fe9f93f3fb162c21f35010e62bd1c0d8793f531..14e18f12f1db73264bf3be7c1fdc07e2c9e3ed4a 100644 (file)
--- a/src/varnish.c
+++ b/src/varnish.c
#include <varnish/varnishapi.h>
-#define USER_CONFIG_INIT {0, 0, 0, 0}
+#define USER_CONFIG_INIT {0, 0, 0, 0, 0}
#define SET_MONITOR_FLAG(name, flag, value) if((strcasecmp(name, key) == 0) && IS_TRUE(value)) user_config.flag = 1
/* {{{ user_config_s */
int monitor_connections;
int monitor_esi;
int monitor_backend;
+ int monitor_fetch;
};
typedef struct user_config_s user_config_t; /* }}} */
"MonitorConnections",
"MonitorESI",
"MonitorBackend",
+ "MonitorFetch"
};
static int config_keys_num = STATIC_ARRAY_SIZE (config_keys); /* }}} */
SET_MONITOR_FLAG("MonitorConnections", monitor_connections, value);
SET_MONITOR_FLAG("MonitorESI", monitor_esi, value);
SET_MONITOR_FLAG("MonitorBackend", monitor_backend, value);
+ SET_MONITOR_FLAG("MonitorFetch", monitor_fetch, value);
return (0);
} /* }}} */
varnish_submit("varnish_backend_connections", "backend_connections-recycles" , VSL_stats->backend_recycle); /* Backend conn. recycles */
varnish_submit("varnish_backend_connections", "backend_connections-unused" , VSL_stats->backend_unused); /* Backend conn. unused */
}
+
+ if(user_config.monitor_fetch == 1)
+ {
+ varnish_submit("varnish_fetch", "fetch_head" , VSL_stats->fetch_head); /* Fetch head */
+ varnish_submit("varnish_fetch", "fetch_length" , VSL_stats->fetch_length); /* Fetch with length */
+ varnish_submit("varnish_fetch", "fetch_chunked" , VSL_stats->fetch_chunked); /* Fetch chunked */
+ varnish_submit("varnish_fetch", "fetch_eof" , VSL_stats->fetch_eof); /* Fetch EOF */
+ varnish_submit("varnish_fetch", "fetch_bad-headers", VSL_stats->fetch_bad); /* Fetch bad headers */
+ varnish_submit("varnish_fetch", "fetch_close" , VSL_stats->fetch_close); /* Fetch wanted close */
+ varnish_submit("varnish_fetch", "fetch_oldhttp" , VSL_stats->fetch_oldhttp); /* Fetch pre HTTP/1.1 closed */
+ varnish_submit("varnish_fetch", "fetch_zero" , VSL_stats->fetch_zero); /* Fetch zero len */
+ varnish_submit("varnish_fetch", "fetch_failed" , VSL_stats->fetch_failed); /* Fetch failed */
+ }
} /* }}} */
static int varnish_read(void) /* {{{ */