Permalink
Browse files

Cluster in memcached key name, parameter documentation, better debug …

…support.
  • Loading branch information...
1 parent 01e3b2b commit 2c20099d4366d75e9225d983b0407b54470b47f3 @jbuchbinder jbuchbinder committed Jan 23, 2013
Showing with 8 additions and 2 deletions.
  1. +5 −0 gmetad/gmetad.conf.in
  2. +3 −2 gmetad/rrd_helpers.c
View
@@ -163,4 +163,9 @@ case_sensitive_hostnames 0
# default: 500
# carbon_timeout 500
#
+# Memcached configuration (if it has been compiled in)
+# Format documentation at http://docs.libmemcached.org/libmemcached_configuration.html
+# default: ""
+# memcached_parameters "--SERVER=127.0.0.1"
+#
View
@@ -325,7 +325,7 @@ write_data_to_memcached ( const char *source, const char *host, const char *metr
{
time_t expiry_time;
char s_path[256];
- sprintf(s_path, "%s/%s", host, metric);
+ sprintf(s_path, "%s/%s/%s", source, host, metric);
if (expiry != 0) {
expiry_time = time(NULL) + expiry;
@@ -341,10 +341,11 @@ write_data_to_memcached ( const char *source, const char *host, const char *metr
}
rc = memcached_set(memc, s_path, strlen(s_path), sum, strlen(sum), expiry_time, (uint32_t)0);
if (rc != MEMCACHED_SUCCESS) {
- debug_msg("Unable to push %s value %s to the memcached server(s)", s_path, sum);
+ debug_msg("Unable to push %s value %s to the memcached server(s) - %s", s_path, sum, memcached_strerror(memc, rc));
memcached_pool_push(memcached_connection_pool, memc);
return EXIT_FAILURE;
} else {
+ debug_msg("Pushed %s value %s to the memcached server(s)", s_path, sum);
memcached_pool_push(memcached_connection_pool, memc);
return EXIT_SUCCESS;
}

0 comments on commit 2c20099

Please sign in to comment.