From: Sebastian Harl Date: Fri, 17 Jun 2011 12:04:07 +0000 (+0200) Subject: examples/myplugin.c: Updated to new interface (per-plugin intervals). X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6c71ad1c71beff4f252ade7b1b6b56841391d938;p=collectd.git examples/myplugin.c: Updated to new interface (per-plugin intervals). --- diff --git a/contrib/examples/myplugin.c b/contrib/examples/myplugin.c index f68cc1ac..fc63a5c8 100644 --- a/contrib/examples/myplugin.c +++ b/contrib/examples/myplugin.c @@ -90,7 +90,7 @@ static int my_read (void) { value_t values[1]; /* the size of this list should equal the number of data sources */ - value_list_t vl = VALUE_LIST_INIT; + value_list_t vl = VALUE_LIST_INIT (plugin_interval); /* do the magic to read the data */ values[0].gauge = random (); @@ -208,12 +208,14 @@ static int my_shutdown (void) * This function is called after loading the plugin to register it with * collectd. */ -void module_register (void) +void module_register (plugin_loaddata_t *data) { + PLUGIN_INIT_INTERVAL (data); + plugin_register_log ("myplugin", my_log); plugin_register_notification ("myplugin", my_notify); plugin_register_data_set (&ds); - plugin_register_read ("myplugin", my_read); + plugin_register_read ("myplugin", my_read, plugin_interval); plugin_register_init ("myplugin", my_init); plugin_register_write ("myplugin", my_write); plugin_register_shutdown ("myplugin", my_shutdown);