Hi, Sergei!
Thanks for your advice and I agree with you.
Accoring to your advice, It's not a good plan to pass some data to my plugin agent from sql_parser.cc because it needs to compile mariadb server.
So I hava a another concept.
Instead of put some code to sql_parse.cc, plugin collects a some data like below sample conceptual code.
I_List_iterator<THD> it(threads);
while ((tmp_thd=it++))
{
if ((tmp_thd->get_command() == COM_QUERY) ||(tmp_thd->get_command() == COM_STMT_EXECUTE) )
continue;
char* sql = tmp_thd->query();
if(sql)
{
...
send_data();
}
}
In this case, I though that it doesn't need to compile maria server, but it need to recompile whenever structure of THD is changed.
Can you accept that?
Otherwise, if i hardcode directly into the server, can I contribute this community ?
Additionally, you asked me about what information I want to collect.
I want to collect data like below.
* events_statements_current
* events_stages_current
* events_waits_current
* events_statements_summary_by_digest
These data easily collected by sql . but it's hard to collect by access memory.(THD or something else.)
I wonder if it is possible to collect these data without using pfs (or psi) data structure.
If it is possible, Is THD class is entry point or something else?
If you don't mind, please let me know the best way to collect these data.
Dear,
kyungnam.
ps: my email address changed from gmail to my company's mail address.
----------------------------------------------------------------------------
From: Sergei Golubchik <serg@mariadb.org>
Date: 2015-03-24 0:11 GMT+09:00
Subject: Re: [Maria-developers] I wonder what elements add to CMakeLists.txt
To: kyung nam Kim <knamkim@gmail.com>
Cc: maria-developers@lists.launchpad.net
Hi, kyung!
On Mar 23, kyung nam Kim wrote:
> Hi, Sergei!
> Thanks for your reply.
> You asked me about information which I want to send to my plugin.
> I have a plan to develop monitoring tool for mariadb.
> I want to develop a agent as a mariadb plugin.
> Agent collect data from sql_parse.cc (I' don't know exactly where more
> infomation about performance .) and sends that data to APM (Application
> Performance Monitoring) Server. and Users use databoard to see that data
> via APM server.
>
> We have already have a APM Server, Dashboard and many kinds of agent. (for
> server, was). I want to add agent for mariaDB and contribute this community
> if possible.
Right. That's exactly why I ask.
We cannot accept your plugin and it'll be of little use to the community
(not "of no use", it'll be used, but less than it could've been) if one
would need to modify and recompile MariaDB to use your plugin.
If you'd like, let's try to figure out whether you can collect your
infomation without patching the server. So what data do you need,
exactly?
> Your advice is right. It's easier my header file to sql folder.
> But When I want to develop my agent as a plugin type, I meet error as
> follows.
> ============================================
> [ 98%] Built target mysqlserver
> Linking CXX shared library libmysqld.so
> ../../sql_parse.cc:linenum: undefined reference to 'Mymon::Mymon()'
> ../../sql_parse.cc:linenum: undefined reference to 'Mymon::putData(THD*
> thd);
Of course. Because you want sql_parse.cc to call your plugin, your
plugin *always must be in the server*. You cannot have it as a separate
shared object. To do that, add the MANDATORY keyword to your
MYSQL_ADD_PLUGIN() declaration in CMakeLists.txt
Regards,
Sergei