summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5e4e0e2)
raw | patch | inline | side by side (parent: 5e4e0e2)
author | Jérôme Renard <jerome.renard@gmail.com> | |
Sun, 6 Jun 2010 07:10:12 +0000 (09:10 +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 2e31ea35c8e001fee1806502e75632247e3abdba..80643e58a6803ba64fcc804f9f54f78df64370a4 100644 (file)
--- a/src/collectd.conf.in
+++ b/src/collectd.conf.in
# - SMA bytes allocated
# - SMA bytes free
# MonitorSMA yes
+#
+# Will monitor:
+# - SMS allocator requests
+# - SMS outstanding allocations
+# - SMS outstanding bytes
+# - SMS bytes allocated
+# - SMS bytes freed
+# MonitorSMS yes
+#
#</Plugin>
#<Plugin vmem>
diff --git a/src/types.db b/src/types.db
index 3444e45acd0d5c601e3a41b25ae9d2509240d0cc..6bdb7744f4d3a7094f5da6d3182790c3fb46f247 100644 (file)
--- a/src/types.db
+++ b/src/types.db
varnish_hcb value:GAUGE:0:U
varnish_shm value:GAUGE:0:U
varnish_sma value:GAUGE:0:U
+varnish_sms 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 88fd58d0eadb783b38e43b34d96a69ac83412d34..80c6d37102aa3c48fdcd238cc0a20e9f99c214cf 100644 (file)
--- a/src/varnish.c
+++ b/src/varnish.c
* sma_nbytes SMA outstanding bytes Y
* sma_balloc SMA bytes allocated Y
* sma_bfree SMA bytes free Y
- * sms_nreq SMS allocator requests N
- * sms_nobj SMS outstanding allocations N
- * sms_nbytes SMS outstanding bytes N
- * sms_balloc SMS bytes allocated N
- * sms_bfree SMS bytes freed N
+ * sms_nreq SMS allocator requests Y
+ * sms_nobj SMS outstanding allocations Y
+ * sms_nbytes SMS outstanding bytes Y
+ * sms_balloc SMS bytes allocated Y
+ * sms_bfree SMS bytes freed Y
* backend_req Backend requests made N
* n_vcl N vcl total N
* n_vcl_avail N vcl available N
#include <varnish/varnishapi.h>
-#define USER_CONFIG_INIT {0, 0, 0, 0, 0, 0, 0, 0}
+#define USER_CONFIG_INIT {0, 0, 0, 0, 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_hcb;
int monitor_shm;
int monitor_sma;
+ int monitor_sms;
};
typedef struct user_config_s user_config_t; /* }}} */
"MonitorFetch",
"MonitorHCB",
"MonitorSHM",
- "MonitorSMA"
+ "MonitorSMA",
+ "MonitorSMS"
};
static int config_keys_num = STATIC_ARRAY_SIZE (config_keys); /* }}} */
SET_MONITOR_FLAG("MonitorHCB" , monitor_hcb , value);
SET_MONITOR_FLAG("MonitorSHM" , monitor_shm , value);
SET_MONITOR_FLAG("MonitorSMA" , monitor_sma , value);
+ SET_MONITOR_FLAG("MonitorSMS" , monitor_sms , value);
return (0);
} /* }}} */
varnish_submit("varnish_sma", "sma_balloc", VSL_stats->sma_balloc); /* SMA bytes allocated */
varnish_submit("varnish_sma", "sma_bfree" , VSL_stats->sma_bfree); /* SMA bytes free */
}
+
+ if(user_config.monitor_sms == 1)
+ {
+ varnish_submit("varnish_sms", "sms_nreq" , VSL_stats->sms_nreq); /* SMS allocator requests */
+ varnish_submit("varnish_sms", "sms_nobj" , VSL_stats->sms_nobj); /* SMS outstanding allocations */
+ varnish_submit("varnish_sms", "sms_nbytes", VSL_stats->sms_nbytes); /* SMS outstanding bytes */
+ varnish_submit("varnish_sms", "sms_balloc", VSL_stats->sms_balloc); /* SMS bytes allocated */
+ varnish_submit("varnish_sms", "sms_bfree" , VSL_stats->sms_bfree); /* SMS bytes freed */
+ }
} /* }}} */
static int varnish_read(void) /* {{{ */