summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4dcc843)
raw | patch | inline | side by side (parent: 4dcc843)
author | Jérôme Renard <jerome.renard@gmail.com> | |
Sun, 6 Jun 2010 07:23:25 +0000 (09:23 +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 80643e58a6803ba64fcc804f9f54f78df64370a4..8cb3fcebeb04bd681a8c05f99692ffbb4091d225 100644 (file)
--- a/src/collectd.conf.in
+++ b/src/collectd.conf.in
# - SMS bytes freed
# MonitorSMS yes
#
+# Will monitor:
+# - allocator requests
+# - outstanding allocations
+# - bytes allocated
+# - bytes free
+# MonitorSM yes
+#
#</Plugin>
#<Plugin vmem>
diff --git a/src/types.db b/src/types.db
index 6bdb7744f4d3a7094f5da6d3182790c3fb46f247..2fe5f4ff36e52641806dc2c94b0d62788a577e9f 100644 (file)
--- a/src/types.db
+++ b/src/types.db
varnish_shm value:GAUGE:0:U
varnish_sma value:GAUGE:0:U
varnish_sms value:GAUGE:0:U
+varnish_sm 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 80c6d37102aa3c48fdcd238cc0a20e9f99c214cf..1d07945ebdfb9db86017ccadd5d7751239e82c69 100644 (file)
--- a/src/varnish.c
+++ b/src/varnish.c
* shm_flushes SHM flushes due to overflow Y
* shm_cont SHM MTX contention Y
* shm_cycles SHM cycles through buffer Y
- * sm_nreq allocator requests N
- * sm_nobj outstanding allocations N
- * sm_balloc bytes allocated N
- * sm_bfree bytes free N
+ * sm_nreq allocator requests Y
+ * sm_nobj outstanding allocations Y
+ * sm_balloc bytes allocated Y
+ * sm_bfree bytes free Y
* sma_nreq SMA allocator requests Y
* sma_nobj SMA outstanding allocations Y
* sma_nbytes SMA outstanding bytes Y
#include <varnish/varnishapi.h>
-#define USER_CONFIG_INIT {0, 0, 0, 0, 0, 0, 0, 0, 0}
+#define USER_CONFIG_INIT {0, 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_shm;
int monitor_sma;
int monitor_sms;
+ int monitor_sm;
};
typedef struct user_config_s user_config_t; /* }}} */
"MonitorHCB",
"MonitorSHM",
"MonitorSMA",
- "MonitorSMS"
+ "MonitorSMS",
+ "MonitorSM"
};
static int config_keys_num = STATIC_ARRAY_SIZE (config_keys); /* }}} */
SET_MONITOR_FLAG("MonitorSHM" , monitor_shm , value);
SET_MONITOR_FLAG("MonitorSMA" , monitor_sma , value);
SET_MONITOR_FLAG("MonitorSMS" , monitor_sms , value);
+ SET_MONITOR_FLAG("MonitorSM" , monitor_sm , value);
return (0);
} /* }}} */
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 */
}
+
+ if(user_config.monitor_sm == 1)
+ {
+ varnish_submit("varnish_sm", "sm_nreq" , VSL_stats->sm_nreq); /* allocator requests */
+ varnish_submit("varnish_sm", "sm_nobj" , VSL_stats->sm_nobj); /* outstanding allocations */
+ varnish_submit("varnish_sm", "sm_balloc", VSL_stats->sm_balloc); /* bytes allocated */
+ varnish_submit("varnish_sm", "sm_bfree" , VSL_stats->sm_bfree); /* bytes free */
+ }
} /* }}} */
static int varnish_read(void) /* {{{ */