From: Florian Forster Date: Thu, 19 Aug 2010 12:34:21 +0000 (+0200) Subject: collectd-tg: Improve handling of the interval setting. X-Git-Tag: collectd-5.2.0~18^2~3 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=a6599f3436e66369934df9cc22b9e66049c9fa14;p=collectd.git collectd-tg: Improve handling of the interval setting. --- 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; }