O'Reilly logo

MySQL 5.1 Plugin Development by Andrew Hutchings, Sergei Golubchik

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

A System Information plugin

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required