summaryrefslogtreecommitdiff
path: root/slabs.c
diff options
context:
space:
mode:
authorDustin Sallings <dustin@spy.net>2009-03-17 15:02:07 -0700
committerDustin Sallings <dustin@spy.net>2009-03-23 21:31:56 -0700
commit2b40d72c04e523d44d46d44e62d416bcf9216c8e (patch)
tree4fe60c2d17746c424f971c879b9eac7f5fbd252f /slabs.c
parent7cf9489b2cad1e984bfd58fea5000aa4d5a562e4 (diff)
downloadmemcached-2b40d72c04e523d44d46d44e62d416bcf9216c8e.tar.gz
stats slab's used_chunks should show chunks put to use
It was a bit unclear what it was doing before, but it started out with a value equal to total_chunks, which was surely wrong. This change and its accompanying test ensure the value makes a bit more sense.
Diffstat (limited to 'slabs.c')
-rw-r--r--slabs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/slabs.c b/slabs.c
index b28fc68..a071434 100644
--- a/slabs.c
+++ b/slabs.c
@@ -424,7 +424,7 @@ static char *do_slabs_stats(uint32_t (*add_stats)(char *buf, const char *key,
bufcurr += nbytes;
sprintf(key, "%d:used_chunks", i);
- sprintf(val, "%u", ((slabs*perslab) - p->sl_curr));
+ sprintf(val, "%u", slabs*perslab - p->sl_curr - p->end_page_free);
nbytes = add_stats(bufcurr, key, strlen(key), val, strlen(val), c);
linelen += nbytes;
bufcurr += nbytes;