]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
src/daemon/metric.[ch]: Improve doc comments. 3508/head
authorFlorian Forster <octo@google.com>
Mon, 20 Jul 2020 19:30:05 +0000 (21:30 +0200)
committerFlorian Forster <octo@google.com>
Tue, 21 Jul 2020 15:30:10 +0000 (17:30 +0200)
src/daemon/metric.c
src/daemon/metric.h

index 60625a9f0157905bfcebe029b1f1d5be3bad7ea3..16052be6117762e2a703c9284acb71ddf281c817 100644 (file)
@@ -50,7 +50,7 @@ int value_marshal_text(strbuf_t *buf, value_t v, metric_type_t type) {
   case METRIC_TYPE_COUNTER:
     return strbuf_printf(buf, "%" PRIu64, v.counter);
   default:
-    ERROR("Unknown metric value type: %d", type);
+    ERROR("Unknown metric value type: %d", (int)type);
     return EINVAL;
   }
 }
index f849a3703e4b2434f2996ffc63ff2b05bf3ec55a..0419304ede8e227e80b9a11874b7629a82ba2694 100644 (file)
@@ -90,7 +90,7 @@ typedef struct metric_family_s metric_family_t;
 
 /* metric_t is a metric inside a metric family. */
 typedef struct {
-  metric_family_t *family; /* for family->name and family->type */
+  metric_family_t *family; /* backreference for family->name and family->type */
 
   label_set_t label;
   value_t value;
@@ -100,9 +100,10 @@ typedef struct {
   meta_data_t *meta;
 } metric_t;
 
-/* metric_identity writes the identity of the metric "m" to "buf". An example
- * string is:
+/* metric_identity writes the identity of the metric "m" to "buf", using the
+ * OpenMetrics / Prometheus plain text exposition format.
  *
+ * Example:
  *   "http_requests_total{method=\"post\",code=\"200\"}"
  */
 int metric_identity(strbuf_t *buf, metric_t const *m);