diff options
Diffstat (limited to 'database/rrdvar.h')
-rw-r--r-- | database/rrdvar.h | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/database/rrdvar.h b/database/rrdvar.h index 9074edcdb1..4ea367dbb7 100644 --- a/database/rrdvar.h +++ b/database/rrdvar.h @@ -5,8 +5,6 @@ #include "libnetdata/libnetdata.h" -extern int rrdvar_compare(void *a, void *b); - typedef enum rrdvar_type { RRDVAR_TYPE_CALCULATED = 1, RRDVAR_TYPE_TIME_T = 2, @@ -32,35 +30,34 @@ typedef enum rrdvar_options { // 2. at each context (RRDFAMILY.rrdvar_root_index) // 3. at each host (RRDHOST.rrdvar_root_index) struct rrdvar { - avl_t avl; - - char *name; - uint32_t hash; - - RRDVAR_TYPE type; - RRDVAR_OPTIONS options; + STRING *name; void *value; - time_t last_updated; + + RRDVAR_OPTIONS options:16; + RRDVAR_TYPE type:8; }; +#define rrdvar_name(rv) string2str((rv)->name) + #define RRDVAR_MAX_LENGTH 1024 extern int rrdvar_fix_name(char *variable); #include "rrd.h" +extern STRING *rrdvar_name_to_string(const char *name); + extern RRDVAR *rrdvar_custom_host_variable_create(RRDHOST *host, const char *name); extern void rrdvar_custom_host_variable_set(RRDHOST *host, RRDVAR *rv, NETDATA_DOUBLE value); -extern int foreach_host_variable_callback(RRDHOST *host, int (*callback)(RRDVAR *rv, void *data), void *data); -extern void rrdvar_free_remaining_variables(RRDHOST *host, avl_tree_lock *tree_lock); +extern void rrdvar_free_remaining_variables(RRDHOST *host, DICTIONARY *dict); -extern int rrdvar_callback_for_all_host_variables(RRDHOST *host, int (*callback)(void *rrdvar, void *data), void *data); +extern int rrdvar_walkthrough_read(DICTIONARY *dict, int (*callback)(const char *name, void *rrdvar, void *data), void *data); extern NETDATA_DOUBLE rrdvar2number(RRDVAR *rv); -extern RRDVAR *rrdvar_create_and_index(const char *scope, avl_tree_lock *tree, const char *name, RRDVAR_TYPE type, RRDVAR_OPTIONS options, void *value); -extern void rrdvar_free(RRDHOST *host, avl_tree_lock *tree, RRDVAR *rv); +extern RRDVAR *rrdvar_create_and_index(const char *scope, DICTIONARY *dict, STRING *name, RRDVAR_TYPE type, RRDVAR_OPTIONS options, void *value); +extern void rrdvar_free(RRDHOST *host, DICTIONARY *dict, RRDVAR *rv); #endif //NETDATA_RRDVAR_H |