Code

core: Changed internal API to allow for per-plugin intervals.
[collectd.git] / src / network.c
index 38534264e2bb5ff18cd1f472aa259e907d4aa8e6..1d6708d5f54d65ca583a4181ed3bc74c8dfb60b9 100644 (file)
@@ -1272,7 +1272,7 @@ static int parse_packet (sockent_t *se, /* {{{ */
 {
        int status;
 
-       value_list_t vl = VALUE_LIST_INIT;
+       value_list_t vl = VALUE_LIST_INIT (/* default interval = */ 0);
        notification_t n;
 
 #if HAVE_LIBGCRYPT
@@ -3208,7 +3208,7 @@ static int network_stats_read (void) /* {{{ */
        derive_t copy_values_sent;
        derive_t copy_values_not_sent;
        derive_t copy_receive_list_length;
-       value_list_t vl = VALUE_LIST_INIT;
+       value_list_t vl = VALUE_LIST_INIT (plugin_interval);
        value_t values[2];
 
        copy_octets_rx = stats_octets_rx;
@@ -3291,7 +3291,7 @@ static int network_init (void)
 #endif
 
        if (network_config_stats != 0)
-               plugin_register_read ("network", network_stats_read);
+               plugin_register_read ("network", network_stats_read, plugin_interval);
 
        plugin_register_shutdown ("network", network_shutdown);
 
@@ -3382,8 +3382,9 @@ static int network_flush (__attribute__((unused)) cdtime_t timeout,
        return (0);
 } /* int network_flush */
 
-void module_register (void)
+void module_register (plugin_loaddata_t *data)
 {
+       PLUGIN_INIT_INTERVAL (data);
        plugin_register_complex_config ("network", network_config);
        plugin_register_init   ("network", network_init);
        plugin_register_flush   ("network", network_flush,