adapt fieldstat_easy: rename 'fieldstat_tag' to 'field'
This commit is contained in:
@@ -120,10 +120,10 @@ struct sf_metrics *sf_metrics_create(const char *profile, struct kafka *kfk)
|
|||||||
MESA_load_profile_string_def(profile, "metrics", "device_group", handle->cfg.device_group, sizeof(handle->cfg.device_group), "");
|
MESA_load_profile_string_def(profile, "metrics", "device_group", handle->cfg.device_group, sizeof(handle->cfg.device_group), "");
|
||||||
MESA_load_profile_string_def(profile, "metrics", "device_id", handle->cfg.device_id, sizeof(handle->cfg.device_id), "");
|
MESA_load_profile_string_def(profile, "metrics", "device_id", handle->cfg.device_id, sizeof(handle->cfg.device_id), "");
|
||||||
|
|
||||||
const struct fieldstat_tag tags[] = {
|
const struct field tags[] = {
|
||||||
{"data_center", TAG_CSTRING, {.value_str = handle->cfg.data_center}},
|
{"data_center", FIELD_VALUE_CSTRING, {.value_str = handle->cfg.data_center}},
|
||||||
{"device_group", TAG_CSTRING, {.value_str = handle->cfg.device_group}},
|
{"device_group", FIELD_VALUE_CSTRING, {.value_str = handle->cfg.device_group}},
|
||||||
{"device_id", TAG_CSTRING, {.value_str = handle->cfg.device_id}},
|
{"device_id", FIELD_VALUE_CSTRING, {.value_str = handle->cfg.device_id}},
|
||||||
};
|
};
|
||||||
|
|
||||||
handle->kfk = kfk;
|
handle->kfk = kfk;
|
||||||
@@ -262,11 +262,11 @@ void sf_metrics_output(struct sf_metrics *handle, uint16_t thr_idx)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct fieldstat_tag tags[] = {
|
const struct field tags[] = {
|
||||||
{"vsys_id", TAG_INTEGER, {.value_longlong = node->key.vsys_id}},
|
{"vsys_id", FIELD_VALUE_INTEGER, {.value_longlong = node->key.vsys_id}},
|
||||||
{"rule_id", TAG_INTEGER, {.value_longlong = (long long)node->key.rule_id}},
|
{"rule_id", FIELD_VALUE_INTEGER, {.value_longlong = (long long)node->key.rule_id}},
|
||||||
{"sff_profile_id", TAG_INTEGER, {.value_longlong = node->key.sff_profile_id}},
|
{"sff_profile_id", FIELD_VALUE_INTEGER, {.value_longlong = node->key.sff_profile_id}},
|
||||||
{"sf_profile_id", TAG_INTEGER, {.value_longlong = node->key.sf_profile_id}},
|
{"sf_profile_id", FIELD_VALUE_INTEGER, {.value_longlong = node->key.sf_profile_id}},
|
||||||
};
|
};
|
||||||
|
|
||||||
fieldstat_easy_counter_incrby(handle->fs, thr_idx, handle->sent_pkts_idx, tags, sizeof(tags) / sizeof(tags[0]), node->sent_pkts);
|
fieldstat_easy_counter_incrby(handle->fs, thr_idx, handle->sent_pkts_idx, tags, sizeof(tags) / sizeof(tags[0]), node->sent_pkts);
|
||||||
|
|||||||
@@ -58,10 +58,10 @@ struct sf_status *sf_status_create(const char *profile, struct kafka *kfk)
|
|||||||
MESA_load_profile_string_def(profile, "metrics", "device_group", handle->cfg.device_group, sizeof(handle->cfg.device_group), "");
|
MESA_load_profile_string_def(profile, "metrics", "device_group", handle->cfg.device_group, sizeof(handle->cfg.device_group), "");
|
||||||
MESA_load_profile_string_def(profile, "metrics", "device_id", handle->cfg.device_id, sizeof(handle->cfg.device_id), "");
|
MESA_load_profile_string_def(profile, "metrics", "device_id", handle->cfg.device_id, sizeof(handle->cfg.device_id), "");
|
||||||
|
|
||||||
const struct fieldstat_tag tags[] = {
|
const struct field tags[] = {
|
||||||
{"data_center", TAG_CSTRING, {.value_str = handle->cfg.data_center}},
|
{"data_center", FIELD_VALUE_CSTRING, {.value_str = handle->cfg.data_center}},
|
||||||
{"device_group", TAG_CSTRING, {.value_str = handle->cfg.device_group}},
|
{"device_group", FIELD_VALUE_CSTRING, {.value_str = handle->cfg.device_group}},
|
||||||
{"device_id", TAG_CSTRING, {.value_str = handle->cfg.device_id}},
|
{"device_id", FIELD_VALUE_CSTRING, {.value_str = handle->cfg.device_id}},
|
||||||
};
|
};
|
||||||
|
|
||||||
handle->kfk = kfk;
|
handle->kfk = kfk;
|
||||||
@@ -158,9 +158,9 @@ void sf_status_output(struct sf_status *handle)
|
|||||||
struct metric *node = NULL;
|
struct metric *node = NULL;
|
||||||
HASH_ITER(hh, handle->htable, node, temp)
|
HASH_ITER(hh, handle->htable, node, temp)
|
||||||
{
|
{
|
||||||
const struct fieldstat_tag tags[] = {
|
const struct field tags[] = {
|
||||||
{"vsys_id", TAG_INTEGER, {.value_longlong = node->key.vsys_id}},
|
{"vsys_id", FIELD_VALUE_INTEGER, {.value_longlong = node->key.vsys_id}},
|
||||||
{"sf_profile_id", TAG_INTEGER, {.value_longlong = node->key.sf_profile_id}},
|
{"sf_profile_id", FIELD_VALUE_INTEGER, {.value_longlong = node->key.sf_profile_id}},
|
||||||
};
|
};
|
||||||
|
|
||||||
fieldstat_easy_counter_set(handle->fs, 0, handle->sf_status_idx, tags, sizeof(tags) / sizeof(tags[0]), node->sf_status);
|
fieldstat_easy_counter_set(handle->fs, 0, handle->sf_status_idx, tags, sizeof(tags) / sizeof(tags[0]), node->sf_status);
|
||||||
|
|||||||
Reference in New Issue
Block a user