diff options
author | Sergei Golubchik <sergii@pisem.net> | 2012-04-18 04:00:08 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2012-04-18 04:00:08 +0200 |
commit | 6e827f3455407ec8133bf888c19255ecbf93c20b (patch) | |
tree | de77bdc20d872d8854855487c54a0041a11db105 /plugin | |
parent | 415507d3924da6af7d841376a2ddfb902145666c (diff) | |
download | mariadb-git-6e827f3455407ec8133bf888c19255ecbf93c20b.tar.gz |
mdev-224 plugin usage statistics in the feedback reports
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/feedback/utils.cc | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/plugin/feedback/utils.cc b/plugin/feedback/utils.cc index 48bbd72d530..f81fde2ab8f 100644 --- a/plugin/feedback/utils.cc +++ b/plugin/feedback/utils.cc @@ -152,26 +152,36 @@ namespace feedback { static const bool UNSIGNED= true; ///< used below when inserting integers /** - callback for fill_plugin_version() - insert a plugin name and its version + callback for fill_plugins() */ static my_bool show_plugins(THD *thd, plugin_ref plugin, void *arg) { TABLE *table= (TABLE*) arg; + char name[NAME_LEN*2]; + size_t name_len; char version[20]; size_t version_len; + name_len= my_snprintf(name, sizeof(name), "%s version", + plugin_name(plugin)->str); + version_len= my_snprintf(version, sizeof(version), "%d.%d", (plugin_decl(plugin)->version) >> 8, (plugin_decl(plugin)->version) & 0xff); - INSERT2(plugin_name(plugin)->str, plugin_name(plugin)->length, + INSERT2(name, name_len, (version, version_len, system_charset_info)); + name_len= my_snprintf(name, sizeof(name), "%s used", + plugin_name(plugin)->str); + + INSERT2(name, name_len, (plugin_ref_to_int(plugin)->locks_total, UNSIGNED)); + return 0; } /** - inserts all plugins and their versions into I_S.FEEDBACK + inserts all plugins, their versions, and usage counters */ int fill_plugin_version(THD *thd, TABLE_LIST *tables) { |