]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
format_json: s/metric_t/metric_single_t/
authorFlorian Forster <octo@google.com>
Fri, 17 Jul 2020 11:10:26 +0000 (13:10 +0200)
committerFlorian Forster <octo@google.com>
Wed, 29 Jul 2020 11:40:03 +0000 (13:40 +0200)
src/utils/format_json/format_json.c
src/utils/format_json/format_json.h
src/utils/format_json/format_json_test.c

index e9028af86ceb7e02748f7ebf7848626ebcda9fde..8741cc31aeb824a04d5362ce41f6d450697ffbdf 100644 (file)
@@ -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;
 
index 02214609a3d2e489c17bd1b88b310f9190b2e17a..4d1c6c05f2945782c36609b7620c81dcf5ac7d67 100644 (file)
@@ -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);
index c36963451792f566d411433019c3aac3c06957d3..3185b725e9419cc5f7e741d00d4eeb3dd354a524 100644 (file)
@@ -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,