Code

core: Changed internal API to allow for per-plugin intervals.
[collectd.git] / src / postgresql.c
index a8812e2158327bf86153689894e8eada7e620022..0bb5653423075286bb58d8f028cf562dd674c91f 100644 (file)
@@ -680,6 +680,8 @@ static int c_psql_config_database (oconfig_item_t *ci)
 
        ssnprintf (cb_name, sizeof (cb_name), "postgresql-%s", db->database);
 
+       if (db->interval <= 0)
+               db->interval = plugin_interval;
        CDTIME_T_TO_TIMESPEC (db->interval, &cb_interval);
 
        plugin_register_complex_read ("postgresql", cb_name, c_psql_read,
@@ -724,8 +726,9 @@ static int c_psql_config (oconfig_item_t *ci)
        return 0;
 } /* c_psql_config */
 
-void module_register (void)
+void module_register (plugin_loaddata_t *data)
 {
+       PLUGIN_INIT_INTERVAL (data);
        plugin_register_complex_config ("postgresql", c_psql_config);
        plugin_register_shutdown ("postgresql", c_psql_shutdown);
 } /* module_register */