author | Florian Forster <octo@collectd.org> | |
Thu, 20 Jul 2017 07:12:14 +0000 (09:12 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Thu, 20 Jul 2017 07:12:14 +0000 (09:12 +0200) |
Conflicts:
src/rrdtool.c
src/rrdtool.c
1 | 2 | |||
---|---|---|---|---|
src/collectd.conf.pod | patch | | diff1 | | diff2 | | blob | history |
src/rrdtool.c | patch | | diff1 | | diff2 | | blob | history |
diff --cc src/collectd.conf.pod
Simple merge
diff --cc src/rrdtool.c
index 41289058c4e9f4ebe3fe7e6541dd2cf2dc5ebbbe,82f570f4a21edcbffddb685be193dbd08a0fe6d5..2dfa87a0405736654e399d633c6664466f595d30
--- 1/src/rrdtool.c
--- 2/src/rrdtool.c
+++ b/src/rrdtool.c
} /* int rrd_cache_flush_identifier */
static int64_t rrd_get_random_variation(void) {
- long min;
- long max;
-
if (random_timeout == 0)
- return (0);
+ return 0;
- /* Assure that "cache_timeout + random_variation" is never negative. */
- if (random_timeout > cache_timeout) {
- INFO("rrdtool plugin: Adjusting \"RandomTimeout\" to %.3f seconds.",
- CDTIME_T_TO_DOUBLE(cache_timeout));
- random_timeout = cache_timeout;
- }
-
- max = (long)(random_timeout / 2);
- min = max - ((long)random_timeout);
-
- return (int64_t)cdrand_range(min, max);
+ return (int64_t)cdrand_range(-random_timeout, random_timeout);
} /* int64_t rrd_get_random_variation */
static int rrd_cache_insert(const char *filename, const char *value,
"be greater than 0.\n");
ERROR("rrdtool: `CacheFlush' must "
"be greater than 0.\n");
- return (1);
+ return 1;
}
- cache_flush_timeout = tmp;
+ cache_flush_timeout = DOUBLE_TO_CDTIME_T(tmp);
} else if (strcasecmp("DataDir", key) == 0) {
char *tmp;
size_t len;