diff options
author | Dustin Sallings <dustin@spy.net> | 2009-03-06 18:44:58 -0800 |
---|---|---|
committer | Dustin Sallings <dustin@spy.net> | 2009-03-06 20:54:30 -0800 |
commit | e71ea432b9ccfbdd7dc52a01365ec06e91119154 (patch) | |
tree | acdf61a4ca36352ef84156ff90d28e56d34c5a7d | |
parent | 25b5189c6adfb2c44ec6a958ac521fba32333c89 (diff) | |
download | memcached-e71ea432b9ccfbdd7dc52a01365ec06e91119154.tar.gz |
Show hits and sets on slab stats.
-rw-r--r-- | slabs.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -383,6 +383,10 @@ static char *do_slabs_stats(uint32_t (*add_stats)(char *buf, const char *key, return NULL; } + /* Get the per-thread stats which contain some interesting aggregates */ + struct thread_stats thread_stats; + threadlocal_stats_aggregate(&thread_stats); + total = 0; for(i = POWER_SMALLEST; i <= power_largest; i++) { slabclass_t *p = &slabclass[i]; @@ -437,6 +441,20 @@ static char *do_slabs_stats(uint32_t (*add_stats)(char *buf, const char *key, linelen += nbytes; bufcurr += nbytes; + sprintf(key, "%d:get_hits", i); + sprintf(val, "%llu", + (unsigned long long)thread_stats.slab_stats[i].get_hits); + nbytes = add_stats(bufcurr, key, strlen(key), val, strlen(val), c); + linelen += nbytes; + bufcurr += nbytes; + + sprintf(key, "%d:cmd_set", i); + sprintf(val, "%llu", + (unsigned long long)thread_stats.slab_stats[i].set_cmds); + nbytes = add_stats(bufcurr, key, strlen(key), val, strlen(val), c); + linelen += nbytes; + bufcurr += nbytes; + total++; } } |