struct aggregation_s /* {{{ */
{
- identifier_t ident;
+ lookup_identifier_t ident;
unsigned int group_by;
unsigned int regex_fields;
struct agg_instance_s /* {{{ */
{
pthread_mutex_t lock;
- identifier_t ident;
+ lookup_identifier_t ident;
int ds_type;
/*
* Public data types
*/
+struct identifier_s
+{
+ char *host;
+ char *plugin;
+ char *plugin_instance;
+ char *type;
+ char *type_instance;
+};
+typedef struct identifier_s identifier_t;
+
typedef unsigned long long counter_t;
typedef double gauge_t;
typedef int64_t derive_t;
struct user_obj_s
{
void *user_obj;
- identifier_t ident;
+ lookup_identifier_t ident;
user_obj_t *next;
};
} /* }}} int lu_copy_ident_to_match_part */
static int lu_copy_ident_to_match (identifier_match_t *match, /* {{{ */
- identifier_t const *ident, unsigned int group_by)
+ lookup_identifier_t const *ident, unsigned int group_by)
{
memset (match, 0, sizeof (*match));
} /* }}} void lookup_destroy */
int lookup_add (lookup_t *obj, /* {{{ */
- identifier_t const *ident, unsigned int group_by, void *user_class)
+ lookup_identifier_t const *ident, unsigned int group_by, void *user_class)
{
by_type_entry_t *by_type = NULL;
user_class_list_t *user_class_obj;
* freed. */
typedef void (*lookup_free_obj_callback_t) (void *user_obj);
-struct identifier_s
+struct lookup_identifier_s
{
char host[DATA_MAX_NAME_LEN];
char plugin[DATA_MAX_NAME_LEN];
char type[DATA_MAX_NAME_LEN];
char type_instance[DATA_MAX_NAME_LEN];
};
-typedef struct identifier_s identifier_t;
+typedef struct lookup_identifier_s lookup_identifier_t;
#define LU_GROUP_BY_HOST 0x01
#define LU_GROUP_BY_PLUGIN 0x02
void lookup_destroy (lookup_t *obj);
int lookup_add (lookup_t *obj,
- identifier_t const *ident, unsigned int group_by, void *user_class);
+ lookup_identifier_t const *ident, unsigned int group_by, void *user_class);
/* TODO(octo): Pass lookup_obj_callback_t to lookup_search()? */
int lookup_search (lookup_t *obj,
static _Bool expect_new_obj = 0;
static _Bool have_new_obj = 0;
-static identifier_t last_class_ident;
-static identifier_t last_obj_ident;
+static lookup_identifier_t last_class_ident;
+static lookup_identifier_t last_obj_ident;
static data_source_t dsrc_test = { "value", DS_TYPE_DERIVE, 0.0, NAN };
static data_set_t const ds_test = { "test", 1, &dsrc_test };
value_list_t const *vl,
void *user_class, void *user_obj)
{
- identifier_t *class = user_class;
- identifier_t *obj = user_obj;
+ lookup_identifier_t *class = user_class;
+ lookup_identifier_t *obj = user_obj;
OK1(expect_new_obj == have_new_obj,
(expect_new_obj ? "New obj is created." : "Updating existing obj."));
static void *lookup_class_callback (data_set_t const *ds,
value_list_t const *vl, void *user_class)
{
- identifier_t *class = user_class;
- identifier_t *obj;
+ lookup_identifier_t *class = user_class;
+ lookup_identifier_t *obj;
assert (expect_new_obj);
char const *type, char const *type_instance,
unsigned int group_by)
{
- identifier_t ident;
+ lookup_identifier_t ident;
void *user_class;
strncpy (ident.host, host, sizeof (ident.host));