Code

Include strings.h instead of defining _BSD_SOURCE to get strcasecmp.
[sysdb.git] / src / plugins / timeseries / rrdtool.c
index db24903f5513785852a22748f05de88b1a4b0f91..73f22afade0744de1460ae563dacb1fedb20ca95 100644 (file)
@@ -37,6 +37,8 @@
 
 #include <errno.h>
 #include <stdlib.h>
+#include <string.h>
+#include <strings.h>
 #include <rrd.h>
 #ifdef HAVE_RRD_CLIENT_H
 #      include <rrd_client.h>
@@ -47,7 +49,7 @@ SDB_PLUGIN_MAGIC;
 /* Current versions of RRDtool do not support multiple RRDCacheD client
  * connections. Use this to guard against multiple configured RRDCacheD
  * instances. */
-static _Bool rrdcached_in_use = 0;
+static bool rrdcached_in_use = 0;
 
 /*
  * plugin API
@@ -106,6 +108,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];