From a3f6b0c4f231ccdb727227c9c35816b4823cef90 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Thu, 23 Feb 2012 12:53:19 +0530 Subject: mempool: add more counters to understand the usage scenarios properly current design of mempool is to fallback to standard calloc/free if all the buffers in pool are exhausted. Understanding more about those numbers will help us to tune mempool parameters properly over time. Change-Id: I2c94373186f7c6a486caff2611c2d9df2c37db3c Signed-off-by: Amar Tumballi BUG: 797730 Reviewed-on: http://review.gluster.com/2804 Tested-by: Gluster Build System Reviewed-by: Kaushal M Reviewed-by: Vijay Bellur --- libglusterfs/src/statedump.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'libglusterfs/src/statedump.c') diff --git a/libglusterfs/src/statedump.c b/libglusterfs/src/statedump.c index dbbccdb44c3..9b15c5ba50d 100644 --- a/libglusterfs/src/statedump.c +++ b/libglusterfs/src/statedump.c @@ -305,6 +305,9 @@ gf_proc_dump_mempool_info (glusterfs_ctx_t *ctx) pool->padded_sizeof_type); gf_proc_dump_write ("alloc-count", "%"PRIu64, pool->alloc_count); gf_proc_dump_write ("max-alloc", "%d", pool->max_alloc); + + gf_proc_dump_write ("pool-misses", "%"PRIu64, pool->pool_misses); + gf_proc_dump_write ("max-stdalloc", "%d", pool->max_stdalloc); } } @@ -356,6 +359,17 @@ gf_proc_dump_mempool_info_to_dict (glusterfs_ctx_t *ctx, dict_t *dict) if (ret) return; + memset (key, 0, sizeof (key)); + snprintf (key, sizeof (key), "pool%d.max-stdalloc", count); + ret = dict_set_int32 (dict, key, pool->max_stdalloc); + if (ret) + return; + + memset (key, 0, sizeof (key)); + snprintf (key, sizeof (key), "pool%d.pool-misses", count); + ret = dict_set_uint64 (dict, key, pool->pool_misses); + if (ret) + return; count++; } ret = dict_set_int32 (dict, "mempool-count", count); -- cgit