author | Sebastian Harl <sh@tokkee.org> | |
Thu, 2 Feb 2012 06:44:48 +0000 (07:44 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Fri, 3 Feb 2012 14:04:30 +0000 (15:04 +0100) | ||
commit | bdbde949ad0bd244574efcec596675e1ef889c43 | |
tree | d6a23b003a8ad6eaabe9c2ed1a7eb62bfefe7b0d | tree | snapshot |
parent | f394c087e9b022cde2c946f4f83cb21933e57a67 | commit | diff |
plugin: Introduced basic support for per-plugin intervals.
This is based on a newly introduced "plugin context", which stores plugin-
related settings (currently the plugin interval) for each registered callback.
The context is initialized when loading the plugin (LoadPlugin), setting the
interval to the value of the newly introduced "Interval" option of the
LoadPlugin block, if specified.
The context is set (using thread-specific data) and restored before and after
calling any callback.
This way, single plugins don't need to take special care in order to benefit
from the new feature. plugin.c will handle (most) situations automatically.
VALUE_LIST_INIT() has been changed to honor the plugin interval settings (if
any). As a helper, the new 'plugin_interval' macro may be used to access the
current plugin's interval (read-only).
Thanks to Florian for the initial idea!
This is based on a newly introduced "plugin context", which stores plugin-
related settings (currently the plugin interval) for each registered callback.
The context is initialized when loading the plugin (LoadPlugin), setting the
interval to the value of the newly introduced "Interval" option of the
LoadPlugin block, if specified.
The context is set (using thread-specific data) and restored before and after
calling any callback.
This way, single plugins don't need to take special care in order to benefit
from the new feature. plugin.c will handle (most) situations automatically.
VALUE_LIST_INIT() has been changed to honor the plugin interval settings (if
any). As a helper, the new 'plugin_interval' macro may be used to access the
current plugin's interval (read-only).
Thanks to Florian for the initial idea!
src/collectd.c | diff | blob | history | |
src/configfile.c | diff | blob | history | |
src/configfile.h | diff | blob | history | |
src/plugin.c | diff | blob | history | |
src/plugin.h | diff | blob | history |