From 6c71ad1c71beff4f252ade7b1b6b56841391d938 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Fri, 17 Jun 2011 14:04:07 +0200 Subject: [PATCH] examples/myplugin.c: Updated to new interface (per-plugin intervals). --- contrib/examples/myplugin.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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); -- 2.30.2