diff options
author | Amar Tumballi <amarts@redhat.com> | 2012-02-23 12:53:19 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-02-27 02:18:35 -0800 |
commit | a3f6b0c4f231ccdb727227c9c35816b4823cef90 (patch) | |
tree | a0594eedbca1c88fa56bf4f9c172152a77263ae8 /cli/src | |
parent | 85471322df9676cc344cc2b03627c02ed90da3cd (diff) |
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 <amarts@redhat.com>
BUG: 797730
Reviewed-on: http://review.gluster.com/2804
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'cli/src')
-rw-r--r-- | cli/src/cli-rpc-ops.c | 30 | ||||
-rw-r--r-- | cli/src/cli-xml-output.c | 21 |
2 files changed, 44 insertions, 7 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 995526abbea..34b37cfb4a7 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -4058,6 +4058,8 @@ cli_print_volume_status_mempool (dict_t *dict, char *prefix) uint64_t paddedsizeof = 0; uint64_t alloccount = 0; int32_t maxalloc = 0; + uint64_t pool_misses = 0; + int32_t maxstdalloc = 0; char key[1024] = {0,}; int i = 0; @@ -4071,10 +4073,12 @@ cli_print_volume_status_mempool (dict_t *dict, char *prefix) goto out; cli_out ("Mempool Stats\n-------------"); - cli_out ("%-30s %9s %9s %12s %10s %8s", "Name", "HotCount","ColdCount", - "PaddedSizeof", "AllocCount", "MaxAlloc"); - cli_out ("%-30s %9s %9s %12s %10s %8s", "----", "--------", "---------", - "------------", "----------", "--------"); + cli_out ("%-30s %9s %9s %12s %10s %8s %8s %12s", "Name", "HotCount", + "ColdCount", "PaddedSizeof", "AllocCount", "MaxAlloc", + "Misses", "Max-StdAlloc"); + cli_out ("%-30s %9s %9s %12s %10s %8s %8s %12s", "----", "--------", + "---------", "------------", "----------", + "--------", "--------", "------------"); for (i = 0; i < mempool_count; i++) { memset (key, 0, sizeof (key)); @@ -4114,9 +4118,21 @@ cli_print_volume_status_mempool (dict_t *dict, char *prefix) if (ret) goto out; - cli_out ("%-30s %9d %9d %12"PRIu64" %10"PRIu64" %8d", name, - hotcount, coldcount, paddedsizeof, alloccount, - maxalloc); + memset (key, 0, sizeof (key)); + snprintf (key, sizeof (key), "%s.pool%d.max-stdalloc", prefix, i); + ret = dict_get_int32 (dict, key, &maxstdalloc); + if (ret) + goto out; + + memset (key, 0, sizeof (key)); + snprintf (key, sizeof (key), "%s.pool%d.pool-misses", prefix, i); + ret = dict_get_uint64 (dict, key, &pool_misses); + if (ret) + goto out; + + cli_out ("%-30s %9d %9d %12"PRIu64" %10"PRIu64" %8d %8"PRIu64 + " %12d", name, hotcount, coldcount, paddedsizeof, + alloccount, maxalloc, pool_misses, maxstdalloc); } out: diff --git a/cli/src/cli-xml-output.c b/cli/src/cli-xml-output.c index 3e081277bfc..6a22b249b7c 100644 --- a/cli/src/cli-xml-output.c +++ b/cli/src/cli-xml-output.c @@ -441,6 +441,27 @@ cli_xml_output_vol_status_mempool (xmlTextWriterPtr writer, dict_t *dict, "%d", maxalloc); XML_RET_CHECK_AND_GOTO (ret, out); + memset (key, 0, sizeof (key)); + snprintf (key, sizeof (key), "%s.pool%d.pool-misses", prefix, i); + ret = dict_get_uint64 (dict, key, &alloccount); + if (ret) + goto out; + ret = xmlTextWriterWriteFormatElement (writer, + (xmlChar *)"poolMisses", + "%"PRIu64, alloccount); + XML_RET_CHECK_AND_GOTO (ret, out); + + memset (key, 0, sizeof (key)); + snprintf (key, sizeof (key), "%s.pool%d.max-stdalloc", prefix, i); + ret = dict_get_int32 (dict, key, &maxalloc); + if (ret) + goto out; + ret = xmlTextWriterWriteFormatElement (writer, + (xmlChar *)"maxStdAlloc", + "%d", maxalloc); + XML_RET_CHECK_AND_GOTO (ret, out); + + /* </pool> */ ret = xmlTextWriterEndElement (writer); XML_RET_CHECK_AND_GOTO (ret, out); |