From a6599f3436e66369934df9cc22b9e66049c9fa14 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Thu, 19 Aug 2010 14:34:21 +0200 Subject: [PATCH] collectd-tg: Improve handling of the interval setting. --- src/collectd-tg.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/collectd-tg.c b/src/collectd-tg.c index c5d7eb0d..4df14ffb 100644 --- a/src/collectd-tg.c +++ b/src/collectd-tg.c @@ -163,8 +163,8 @@ static lcc_value_list_t *create_value_list (void) /* {{{ */ host_num = get_boundet_random (0, conf_num_hosts); - vl->interval = 10; - vl->time = time (NULL) - (host_num % vl->interval); + vl->interval = conf_interval; + vl->time = time (NULL) + (host_num % vl->interval) + 1; if (get_boundet_random (0, 2) == 0) vl->values_types[0] = LCC_TYPE_GAUGE; @@ -364,6 +364,9 @@ int main (int argc, char **argv) /* {{{ */ struct timespec ts = { 0, 10000000 }; nanosleep (&ts, /* remaining = */ NULL); now = time (NULL); + + if (!loop) + break; } last_time = vl->time; } -- 2.11.0