[collectd] MySQL lock statistics (was: Mysql Patch on 4.6.2)

Florian Forster octo at verplant.org
Wed Apr 22 23:04:25 CEST 2009


Hi Rodolphe,

thank you very much for your patch :)

On Wed, Apr 22, 2009 at 05:22:35PM +0200, Rodolphe Quiedeville wrote:
> I'm not aware with git, I use it for the first time, so hope this
> patch will work.

Both, a release or Git branch, is fine.

> +mysql_locks		immediate:COUNTER:0:U, waited:COUNTER:0:U

What Sebastian meant is: Let's assume that some future MySQL version has
more interesting statistics about locks. I could picture `timed-out' for
example. Adding this value in a future version is not possible because
adding a data source (`immediate' and `waited' in the line above) to the
type (`mysql_locks' in that line) is basically not possible.

The structure we favor is to have one value per ``data set'' (think: RRD
file). The line above would become:
  mysql_locks  value:COUNTER:0:U
And instead of one file you'd have two:
  .../mysql_locks-immediate.rrd
  .../mysql_locks-waited.rrd

Adding a `timed out' value is now a matter of creating a new RRD file,
which is easy enough (and backwards compatible :). In our naming schema,
the strings `immediate' and `waited' are now ``type instances'', i. e.
the strings are copied to the `type_instance' member of the
`value_list_t' passed to `plugin_dispatch_values'.

Sebastian further suggests to simply check if the key begins with
`Table_locks_' and, if it does, take the remaining string as `type
instance'. For example something like this:
  if (strncmp ("Table_locks_", key, strlen ("Table_locks_")) == 0)
  {
    char *inst = key + strlen ("Table_locks_");
    submit (/* type          = */ "mysql_locks",
            /* type instance = */ inst,
            /* value         = */ value);
  }

Would you be willing to update your patch along these lines?

Best regards,
-octo
-- 
Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
http://verplant.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20090422/7de01a8d/attachment.pgp 


More information about the collectd mailing list