collectd-python-mysql
collectd-python-mysql copied to clipboard
Fixing some buggy data handling, add some logging
I'm fixing a few things in this plugin:
- Wrapping a bunch of the
SHOW ENGINE INNODB STATUS;parsing code intry/exceptblocks. 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.
Would love to see this merged.
@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.
finally got around to doing this :)