From 6eee9bc367946ada5b0596c6029a096ea5332a9f Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Sun, 23 Nov 2014 16:56:08 +0100 Subject: [PATCH] timeseries::rrdtool: Limit to 1000 data-points for now. That's good enough for most use cases (ought to be enough for anybody!) and avoids excessive memory use when requesting data. --- src/plugins/timeseries/rrdtool.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/timeseries/rrdtool.c b/src/plugins/timeseries/rrdtool.c index db24903..8ea734f 100644 --- a/src/plugins/timeseries/rrdtool.c +++ b/src/plugins/timeseries/rrdtool.c @@ -106,6 +106,10 @@ sdb_rrd_fetch(const char *id, sdb_timeseries_opts_t *opts, rrd_freemem(data); \ } while (0) + /* limit to about 1000 data-points for now + * TODO: make this configurable */ + step = (end - start) / 1000; + if (rrd_fetch_r(id, "AVERAGE", &start, &end, &step, &ds_cnt, &ds_namv, &data)) { char errbuf[1024]; -- 2.30.2