diff options
Diffstat (limited to 'database/ram/rrddim_mem.h')
-rw-r--r-- | database/ram/rrddim_mem.h | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/database/ram/rrddim_mem.h b/database/ram/rrddim_mem.h index 9a215387a..400bdd0c2 100644 --- a/database/ram/rrddim_mem.h +++ b/database/ram/rrddim_mem.h @@ -6,24 +6,38 @@ #include "database/rrd.h" struct mem_collect_handle { + RRDDIM *rd; long slot; long entries; }; + struct mem_query_handle { - long slot; - long last_slot; - uint8_t finished; + time_t dt; + time_t next_timestamp; + time_t last_timestamp; + time_t slot_timestamp; + size_t slot; + size_t last_slot; }; -extern void rrddim_collect_init(RRDDIM *rd); -extern void rrddim_collect_store_metric(RRDDIM *rd, usec_t point_in_time, storage_number number); -extern int rrddim_collect_finalize(RRDDIM *rd); +extern STORAGE_METRIC_HANDLE *rrddim_metric_init(RRDDIM *rd, STORAGE_INSTANCE *db_instance); +extern void rrddim_metric_free(STORAGE_METRIC_HANDLE *db_metric_handle); + +extern STORAGE_COLLECT_HANDLE *rrddim_collect_init(STORAGE_METRIC_HANDLE *db_metric_handle); +extern void rrddim_collect_store_metric(STORAGE_COLLECT_HANDLE *collection_handle, usec_t point_in_time, NETDATA_DOUBLE number, + NETDATA_DOUBLE min_value, + NETDATA_DOUBLE max_value, + uint16_t count, + uint16_t anomaly_count, + SN_FLAGS flags); +extern void rrddim_store_metric_flush(STORAGE_COLLECT_HANDLE *collection_handle); +extern int rrddim_collect_finalize(STORAGE_COLLECT_HANDLE *collection_handle); -extern void rrddim_query_init(RRDDIM *rd, struct rrddim_query_handle *handle, time_t start_time, time_t end_time); -extern storage_number rrddim_query_next_metric(struct rrddim_query_handle *handle, time_t *current_time); +extern void rrddim_query_init(STORAGE_METRIC_HANDLE *db_metric_handle, struct rrddim_query_handle *handle, time_t start_time, time_t end_time, TIER_QUERY_FETCH tier_query_fetch_type); +extern STORAGE_POINT rrddim_query_next_metric(struct rrddim_query_handle *handle); extern int rrddim_query_is_finished(struct rrddim_query_handle *handle); extern void rrddim_query_finalize(struct rrddim_query_handle *handle); -extern time_t rrddim_query_latest_time(RRDDIM *rd); -extern time_t rrddim_query_oldest_time(RRDDIM *rd); +extern time_t rrddim_query_latest_time(STORAGE_METRIC_HANDLE *db_metric_handle); +extern time_t rrddim_query_oldest_time(STORAGE_METRIC_HANDLE *db_metric_handle); #endif |