In the previous chapter we created a Daemon plugin that exported
getrusage() data via status variables. For the sake of the example we will now do the same with the Information Schema table. However, to not repeat ourselves we will go beyond
getrusage() and will also use other Linux system information functions. Yes, unfortunately this plugin is unlikely to work on anything except Linux. One can create a portable system information plugin by using, for example, the SIGAR library (http://sigar.hyperic.com) but for simplicity we will keep the example free from external dependencies.
#include <mysql_priv.h> #include <sys/sysinfo.h> bool schema_table_store_record(THD *thd, TABLE *table);
We start the plugin as usual, with ...