]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
Deleted already unneccessary functions distribution_marshal_count, distribution_marsh...
authorelene-margalit <elene.margalit@gmail.com>
Wed, 9 Sep 2020 22:15:20 +0000 (00:15 +0200)
committerelene-margalit <elene.margalit@gmail.com>
Wed, 9 Sep 2020 22:15:20 +0000 (00:15 +0200)
src/daemon/metric.c
src/daemon/metric.h

index b132f01df9200499f736ff4285945824c1722408..2042b4b8377957b098d0a7cb59b46fe7686a7d3f 100644 (file)
@@ -23,7 +23,6 @@
  * Authors:
  *   Florian octo Forster <octo at collectd.org>
  *   Manoj Srivastava <srivasta at google.com>
- *   Elene Margalitadze <elene.margalit at gmail.com>
  **/
 
 #include "collectd.h"
 /* Metric names must match the regex `[a-zA-Z_:][a-zA-Z0-9_:]*` */
 #define VALID_NAME_CHARS VALID_LABEL_CHARS ":"
 
-int distribution_count_marshal_text(strbuf_t *buf, distribution_t *dist) {
-  return strbuf_printf(buf, "%" PRIu64, distribution_total_counter(dist));
-}
-
-int distribution_sum_marshal_text(strbuf_t *buf, distribution_t *dist) {
-  return strbuf_printf(buf, GAUGE_FORMAT, distribution_total_sum(dist));
-}
-
 int value_marshal_text(strbuf_t *buf, value_t v, metric_type_t type) {
   switch (type) {
   case METRIC_TYPE_GAUGE:
@@ -58,6 +49,9 @@ int value_marshal_text(strbuf_t *buf, value_t v, metric_type_t type) {
     return strbuf_printf(buf, GAUGE_FORMAT, v.gauge);
   case METRIC_TYPE_COUNTER:
     return strbuf_printf(buf, "%" PRIu64, v.counter);
+  case METRIC_TYPE_DISTRIBUTION:
+    ERROR("Distribution metrics are not to be represented as text.");
+    return EINVAL;
   default:
     ERROR("Unknown metric value type: %d", (int)type);
     return EINVAL;
index 3167cd9b014bc4f96febb2ab1c1be92735b7ae65..e0366a215b7b8c7944bc01b57fdca83282a76b1b 100644 (file)
@@ -59,18 +59,6 @@ typedef union value_u value_t;
 /* value_marshal_text prints a text representation of v to buf. */
 int value_marshal_text(strbuf_t *buf, value_t v, metric_type_t type);
 
-/*distribution_marshal_text prints a text representation of a distribution
- * metric to buf.*/
-int distribution_marshal_text(strbuf_t *buf, distribution_t *dist);
-
-/*distribution_marshal_text prints the total count of gauges registered in a
- * distribution metric to buf.*/
-int distribution_count_marshal_text(strbuf_t *buf, distribution_t *dist);
-
-/*distribution_marshal_text prints the sum of all gauges registered in a
- * distribution metric to buf.*/
-int distribution_sum_marshal_text(strbuf_t *buf, distribution_t *dist);
-
 /*
  * Labels
  */