From: John David Duncan Date: April 24 2012 1:44am Subject: bzr push into mysql-5.5-cluster-7.2 branch (john.duncan:3895 to 3896) List-Archive: http://lists.mysql.com/commits/143624 Message-Id: <201204240144.q3O1ik1J020178@acsmt356.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3896 John David Duncan 2012-04-23 [merge] local merge modified: mysql-test/lib/My/Memcache.pm storage/ndb/memcache/src/ndb_engine.c storage/ndb/memcache/src/ndb_engine_private.h 3895 Ole John Aske 2012-04-23 Reverted incorrect change of 'tree_name' caused by previous merge from ...7.2-spj modified: .bzr-mysql/default.conf === modified file 'mysql-test/lib/My/Memcache.pm' --- a/mysql-test/lib/My/Memcache.pm 2012-04-14 00:53:04 +0000 +++ b/mysql-test/lib/My/Memcache.pm 2012-04-24 01:41:51 +0000 @@ -33,10 +33,9 @@ ### $mc->get(key) returns value or undef ### $mc->delete(key) returns 1 on success, 0 on failure ### $mc->stats(stat_key) get stats; returns a hash -### $mc->incr(key, amount) returns the new value or undef -### $mc->decr(key, amount) like incr. (Note: In the Binary protocol -### only, incr and decr can take a 3rd -### argument, the initial value). +### $mc->incr(key, amount, [initial]) returns the new value or undef +### $mc->decr(key, amount, [initial]) like incr. The third argument is used +### in the Binary protocol ONLY. ### $mc->flush() flush_all ### ### $mc->set_expires(sec) Set TTL for all store operations @@ -51,6 +50,8 @@ ### Returns the generation number of the newly running configuration, ### or zero on timeout/error. +### TO DO: REPLACE with CAS ID. + use strict; use lib 'lib'; use IO::Socket::INET; === modified file 'storage/ndb/memcache/src/ndb_engine.c' --- a/storage/ndb/memcache/src/ndb_engine.c 2012-04-05 21:00:05 +0000 +++ b/storage/ndb/memcache/src/ndb_engine.c 2012-04-24 01:41:51 +0000 @@ -489,22 +489,24 @@ static ENGINE_ERROR_CODE ndb_get_stats(E DEBUG_ENTER(); - if(stat_key && - ((strncasecmp(stat_key, "ndb", 3) == 0) || - (strncasecmp(stat_key, "scheduler", 9) == 0) || - (strncasecmp(stat_key, "reconf", 6) == 0) || - (strncasecmp(stat_key, "errors", 6) == 0) - )) - { - /* NDB Engine stats */ - pipeline_add_stats(pipeline, stat_key, add_stat, cookie); - return ENGINE_SUCCESS; - } - else { - /* Default engine stats */ - return def_eng->engine.get_stats(ndb_eng->m_default_engine, cookie, - stat_key, nkey, add_stat); + if(stat_key) { + if(strncasecmp(stat_key, "menu", 4) == 0) + return stats_menu(add_stat, cookie); + + if((strncasecmp(stat_key, "ndb", 3) == 0) || + (strncasecmp(stat_key, "scheduler", 9) == 0) || + (strncasecmp(stat_key, "reconf", 6) == 0) || + (strncasecmp(stat_key, "errors", 6) == 0)) + { + /* NDB Engine stats */ + pipeline_add_stats(pipeline, stat_key, add_stat, cookie); + return ENGINE_SUCCESS; + } } + + /* Default engine stats */ + return def_eng->engine.get_stats(ndb_eng->m_default_engine, cookie, + stat_key, nkey, add_stat); } @@ -840,3 +842,64 @@ int fetch_core_settings(struct ndb_engin return se->server.core->get_config(items); } + +ENGINE_ERROR_CODE stats_menu(ADD_STAT add_stat, const void *cookie) { + char key[128]; + char val[128]; + int klen, vlen; + + klen = sprintf(key, "ndb"); + vlen = sprintf(val, " NDB Engine: NDBAPI statistics"); + add_stat(key, klen, val, vlen, cookie); + + klen = sprintf(key, "errors"); + vlen = sprintf(val, " NDB Engine: Error message counters"); + add_stat(key, klen, val, vlen, cookie); + + klen = sprintf(key, "scheduler"); + vlen = sprintf(val, " NDB Engine: Scheduler internal statistics"); + add_stat(key, klen, val, vlen, cookie); + + klen = sprintf(key, "reconf"); + vlen = sprintf(val, " NDB Engine: Current configuration version"); + add_stat(key, klen, val, vlen, cookie); + + klen = sprintf(key, "settings"); + vlen = sprintf(val, " Server core: configurable settings"); + add_stat(key, klen, val, vlen, cookie); + + klen = sprintf(key, "reset"); + vlen = sprintf(val, " Server core: reset counters"); + add_stat(key, klen, val, vlen, cookie); + + klen = sprintf(key, "detail"); + vlen = sprintf(val, " Server core: use stats detail on|off|dump"); + add_stat(key, klen, val, vlen, cookie); + + klen = sprintf(key, "aggregate"); + vlen = sprintf(val, " Server core: aggregated"); + add_stat(key, klen, val, vlen, cookie); + + klen = sprintf(key, "slabs"); + vlen = sprintf(val, " Cache Engine: allocator"); + add_stat(key, klen, val, vlen, cookie); + + klen = sprintf(key, "items"); + vlen = sprintf(val, " Cache Engine: itemes cached"); + add_stat(key, klen, val, vlen, cookie); + + klen = sprintf(key, "sizes"); + vlen = sprintf(val, " Cache Engine: items per allocation class"); + add_stat(key, klen, val, vlen, cookie); + + klen = sprintf(key, "vbucket"); + vlen = sprintf(val, " Cache Engine: dump vbucket table"); + add_stat(key, klen, val, vlen, cookie); + + klen = sprintf(key, "scrub"); + vlen = sprintf(val, " Cache Engine: scrubber status"); + add_stat(key, klen, val, vlen, cookie); + + return ENGINE_SUCCESS; +} + === modified file 'storage/ndb/memcache/src/ndb_engine_private.h' --- a/storage/ndb/memcache/src/ndb_engine_private.h 2012-03-07 01:22:53 +0000 +++ b/storage/ndb/memcache/src/ndb_engine_private.h 2012-04-24 01:41:51 +0000 @@ -29,6 +29,7 @@ int fetch_core_settings(struct ndb_engin void release_and_free(struct workitem *); +ENGINE_ERROR_CODE stats_menu(ADD_STAT add_stat, const void *cookie); /*************** Declarations of functions that implement the engine interface No bundle (reason: useless for push emails).