summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2012-01-11 16:52:47 -0800
committerdormando <dormando@rydia.net>2012-01-11 16:52:47 -0800
commita16ce583273e42924f2cce61d4ce8832b76e01a4 (patch)
treec34f342bba02554d5e840fe26d22ba37b6f8dba0
parent96c07ae7758646fdb5a0eaa94e81ad2a7b579efe (diff)
downloadmemcached-a16ce583273e42924f2cce61d4ce8832b76e01a4.tar.gz
binary deletes were not ticking stats counters
Thanks to Stephen Yang for the bug report.
-rw-r--r--memcached.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/memcached.c b/memcached.c
index a86248f..33d3e80 100644
--- a/memcached.c
+++ b/memcached.c
@@ -2159,6 +2159,9 @@ static void process_bin_delete(conn *c) {
uint64_t cas = ntohll(req->message.header.request.cas);
if (cas == 0 || cas == ITEM_get_cas(it)) {
MEMCACHED_COMMAND_DELETE(c->sfd, ITEM_key(it), it->nkey);
+ pthread_mutex_lock(&c->thread->stats.mutex);
+ c->thread->stats.slab_stats[it->slabs_clsid].delete_hits++;
+ pthread_mutex_unlock(&c->thread->stats.mutex);
item_unlink(it);
write_bin_response(c, NULL, 0, 0, 0);
} else {
@@ -2167,6 +2170,9 @@ static void process_bin_delete(conn *c) {
item_remove(it); /* release our reference */
} else {
write_bin_error(c, PROTOCOL_BINARY_RESPONSE_KEY_ENOENT, 0);
+ pthread_mutex_lock(&c->thread->stats.mutex);
+ c->thread->stats.delete_misses++;
+ pthread_mutex_unlock(&c->thread->stats.mutex);
}
}