summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e9a9482)
raw | patch | inline | side by side (parent: e9a9482)
author | Jérôme Renard <jerome.renard@gmail.com> | |
Fri, 4 Jun 2010 16:08:22 +0000 (18:08 +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 92de8976919d3b0ed42c55bcf88a79f1b12bc5ec..d2f7bfbfa77c97f9c034935f68f24f0b407d6964 100644 (file)
--- a/src/collectd.conf.in
+++ b/src/collectd.conf.in
# MonitorCache yes
# MonitorConnections yes
# MonitorESI yes
+# MonitorBackend yes
#</Plugin>
#<Plugin vmem>
diff --git a/src/types.db b/src/types.db
index 495de961a6d09d9e690b44f1f29aebbffc2281b7..99e96e9809c1f5b3f4fa85f376be22f7391b3233 100644 (file)
--- a/src/types.db
+++ b/src/types.db
varnish_cache_ratio value:GAUGE:0:U
varnish_connections value:GAUGE:0:U
varnish_esi value:GAUGE:0:U
+varnish_backend_connections 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 4329687e8e9bf54740516cf5f3774743d78e16bf..4bea1228421b3955652dd7edd6554325e7503656 100644 (file)
--- a/src/varnish.c
+++ b/src/varnish.c
#include <varnish/varnishapi.h>
-#define USER_CONFIG_INIT {0, 0, 0}
+#define USER_CONFIG_INIT {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_cache;
int monitor_connections;
int monitor_esi;
+ int monitor_backend;
};
typedef struct user_config_s user_config_t; /* }}} */
{
"MonitorCache",
"MonitorConnections",
- "MonitorESI"
+ "MonitorESI",
+ "MonitorBackend",
};
static int config_keys_num = STATIC_ARRAY_SIZE (config_keys); /* }}} */
SET_MONITOR_FLAG("MonitorCache", monitor_cache, value);
SET_MONITOR_FLAG("MonitorConnections", monitor_connections, value);
SET_MONITOR_FLAG("MonitorESI", monitor_esi, value);
+ SET_MONITOR_FLAG("MonitorBackend", monitor_backend, value);
return (0);
} /* }}} */
varnish_submit("varnish_esi", "esi_parsed", VSL_stats->esi_parse);
varnish_submit("varnish_esi", "esi_errors", VSL_stats->esi_errors);
}
+
+ if(user_config.monitor_backend == 1)
+ {
+ varnish_submit("varnish_backend_connections", "backend_connections-success" , VSL_stats->backend_conn); /* Backend conn. success */
+ varnish_submit("varnish_backend_connections", "backend_connections-not-attempted", VSL_stats->backend_unhealthy); /* Backend conn. not attempted */
+ varnish_submit("varnish_backend_connections", "backend_connections-too-many" , VSL_stats->backend_busy); /* Backend conn. too many */
+ varnish_submit("varnish_backend_connections", "backend_connections-failures" , VSL_stats->backend_fail); /* Backend conn. failures */
+ varnish_submit("varnish_backend_connections", "backend_connections-reuses" , VSL_stats->backend_reuse); /* Backend conn. reuses */
+ varnish_submit("varnish_backend_connections", "backend_connections-was-closed" , VSL_stats->backend_toolate); /* Backend conn. was closed */
+ 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 */
+ }
} /* }}} */
static int varnish_read(void) /* {{{ */