00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include <config.h>
00031 #include <drizzled/show.h>
00032 #include <drizzled/gettext.h>
00033 #include <boost/program_options.hpp>
00034 #include <drizzled/module/option_map.h>
00035 #include "stats_table.h"
00036 #include "analysis_table.h"
00037 #include "sysvar_holder.h"
00038
00039 #include <string>
00040 #include <map>
00041
00042 namespace po=boost::program_options;
00043
00044 namespace drizzle_plugin
00045 {
00046
00047
00048
00049
00050
00051 static AnalysisTableTool *analysis_table_tool;
00052
00053 static StatsTableTool *stats_table_tool;
00054
00055
00056
00057
00058 static std::string sysvar_memcached_servers;
00059
00066 static int init(drizzled::module::Context &context)
00067 {
00068 const drizzled::module::option_map &vm= context.getOptions();
00069
00070
00071 stats_table_tool= new StatsTableTool;
00072 context.add(stats_table_tool);
00073
00074 analysis_table_tool= new AnalysisTableTool;
00075 context.add(analysis_table_tool);
00076
00077 context.registerVariable(new sys_var_std_string("servers",
00078 sysvar_memcached_servers));
00079
00080 return 0;
00081 }
00082
00083 static void init_options(drizzled::module::option_context &context)
00084 {
00085 context("servers",
00086 po::value<std::string>()->default_value(""),
00087 _("List of memcached servers."));
00088 }
00089
00090 }
00091
00092 DRIZZLE_DECLARE_PLUGIN
00093 {
00094 DRIZZLE_VERSION_ID,
00095 "memcached_stats",
00096 "1.0",
00097 "Padraig O'Sullivan",
00098 N_("Memcached Stats as I_S tables"),
00099 PLUGIN_LICENSE_BSD,
00100 drizzle_plugin::init,
00101 NULL,
00102 drizzle_plugin::init_options
00103 }
00104 DRIZZLE_DECLARE_PLUGIN_END;