X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmemcached.c;h=e4ccbce60f4aaddc19fe5c7e3d8c2e379f97a0cd;hb=e746ad785774de37a30302fef65f1c4aaf8698ab;hp=79c38a798ec99e99203e0fa422534fd4fbd94023;hpb=1c5e82a7eefdbcce608951fa5a00c5c5a43a41e6;p=collectd.git diff --git a/src/memcached.c b/src/memcached.c index 79c38a79..e4ccbce6 100644 --- a/src/memcached.c +++ b/src/memcached.c @@ -78,7 +78,7 @@ static int memcached_connect_unix(memcached_t *st) { char errbuf[1024]; ERROR("memcached plugin: memcached_connect_unix: socket(2) failed: %s", sstrerror(errno, errbuf, sizeof(errbuf))); - return (-1); + return -1; } /* connect to the memcached daemon */ @@ -89,7 +89,7 @@ static int memcached_connect_unix(memcached_t *st) { fd = -1; } - return (fd); + return fd; } /* int memcached_connect_unix */ static int memcached_connect_inet(memcached_t *st) { @@ -109,7 +109,7 @@ static int memcached_connect_inet(memcached_t *st) { st->connhost, st->connport, (status == EAI_SYSTEM) ? sstrerror(errno, errbuf, sizeof(errbuf)) : gai_strerror(status)); - return (-1); + return -1; } for (struct addrinfo *ai_ptr = ai_list; ai_ptr != NULL; @@ -138,14 +138,14 @@ static int memcached_connect_inet(memcached_t *st) { } freeaddrinfo(ai_list); - return (fd); + return fd; } /* int memcached_connect_inet */ static int memcached_connect(memcached_t *st) { if (st->socket != NULL) - return (memcached_connect_unix(st)); + return memcached_connect_unix(st); else - return (memcached_connect_inet(st)); + return memcached_connect_inet(st); } static int memcached_query_daemon(char *buffer, size_t buffer_size, @@ -167,7 +167,7 @@ static int memcached_query_daemon(char *buffer, size_t buffer_size, sstrerror(errno, errbuf, sizeof(errbuf))); shutdown(fd, SHUT_RDWR); close(fd); - return (-1); + return -1; } /* receive data from the memcached daemon */ @@ -188,7 +188,7 @@ static int memcached_query_daemon(char *buffer, size_t buffer_size, sstrerror(errno, errbuf, sizeof(errbuf))); shutdown(fd, SHUT_RDWR); close(fd); - return (-1); + return -1; } buffer_fill += (size_t)status; @@ -212,7 +212,7 @@ static int memcached_query_daemon(char *buffer, size_t buffer_size, shutdown(fd, SHUT_RDWR); close(fd); - return (status); + return status; } /* int memcached_query_daemon */ static void memcached_init_vl(value_list_t *vl, memcached_t const *st) { @@ -412,8 +412,10 @@ static int memcached_read(user_data_t *user_data) { } /* - * Operations on the cache, i. e. cache hits, cache misses and evictions of - * items + * Operations on the cache: + * - get hits/misses + * - delete hits/misses + * - evictions */ else if (FIELD_IS("get_hits")) { submit_derive("memcached_ops", "hits", atoll(fields[2]), st); @@ -422,6 +424,10 @@ static int memcached_read(user_data_t *user_data) { submit_derive("memcached_ops", "misses", atoll(fields[2]), st); } else if (FIELD_IS("evictions")) { submit_derive("memcached_ops", "evictions", atoll(fields[2]), st); + } else if (FIELD_IS("delete_hits")) { + submit_derive("memcached_ops", "delete_hits", atoll(fields[2]), st); + } else if (FIELD_IS("delete_misses")) { + submit_derive("memcached_ops", "delete_misses", atoll(fields[2]), st); } /* @@ -471,8 +477,8 @@ static int memcached_add_read_callback(memcached_t *st) { char callback_name[3 * DATA_MAX_NAME_LEN]; int status; - ssnprintf(callback_name, sizeof(callback_name), "memcached/%s", - (st->name != NULL) ? st->name : "__legacy__"); + snprintf(callback_name, sizeof(callback_name), "memcached/%s", + (st->name != NULL) ? st->name : "__legacy__"); /* If no
used then: * - Connect to the destination specified by