aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/rrd.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-09-21 17:33:26 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-09-21 17:33:26 +0100
commit989ccca1111fc9bdd38bb0b2b28c4dc5d6acd2c1 (patch)
tree08de6f6174d00ead88ef747cc42f141d730168cd /src/libutil/rrd.h
parent07815f232975a0d7d431805cea618276c47d275d (diff)
downloadrspamd-989ccca1111fc9bdd38bb0b2b28c4dc5d6acd2c1.tar.gz
rspamd-989ccca1111fc9bdd38bb0b2b28c4dc5d6acd2c1.zip
Add rra extraction function.
Diffstat (limited to 'src/libutil/rrd.h')
-rw-r--r--src/libutil/rrd.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/libutil/rrd.h b/src/libutil/rrd.h
index 189ea479a..7305b35df 100644
--- a/src/libutil/rrd.h
+++ b/src/libutil/rrd.h
@@ -335,4 +335,24 @@ void rrd_make_default_ds (const gchar *name,
*/
struct rspamd_rrd_file *rspamd_rrd_file_default (const gchar *path,
GError **err);
+
+/**
+ * Returned by querying rrd database
+ */
+struct rspamd_rrd_query_result {
+ gulong rra_rows;
+ gulong pdp_per_cdp;
+ gulong ds_count;
+ gdouble last_update;
+ const gdouble *data;
+};
+
+/**
+ * Return RRA data
+ * @param file rrd file
+ * @param rra_num number of rra to return data for
+ * @return query result structure, that should be freed (using g_slice_free1) after usage
+ */
+struct rspamd_rrd_query_result * rspamd_rrd_query (struct rspamd_rrd_file *file,
+ gulong rra_num);
#endif /* RRD_H_ */