// Interval after which the heartbeat function is being called again
#define HEARTBEAT (STEPSIZE * 1000000) // usecs
+// XXX We need to check whether it is a good idea to hardcode this here
+#define XFF 0.1
+
+// Define some default RRAs
+static const collecty_rrd_rra default_rras[] = {
+ // Keep AVERAGE/MIN/MAX with a one minute resolution for two weeks
+ { "AVERAGE", "1m", "14d", },
+ { "MIN", "1m", "14d", },
+ { "MAX", "1m", "14d", },
+
+ // After that, keep a one hour resolution for the next 18 months
+ { "AVERAGE", "1h", "18M", },
+ { "MIN", "1h", "18M", },
+ { "MAX", "1h", "18M", },
+
+ // Finally, keep a one day resolution for ten years
+ { "AVERAGE", "1d", "10y", },
+ { "MIN", "1d", "10y", },
+ { "MAX", "1d", "10y", },
+
+ { NULL },
+};
+
struct collecty_module {
collecty_ctx* ctx;
int nrefs;
goto ERROR;
}
+ // Add all default round-robin archives
+ for (const collecty_rrd_rra* rra = default_rras; rra->type; rra++) {
+ r = collecty_args_push(args, "RRA:%s:%.2f:%s:%s", rra->type, XFF, rra->steps, rra->rows);
+ if (r < 0)
+ goto ERROR;
+ }
+
+ // Add all custom round-robin archives
+ for (const collecty_rrd_rra* rra = self->methods->rrd_rras; rra->type; rra++) {
+ r = collecty_args_push(args, "RRA:%s:%.2f:%s:%s", rra->type, XFF, rra->steps, rra->rows);
+ if (r < 0)
+ goto ERROR;
+ }
+
// Dump all arguments
r = collecty_args_dump(args);
if (r < 0)