collectd-python-mysql icon indicating copy to clipboard operation
collectd-python-mysql copied to clipboard

Fixing some buggy data handling, add some logging

Open cswingler opened this issue 9 years ago • 3 comments

I'm fixing a few things in this plugin:

  1. Wrapping a bunch of the SHOW ENGINE INNODB STATUS; parsing code in try/except blocks. This change is a little on the blind side - we were seeing the plugin get unloaded with this in the collectd logs:
    [2016-12-19 10:33:41] mysql plugin: Sending value: response_time_count/13=0
    [2016-12-19 10:33:41] Unhandled python exception in read callback: ValueError: invalid literal for int() with base 10: 'ROLLING'
    [2016-12-19 10:33:41] read-function of plugin `python.mysql' failed. Will suspend it for 60.000 seconds.
    

The output from SHOW ENGINE INNODB STATUS; is a bit unpredictable and difficult to parse, so I'm making the assumption that defensive coding here is the way to go. 2. not 0 == True, so not value will drop any values that are 0 on the floor. Check that value is not 0 before doing that return. 3. Add a little more useful verbose logging.

cswingler avatar Dec 19 '16 17:12 cswingler

Would love to see this merged.

winmutt avatar Mar 14 '17 15:03 winmutt

@cswingler: would you mind addressing the conflicts in this and we'll get it down? If you don't have the time, I can take a stab.

chrisboulton avatar Apr 11 '17 17:04 chrisboulton

finally got around to doing this :)

cswingler avatar Jul 26 '17 19:07 cswingler