]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
Revert "Integrate distribution metrics into collectd core: add new distribution_t... 3525/head
authorElene Margalitadze <68648605+elene-margalit@users.noreply.github.com>
Mon, 17 Aug 2020 15:35:56 +0000 (17:35 +0200)
committerGitHub <noreply@github.com>
Mon, 17 Aug 2020 15:35:56 +0000 (17:35 +0200)
This reverts commit ce53eb79ae455131e28c1869a28150e0c48cfad3.

src/daemon/metric.c
src/daemon/metric.h

index 2196b36ff0f7131e776e33177a8a4ff93f4d1967..16052be6117762e2a703c9284acb71ddf281c817 100644 (file)
@@ -26,6 +26,7 @@
  **/
 
 #include "collectd.h"
+
 #include "metric.h"
 #include "plugin.h"
 
@@ -205,10 +206,6 @@ int metric_reset(metric_t *m) {
   label_set_reset(&m->label);
   meta_data_destroy(m->meta);
 
-  if(m->family->type == METRIC_TYPE_DISTRIBUTION) {
-    distribution_destroy(m->value.distribution);
-  }
-
   memset(m, 0, sizeof(*m));
 
   return 0;
@@ -348,19 +345,12 @@ static int metric_list_clone(metric_list_t *dest, metric_list_t src,
   }
 
   for (size_t i = 0; i < src.num; i++) {
-
-      ret.ptr[i] = (metric_t){
+    ret.ptr[i] = (metric_t){
         .family = fam,
+        .value = src.ptr[i].value,
         .time = src.ptr[i].time,
         .interval = src.ptr[i].interval,
-      };
-
-      if(src.ptr[i].family->type == METRIC_TYPE_DISTRIBUTION) {
-          ret.ptr[i].value.distribution = distribution_clone(src.ptr[i].value.distribution);    
-      }
-      else {
-          ret.ptr[i].value = src.ptr[i].value;
-      }
+    };
 
     int status = label_set_clone(&ret.ptr[i].label, src.ptr[i].label);
     if (status != 0) {
@@ -633,4 +623,3 @@ metric_t *metric_parse_identity(char const *buf) {
 
   return fam->metric.ptr;
 }
-
index 6af52562f995db2c9d863b04da413d03ecbd2852..0419304ede8e227e80b9a11874b7629a82ba2694 100644 (file)
@@ -31,7 +31,6 @@
 #include "utils/metadata/meta_data.h"
 #include "utils/strbuf/strbuf.h"
 #include "utils_time.h"
-#include "distribution.h"
 
 #define VALUE_TYPE_GAUGE 1
 #define VALUE_TYPE_DERIVE 2
@@ -40,7 +39,6 @@ typedef enum {
   METRIC_TYPE_COUNTER = 0,
   METRIC_TYPE_GAUGE = 1,
   METRIC_TYPE_UNTYPED = 2,
-  METRIC_TYPE_DISTRIBUTION = 3,
 } metric_type_t;
 
 typedef uint64_t counter_t;
@@ -51,7 +49,6 @@ union value_u {
   counter_t counter;
   gauge_t gauge;
   derive_t derive;
-  distribution_t *distribution;
 };
 typedef union value_u value_t;
 
@@ -128,7 +125,7 @@ int metric_label_set(metric_t *m, char const *name, char const *value);
 char const *metric_label_get(metric_t const *m, char const *name);
 
 /* metric_reset frees all labels and meta data stored in the metric and resets
- * the metric to zero. If the metric is a distribution metric, the function frees the according distribution.*/
+ * the metric to zero. */
 int metric_reset(metric_t *m);
 
 /* metric_list_t is an unordered list of metrics. */
@@ -178,10 +175,4 @@ void metric_family_free(metric_family_t *fam);
  * metric_family_free(). */
 metric_family_t *metric_family_clone(metric_family_t const *fam);
 
-/*The static function metric_list_clone creates a clone of the argument metric_list_t src. For each metric_t element
- *in the src list it checks if its value is a distribution metric and if yes, calls the distribution_clone function
- *for the value and saves the pointer to the returned distribution_t clone into the metric_list_t dest. If
- *the value is not a distribution_t, it simply sets the value of the element in the destination list to the value
- *of the element in the source list. */ 
-
 #endif