From 87cdeb24ec6f02f623c9077e35904c0b7bec4a93 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Fri, 26 Mar 2010 21:30:17 +0100 Subject: [PATCH] postgresql plugin: Use the "right" `interval' when passing a param to a query. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit … i.e., use the database specific interval, if configured. --- src/collectd.conf.pod | 3 ++- src/postgresql.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) 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: -- 2.30.2