From: Sebastian Harl Date: Fri, 26 Mar 2010 20:30:17 +0000 (+0100) Subject: postgresql plugin: Use the "right" `interval' when passing a param to a query. X-Git-Tag: collectd-4.10.0~38 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=87cdeb24ec6f02f623c9077e35904c0b7bec4a93;p=collectd.git postgresql plugin: Use the "right" `interval' when passing a param to a query. … i.e., use the database specific interval, if configured. --- diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod index 943a0897..e5782e0f 100644 --- a/src/collectd.conf.pod +++ b/src/collectd.conf.pod @@ -3052,7 +3052,8 @@ The username used to connect to the database. =item I -The interval collectd is using (as specified by the B option). +The interval with which this database is queried (as specified by the database +specific or global B options). =back diff --git a/src/postgresql.c b/src/postgresql.c index 6698e0ee..0141b23e 100644 --- a/src/postgresql.c +++ b/src/postgresql.c @@ -315,7 +315,8 @@ static PGresult *c_psql_exec_query_params (c_psql_database_t *db, params[i] = db->user; break; case C_PSQL_PARAM_INTERVAL: - ssnprintf (interval, sizeof (interval), "%i", interval_g); + ssnprintf (interval, sizeof (interval), "%i", + db->interval > 0 ? db->interval : interval_g); params[i] = interval; break; default: