From: Florian Forster Date: Fri, 17 Jul 2020 11:10:26 +0000 (+0200) Subject: format_json: s/metric_t/metric_single_t/ X-Git-Tag: 6.0.0-rc0~144^2~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42a1845a910662b40fa1454c7a6ff42f972d11bf;p=thirdparty%2Fcollectd.git format_json: s/metric_t/metric_single_t/ --- diff --git a/src/utils/format_json/format_json.c b/src/utils/format_json/format_json.c index e9028af86..8741cc31a 100644 --- a/src/utils/format_json/format_json.c +++ b/src/utils/format_json/format_json.c @@ -545,7 +545,7 @@ static int format_time(yajl_gen g, cdtime_t t) /* {{{ */ /* TODO(octo): format_metric should export the interval, too. */ /* TODO(octo): Decide whether format_metric should export meta data. */ -static int format_metric(yajl_gen g, metric_t const *m) { +static int format_metric(yajl_gen g, metric_single_t const *m) { CHECK_SUCCESS(yajl_gen_map_open(g)); /* BEGIN metric */ if (c_avl_size(m->identity->labels) != 0) { @@ -588,7 +588,7 @@ static int format_metric(yajl_gen g, metric_t const *m) { static int format_metrics_list(yajl_gen g, metrics_list_t const *ml) { CHECK_SUCCESS(yajl_gen_map_open(g)); /* BEGIN metric family */ - metric_t const *m = &ml->metric; + metric_single_t const *m = &ml->metric; JSON_ADD(g, "name"); JSON_ADD(g, m->identity->name); @@ -625,7 +625,8 @@ static int format_metrics_list(yajl_gen g, metrics_list_t const *ml) { return 0; } -int format_json_metric(strbuf_t *buf, metric_t const *m, bool store_rates) { +int format_json_metric(strbuf_t *buf, metric_single_t const *m, + bool store_rates) { if ((buf == NULL) || (m == NULL)) return EINVAL; diff --git a/src/utils/format_json/format_json.h b/src/utils/format_json/format_json.h index 02214609a..4d1c6c05f 100644 --- a/src/utils/format_json/format_json.h +++ b/src/utils/format_json/format_json.h @@ -46,7 +46,8 @@ int format_json_finalize(char *buffer, size_t *ret_buffer_fill, /* format_json_metric writes m to buf in JSON format. The format produces is * compatible to the "prometheus/prom2json" project. */ -int format_json_metric(strbuf_t *buf, metric_t const *m, bool store_rates); +int format_json_metric(strbuf_t *buf, metric_single_t const *m, + bool store_rates); int format_json_notification(char *buffer, size_t buffer_size, notification_t const *n); diff --git a/src/utils/format_json/format_json_test.c b/src/utils/format_json/format_json_test.c index c36963451..3185b725e 100644 --- a/src/utils/format_json/format_json_test.c +++ b/src/utils/format_json/format_json_test.c @@ -235,7 +235,7 @@ DEF_TEST(metric) { identity_t *id; CHECK_NOT_NULL(id = identity_unmarshal_text(cases[i].identity)); - metric_t m = { + metric_single_t m = { .identity = id, .value = cases[i].value, .value_type = cases[i].value_type,