]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
Tree-wide: Remove support for "absolute" metric values. 3507/head
authorFlorian Forster <octo@google.com>
Thu, 16 Jul 2020 16:55:13 +0000 (18:55 +0200)
committerFlorian Forster <octo@google.com>
Thu, 16 Jul 2020 19:46:33 +0000 (21:46 +0200)
46 files changed:
src/collectd-perl.pod
src/collectd-python.pod
src/collectd.conf.pod
src/csv.c
src/curl.c
src/curl_xml.c
src/daemon/plugin.c
src/daemon/plugin.h
src/daemon/types_list.c
src/daemon/utils_cache.c
src/gmond.c
src/grpc.cc
src/java.c
src/modbus.c
src/network.c
src/perl.c
src/postgresql.c
src/python.c
src/pyvalues.c
src/redfish.c
src/redfish_test.c
src/redis.c
src/rrdcached.c
src/rrdtool.c
src/snmp.c
src/snmp_agent.c
src/tail.c
src/target_scale.c
src/types.db
src/types.db.pod
src/utils/common/common.c
src/utils/format_graphite/format_graphite.c
src/utils/format_json/format_json.c
src/utils/format_kairosdb/format_kairosdb.c
src/utils/format_stackdriver/format_stackdriver.c
src/utils/match/match.c
src/utils/match/match.h
src/utils/rrdcreate/rrdcreate.c
src/utils_lua.c
src/write_influxdb_udp.c
src/write_mongodb.c
src/write_prometheus.c
src/write_riemann.c
src/write_sensu.c
src/write_syslog.c
src/write_tsdb.c

index 9af3c0c9af759f4c76d3dc410c21b83799b90b69..acc5502409a3d12a8ea2a56cafc6052fdd3cd2fe 100644 (file)
@@ -200,7 +200,7 @@ structure. The general layout looks like this:
 
   [{
     name => 'data_source_name',
-    type => DS_TYPE_COUNTER || DS_TYPE_GAUGE || DS_TYPE_DERIVE || DS_TYPE_ABSOLUTE,
+    type => DS_TYPE_COUNTER || DS_TYPE_GAUGE || DS_TYPE_DERIVE,
     min  => value || undef,
     max  => value || undef
   }, ...]
@@ -579,8 +579,6 @@ available (B<:all> will export all of them):
 
 =item B<DS_TYPE_DERIVE>
 
-=item B<DS_TYPE_ABSOLUTE>
-
 =back
 
 =item B<:log>
index 3e44d54652e248d85d128527078dd54db86ad127..44454a746cf340ed9e063d82984ff4df7a1e4ac0 100644 (file)
@@ -657,7 +657,7 @@ A string, the name of the data source.
 =item type
 
 A string that is equal to either of the variables B<DS_TYPE_COUNTER>,
-B<DS_TYPE_GAUGE>, B<DS_TYPE_DERIVE> or B<DS_TYPE_ABSOLUTE>.
+B<DS_TYPE_GAUGE>, or B<DS_TYPE_DERIVE>.
 
 =item min
 
index 3b2516ef6774d08e14496b8b957fd1aac7c494b0..2512d6f2a6d08529fbd7c4abc9b3d5d257bc7f03 100644 (file)
@@ -706,10 +706,10 @@ only decode the B<Command> format.
 
 =item B<StoreRates> B<true>|B<false> (Publish only)
 
-Determines whether or not C<COUNTER>, C<DERIVE> and C<ABSOLUTE> data sources
-are converted to a I<rate> (i.e. a C<GAUGE> value). If set to B<false> (the
-default), no conversion is performed. Otherwise the conversion is performed
-using the internal value cache.
+Determines whether or not C<COUNTER> and C<DERIVE> data sources are converted
+to a I<rate> (i.e. a C<GAUGE> value). If set to B<false> (the default), no
+conversion is performed. Otherwise the conversion is performed using the
+internal value cache.
 
 Please note that currently this option is only used if the B<Format> option has
 been set to B<JSON>.
@@ -912,10 +912,10 @@ for alert formatting.
 
 =item B<StoreRates> B<true>|B<false>
 
-Determines whether or not C<COUNTER>, C<DERIVE> and C<ABSOLUTE> data sources
-are converted to a I<rate> (i.e. a C<GAUGE> value). If set to B<false> (the
-default), no conversion is performed. Otherwise the conversion is performed
-using the internal value cache.
+Determines whether or not C<COUNTER> and C<DERIVE> data sources are converted
+to a I<rate> (i.e. a C<GAUGE> value). If set to B<false> (the default), no
+conversion is performed. Otherwise the conversion is performed using the
+internal value cache.
 
 Please note that currently this option is only used if the B<Format> option has
 been set to B<JSON>.
@@ -9311,7 +9311,7 @@ example a thermometer that only reports the temperature when it changes.
 =item B<AbsoluteSet>
 
 The matched number is a counter. Simply I<sets> the internal counter to this
-value. Variants exist for C<COUNTER>, C<DERIVE>, and C<ABSOLUTE> data sources.
+value. Variants exist for C<COUNTER> and C<DERIVE> data sources.
 
 =item B<GaugeAdd>
 
@@ -11108,10 +11108,10 @@ C<E<lt>metricE<gt> E<lt>valueE<gt> E<lt>timestampE<gt>\n>.
 
 =item B<StoreRates> B<true>|B<false>
 
-Determines whether or not C<COUNTER>, C<DERIVE> and C<ABSOLUTE> data sources
-are converted to a I<rate> (i.e. a C<GAUGE> value). If set to B<false> (the
-default), no conversion is performed. Otherwise the conversion is performed
-using the internal value cache.
+Determines whether or not C<COUNTER> and C<DERIVE> data sources are converted
+to a I<rate> (i.e. a C<GAUGE> value). If set to B<false> (the default), no
+conversion is performed. Otherwise the conversion is performed using the
+internal value cache.
 
 Please note that currently this option is only used if the B<Format> option has
 been set to B<JSON>.
index 953473fce56a2e6a43ad2d5fa882f212556d2a2c..6122414211747ebfaec466ef02f83abddf348f4b 100644 (file)
--- a/src/csv.c
+++ b/src/csv.c
@@ -55,8 +55,7 @@ static int value_list_to_string(char *buffer, int buffer_len,
   for (size_t i = 0; i < ds->ds_num; i++) {
     if ((ds->ds[i].type != DS_TYPE_COUNTER) &&
         (ds->ds[i].type != DS_TYPE_GAUGE) &&
-        (ds->ds[i].type != DS_TYPE_DERIVE) &&
-        (ds->ds[i].type != DS_TYPE_ABSOLUTE)) {
+        (ds->ds[i].type != DS_TYPE_DERIVE)) {
       sfree(rates);
       return -1;
     }
@@ -79,9 +78,6 @@ static int value_list_to_string(char *buffer, int buffer_len,
     } else if (ds->ds[i].type == DS_TYPE_DERIVE) {
       status = snprintf(buffer + offset, buffer_len - offset, ",%" PRIi64,
                         vl->values[i].derive);
-    } else if (ds->ds[i].type == DS_TYPE_ABSOLUTE) {
-      status = snprintf(buffer + offset, buffer_len - offset, ",%" PRIu64,
-                        vl->values[i].absolute);
     }
 
     if ((status < 1) || (status >= (buffer_len - offset))) {
index 7eb480584ebfb7132a58b38005541aa917309110..dcb04834be0afdaee28028a2f9446941766d1030 100644 (file)
@@ -222,15 +222,6 @@ static int cc_config_add_match_dstype(int *dstype_ret, /* {{{ */
       dstype |= UTILS_MATCH_CF_DERIVE_INC;
     else
       dstype = 0;
-  } else if (strncasecmp("Absolute", ci->values[0].value.string,
-                         strlen("Absolute")) == 0) {
-    dstype = UTILS_MATCH_DS_TYPE_ABSOLUTE;
-    if (strcasecmp("AbsoluteSet", ci->values[0].value.string) ==
-        0) /* Absolute DS is reset-on-read so no sense doin anything else but
-              set */
-      dstype |= UTILS_MATCH_CF_ABSOLUTE_SET;
-    else
-      dstype = 0;
   }
 
   else {
index 4524ac33669a80552d7e91b0191fd3e31be47b07..61bfaa27b8e80e40819cadc09e6df8ad438d711d 100644 (file)
@@ -347,11 +347,6 @@ static int cx_handle_single_value_xpath(xmlXPathContextPtr xpath_ctx, /* {{{ */
         (derive_t)strtoll(node_value,
                           /* endptr = */ NULL, /* base = */ 0);
     break;
-  case DS_TYPE_ABSOLUTE:
-    vl->values[index].absolute =
-        (absolute_t)strtoull(node_value,
-                             /* endptr = */ NULL, /* base = */ 0);
-    break;
   case DS_TYPE_GAUGE:
     vl->values[index].gauge = (gauge_t)strtod(node_value,
                                               /* endptr = */ NULL);
index 12255f13a27ad543988ac93b8d11ac71727a065e..2231bfb530f442cee03db61e387d2d6b7127691d 100644 (file)
@@ -2324,9 +2324,6 @@ plugin_dispatch_multivalue(value_list_t const *template, /* {{{ */
       if (store_percentage)
         vl->values[0].gauge *= sum ? (100.0 / sum) : NAN;
       break;
-    case DS_TYPE_ABSOLUTE:
-      vl->values[0].absolute = va_arg(ap, absolute_t);
-      break;
     case DS_TYPE_COUNTER:
       vl->values[0].counter = va_arg(ap, counter_t);
       break;
index 0dbefdab03c3ef3c93e07c0067096699c3576c5c..9eb3b0dba26ec013da261d0ecad90ca791a23b17 100644 (file)
 #define DS_TYPE_COUNTER 0
 #define DS_TYPE_GAUGE 1
 #define DS_TYPE_DERIVE 2
-#define DS_TYPE_ABSOLUTE 3
 
 #define DS_TYPE_TO_STRING(t)                                                   \
   (t == DS_TYPE_COUNTER)                                                       \
       ? "counter"                                                              \
-      : (t == DS_TYPE_GAUGE)                                                   \
-            ? "gauge"                                                          \
-            : (t == DS_TYPE_DERIVE)                                            \
-                  ? "derive"                                                   \
-                  : (t == DS_TYPE_ABSOLUTE) ? "absolute" : "unknown"
+      : (t == DS_TYPE_GAUGE) ? "gauge"                                         \
+                             : (t == DS_TYPE_DERIVE) ? "derive" : "unknown"
 
 #ifndef LOG_ERR
 #define LOG_ERR 3
@@ -90,13 +86,11 @@ typedef struct identifier_s identifier_t;
 typedef unsigned long long counter_t;
 typedef double gauge_t;
 typedef int64_t derive_t;
-typedef uint64_t absolute_t;
 
 union value_u {
   counter_t counter;
   gauge_t gauge;
   derive_t derive;
-  absolute_t absolute;
 };
 typedef union value_u value_t;
 
@@ -384,7 +378,6 @@ int plugin_dispatch_values(value_list_t const *vl);
  *  "store_type":
  *
  *     - "gauge_t"    when "DS_TYPE_GAUGE"
- *     - "absolute_t" when "DS_TYPE_ABSOLUTE"
  *     - "derive_t"   when "DS_TYPE_DERIVE"
  *     - "counter_t"  when "DS_TYPE_COUNTER"
  *
index 7eb3cb2fd0d473423740d3451763f991b1a85f4b..f5eff1a2a01169748671e7a3518d4cfdae784e13 100644 (file)
@@ -72,11 +72,8 @@ static int parse_ds(data_source_t *dsrc, char *buf, size_t buf_len) {
     dsrc->type = DS_TYPE_COUNTER;
   else if (strcasecmp(fields[1], "DERIVE") == 0)
     dsrc->type = DS_TYPE_DERIVE;
-  else if (strcasecmp(fields[1], "ABSOLUTE") == 0)
-    dsrc->type = DS_TYPE_ABSOLUTE;
   else {
-    ERROR("(fields[1] = %s) != (GAUGE || COUNTER || DERIVE || ABSOLUTE)",
-          fields[1]);
+    ERROR("(fields[1] = %s) != (GAUGE || COUNTER || DERIVE)", fields[1]);
     return -1;
   }
 
index cf2095eec12fb0190ce30e187173ea6d7490d433..fee3be8a45430a2e9d330830f6cf9a10f4a9d13b 100644 (file)
@@ -175,14 +175,6 @@ static int uc_insert(const data_set_t *ds, const value_list_t *vl,
       ce->values_raw[i].derive = vl->values[i].derive;
       break;
 
-    case DS_TYPE_ABSOLUTE:
-      ce->values_gauge[i] = NAN;
-      if (vl->interval > 0)
-        ce->values_gauge[i] =
-            ((double)vl->values[i].absolute) / CDTIME_T_TO_DOUBLE(vl->interval);
-      ce->values_raw[i].absolute = vl->values[i].absolute;
-      break;
-
     default:
       /* This shouldn't happen. */
       ERROR("uc_insert: Don't know how to handle data source type %i.",
@@ -379,12 +371,6 @@ int uc_update(const data_set_t *ds, const value_list_t *vl) {
       ce->values_raw[i].derive = vl->values[i].derive;
     } break;
 
-    case DS_TYPE_ABSOLUTE:
-      ce->values_gauge[i] = ((double)vl->values[i].absolute) /
-                            (CDTIME_T_TO_DOUBLE(vl->time - ce->last_time));
-      ce->values_raw[i].absolute = vl->values[i].absolute;
-      break;
-
     default:
       /* This shouldn't happen. */
       pthread_mutex_unlock(&cache_lock);
index 4210e30d0877ae539d14d4a26b34500170bd8f3a..cca352e73c1f05e1d158c292c39a8b4ae6c11466 100644 (file)
@@ -477,8 +477,6 @@ static int staging_entry_update(const char *host, const char *name, /* {{{ */
     se->vl.values[ds_index].gauge = value.gauge;
   else if (ds_type == DS_TYPE_DERIVE)
     se->vl.values[ds_index].derive += value.derive;
-  else if (ds_type == DS_TYPE_ABSOLUTE)
-    se->vl.values[ds_index].absolute = value.absolute;
   else
     assert(23 == 42);
 
@@ -597,7 +595,7 @@ static int mc_handle_value_msg(Ganglia_value_msg *msg) /* {{{ */
   if (map != NULL) {
     value_t val_copy;
 
-    if ((map->ds_type == DS_TYPE_COUNTER) || (map->ds_type == DS_TYPE_ABSOLUTE))
+    if (map->ds_type == DS_TYPE_COUNTER)
       val_copy = value_counter;
     else if (map->ds_type == DS_TYPE_GAUGE)
       val_copy = value_gauge;
@@ -659,7 +657,9 @@ static int mc_handle_metadata_msg(Ganglia_metadata_msg *msg) /* {{{ */
     break;
   }
 
-  default: { return -1; }
+  default: {
+    return -1;
+  }
   }
 
   return 0;
index d9577a462f10c987d621252bfba6e0a3d383df8e..3799e48f3f7ed88028508a24a18c1b941df11d12 100644 (file)
@@ -313,9 +313,6 @@ static grpc::Status marshal_value_list(const value_list_t *vl,
     case DS_TYPE_DERIVE:
       v->set_derive(vl->values[i].derive);
       break;
-    case DS_TYPE_ABSOLUTE:
-      v->set_absolute(vl->values[i].absolute);
-      break;
     default:
       ERROR("grpc: invalid value type (%d)", value_type);
       return grpc::Status(grpc::StatusCode::INTERNAL,
index 4da73bbbb86bda1d15752c6f354a222449ad30b5..a8eab628d4775d829cfb98d22ccc65c30808e6bf 100644 (file)
@@ -286,8 +286,6 @@ static jobject ctoj_value_to_number(JNIEnv *jvm_env, /* {{{ */
     return ctoj_jdouble_to_number(jvm_env, (jdouble)value.gauge);
   if (ds_type == DS_TYPE_DERIVE)
     return ctoj_jlong_to_number(jvm_env, (jlong)value.derive);
-  if (ds_type == DS_TYPE_ABSOLUTE)
-    return ctoj_jlong_to_number(jvm_env, (jlong)value.absolute);
   else
     return NULL;
 } /* }}} jobject ctoj_value_to_number */
@@ -989,8 +987,6 @@ static int jtoc_value(JNIEnv *jvm_env, /* {{{ */
 
     if (ds_type == DS_TYPE_DERIVE)
       (*ret_value).derive = (derive_t)tmp_long;
-    else if (ds_type == DS_TYPE_ABSOLUTE)
-      (*ret_value).absolute = (absolute_t)tmp_long;
     else
       (*ret_value).counter = (counter_t)tmp_long;
   }
index e36f3daea5e0319b4190026165928f773c4c9dfa..d18b8b1e8bd5a9cbbfe95ccaa83faea21cb94082 100644 (file)
@@ -341,7 +341,7 @@ static int mb_init_connection(mb_host_t *host) /* {{{ */
   host->is_connected = true;
   return 0;
 } /* }}} int mb_init_connection */
-  /* #endif LEGACY_LIBMODBUS */
+/* #endif LEGACY_LIBMODBUS */
 
 #else /* if !LEGACY_LIBMODBUS */
 /* Version 2.9.2 */
@@ -422,8 +422,6 @@ static int mb_init_connection(mb_host_t *host) /* {{{ */
       (vt).gauge = (((gauge_t)(raw)*scale) + shift);                           \
     else if ((ds)->ds[0].type == DS_TYPE_DERIVE)                               \
       (vt).derive = (((derive_t)(raw)*scale) + shift);                         \
-    else /* if (ds->ds[0].type == DS_TYPE_ABSOLUTE) */                         \
-      (vt).absolute = (((absolute_t)(raw)*scale) + shift);                     \
   } while (0)
 
 static int mb_read_data(mb_host_t *host, mb_slave_t *slave, /* {{{ */
@@ -550,7 +548,7 @@ static int mb_read_data(mb_host_t *host, mb_slave_t *slave, /* {{{ */
 
   if (data->register_type == REG_TYPE_FLOAT) {
     float float_value;
-    value_t vt;
+    value_t vt = {0};
 
     float_value = mb_register_to_float(values[0], values[1]);
     DEBUG("Modbus plugin: mb_read_data: "
@@ -561,7 +559,7 @@ static int mb_read_data(mb_host_t *host, mb_slave_t *slave, /* {{{ */
     mb_submit(host, slave, data, vt);
   } else if (data->register_type == REG_TYPE_FLOAT_CDAB) {
     float float_value;
-    value_t vt;
+    value_t vt = {0};
 
     float_value = mb_register_to_float(values[1], values[0]);
     DEBUG("Modbus plugin: mb_read_data: "
@@ -575,7 +573,7 @@ static int mb_read_data(mb_host_t *host, mb_slave_t *slave, /* {{{ */
       uint32_t u32;
       int32_t i32;
     } v;
-    value_t vt;
+    value_t vt = {0};
 
     v.u32 = (((uint32_t)values[0]) << 16) | ((uint32_t)values[1]);
     DEBUG("Modbus plugin: mb_read_data: "
@@ -589,7 +587,7 @@ static int mb_read_data(mb_host_t *host, mb_slave_t *slave, /* {{{ */
       uint32_t u32;
       int32_t i32;
     } v;
-    value_t vt;
+    value_t vt = {0};
 
     v.u32 = (((uint32_t)values[1]) << 16) | ((uint32_t)values[0]);
     DEBUG("Modbus plugin: mb_read_data: "
@@ -603,7 +601,7 @@ static int mb_read_data(mb_host_t *host, mb_slave_t *slave, /* {{{ */
       uint16_t u16;
       int16_t i16;
     } v;
-    value_t vt;
+    value_t vt = {0};
 
     v.u16 = values[0];
 
@@ -615,7 +613,7 @@ static int mb_read_data(mb_host_t *host, mb_slave_t *slave, /* {{{ */
     mb_submit(host, slave, data, vt);
   } else if (data->register_type == REG_TYPE_UINT32) {
     uint32_t v32;
-    value_t vt;
+    value_t vt = {0};
 
     v32 = (((uint32_t)values[0]) << 16) | ((uint32_t)values[1]);
     DEBUG("Modbus plugin: mb_read_data: "
@@ -626,7 +624,7 @@ static int mb_read_data(mb_host_t *host, mb_slave_t *slave, /* {{{ */
     mb_submit(host, slave, data, vt);
   } else if (data->register_type == REG_TYPE_UINT32_CDAB) {
     uint32_t v32;
-    value_t vt;
+    value_t vt = {0};
 
     v32 = (((uint32_t)values[1]) << 16) | ((uint32_t)values[0]);
     DEBUG("Modbus plugin: mb_read_data: "
@@ -637,7 +635,7 @@ static int mb_read_data(mb_host_t *host, mb_slave_t *slave, /* {{{ */
     mb_submit(host, slave, data, vt);
   } else if (data->register_type == REG_TYPE_UINT64) {
     uint64_t v64;
-    value_t vt;
+    value_t vt = {0};
 
     v64 = (((uint64_t)values[0]) << 48) | (((uint64_t)values[1]) << 32) |
           (((uint64_t)values[2]) << 16) | (((uint64_t)values[3]));
@@ -652,7 +650,7 @@ static int mb_read_data(mb_host_t *host, mb_slave_t *slave, /* {{{ */
       uint64_t u64;
       int64_t i64;
     } v;
-    value_t vt;
+    value_t vt = {0};
 
     v.u64 = (((uint64_t)values[0]) << 48) | (((uint64_t)values[1]) << 32) |
             (((uint64_t)values[2]) << 16) | ((uint64_t)values[3]);
@@ -664,7 +662,7 @@ static int mb_read_data(mb_host_t *host, mb_slave_t *slave, /* {{{ */
     mb_submit(host, slave, data, vt);
   } else /* if (data->register_type == REG_TYPE_UINT16) */
   {
-    value_t vt;
+    value_t vt = {0};
 
     DEBUG("Modbus plugin: mb_read_data: "
           "Returned uint16 value is %" PRIu16,
index 8a6c74d38b7316c195d32cde1f13c60e09137598..53b46340319c446200bdf1bf73db3a130002f59b 100644 (file)
@@ -650,10 +650,6 @@ static int write_part_values(char **ret_buffer, size_t *ret_buffer_len,
       pkg_values[i].derive = htonll(vl->values[i].derive);
       break;
 
-    case DS_TYPE_ABSOLUTE:
-      pkg_values[i].absolute = htonll(vl->values[i].absolute);
-      break;
-
     default:
       free(pkg_values_types);
       free(pkg_values);
@@ -844,10 +840,6 @@ static int parse_part_values(void **ret_buffer, size_t *ret_buffer_len,
       pkg_values[i].derive = (derive_t)ntohll(pkg_values[i].derive);
       break;
 
-    case DS_TYPE_ABSOLUTE:
-      pkg_values[i].absolute = (absolute_t)ntohll(pkg_values[i].absolute);
-      break;
-
     default:
       NOTICE("network plugin: parse_part_values: "
              "Don't know how to handle data source type %" PRIu8,
@@ -1133,7 +1125,7 @@ static int parse_part_sign_sha256(sockent_t *se, /* {{{ */
 
   return 0;
 } /* }}} int parse_part_sign_sha256 */
-  /* #endif HAVE_GCRYPT_H */
+/* #endif HAVE_GCRYPT_H */
 
 #else  /* if !HAVE_GCRYPT_H */
 static int parse_part_sign_sha256(sockent_t *se, /* {{{ */
@@ -1288,7 +1280,7 @@ static int parse_part_encr_aes256(sockent_t *se, /* {{{ */
 
   return 0;
 } /* }}} int parse_part_encr_aes256 */
-  /* #endif HAVE_GCRYPT_H */
+/* #endif HAVE_GCRYPT_H */
 
 #else  /* if !HAVE_GCRYPT_H */
 static int parse_part_encr_aes256(sockent_t *se, /* {{{ */
@@ -1697,7 +1689,7 @@ static int network_set_interface(const sockent_t *se,
       ERROR("network plugin: setsockopt (bind-if): %s", STRERRNO);
       return -1;
     }
-      /* #endif HAVE_IF_INDEXTONAME && SO_BINDTODEVICE */
+    /* #endif HAVE_IF_INDEXTONAME && SO_BINDTODEVICE */
 
 #else
     WARNING("network plugin: Cannot set the interface on a unicast "
index 0a4ae71d13ce0f0643a8e805d67854cb4835684a..c570707debebff4c767084e2e109df60795021a1 100644 (file)
@@ -232,7 +232,6 @@ struct {
                  {"Collectd::DS_TYPE_COUNTER", DS_TYPE_COUNTER},
                  {"Collectd::DS_TYPE_GAUGE", DS_TYPE_GAUGE},
                  {"Collectd::DS_TYPE_DERIVE", DS_TYPE_DERIVE},
-                 {"Collectd::DS_TYPE_ABSOLUTE", DS_TYPE_ABSOLUTE},
                  {"Collectd::LOG_ERR", LOG_ERR},
                  {"Collectd::LOG_WARNING", LOG_WARNING},
                  {"Collectd::LOG_NOTICE", LOG_NOTICE},
@@ -285,7 +284,7 @@ static int hv2data_source(pTHX_ HV *hash, data_source_t *ds) {
     ds->type = SvIV(*tmp);
 
     if ((DS_TYPE_COUNTER != ds->type) && (DS_TYPE_GAUGE != ds->type) &&
-        (DS_TYPE_DERIVE != ds->type) && (DS_TYPE_ABSOLUTE != ds->type)) {
+        (DS_TYPE_DERIVE != ds->type)) {
       log_err("hv2data_source: Invalid DS type.");
       return -1;
     }
@@ -341,8 +340,6 @@ static size_t av2value(pTHX_ char *name, AV *array, value_t *value,
         value[i].gauge = SvNV(*tmp);
       else if (DS_TYPE_DERIVE == ds->ds[i].type)
         value[i].derive = SvIV(*tmp);
-      else if (DS_TYPE_ABSOLUTE == ds->ds[i].type)
-        value[i].absolute = SvIV(*tmp);
     } else {
       return 0;
     }
@@ -647,8 +644,6 @@ static int value_list2hv(pTHX_ value_list_t *vl, data_set_t *ds, HV *hash) {
       val = newSVnv(vl->values[i].gauge);
     else if (DS_TYPE_DERIVE == ds->ds[i].type)
       val = newSViv(vl->values[i].derive);
-    else if (DS_TYPE_ABSOLUTE == ds->ds[i].type)
-      val = newSViv(vl->values[i].absolute);
 
     if (NULL == av_store(values, i, val)) {
       av_undef(values);
index 4e608be10e1e06d1283eec918e47cbf5aede79d5..e9575cd2f2a678fabbba2b8f269189cbda1676ab 100644 (file)
@@ -716,8 +716,7 @@ static char *values_to_sqlarray(const data_set_t *ds, const value_list_t *vl,
 
     if ((ds->ds[i].type != DS_TYPE_GAUGE) &&
         (ds->ds[i].type != DS_TYPE_COUNTER) &&
-        (ds->ds[i].type != DS_TYPE_DERIVE) &&
-        (ds->ds[i].type != DS_TYPE_ABSOLUTE)) {
+        (ds->ds[i].type != DS_TYPE_DERIVE)) {
       log_err("c_psql_write: Unknown data source type: %i", ds->ds[i].type);
       sfree(rates);
       return NULL;
@@ -741,8 +740,6 @@ static char *values_to_sqlarray(const data_set_t *ds, const value_list_t *vl,
                          (uint64_t)vl->values[i].counter);
     else if (ds->ds[i].type == DS_TYPE_DERIVE)
       status = ssnprintf(str_ptr, str_len, ",%" PRIi64, vl->values[i].derive);
-    else if (ds->ds[i].type == DS_TYPE_ABSOLUTE)
-      status = ssnprintf(str_ptr, str_len, ",%" PRIu64, vl->values[i].absolute);
 
     if (status < 1) {
       str_len = 0;
index 119ffe21742ab20d8909c45c23c000e7ae3a67e9..3fda2a506640ca1a96605ef62e9b38e0d47e70cb 100644 (file)
@@ -55,7 +55,7 @@ static char get_ds_doc[] =
     "    name, type, min and max value.\n"
     "    'name' is a string.\n"
     "    'type' is a string that is equal to either DS_TYPE_COUNTER,\n"
-    "        DS_TYPE_GAUGE, DS_TYPE_DERIVE or DS_TYPE_ABSOLUTE.\n"
+    "        DS_TYPE_GAUGE, or DS_TYPE_DERIVE.\n"
     "    'min' and 'max' are either a float or None.";
 
 static char flush_doc[] = "flush([plugin][, timeout][, identifier]) -> None\n"
@@ -420,9 +420,6 @@ static int cpy_write_callback(const data_set_t *ds,
     } else if (ds->ds[i].type == DS_TYPE_DERIVE) {
       PyList_SetItem(list, i,
                      PyLong_FromLongLong(value_list->values[i].derive));
-    } else if (ds->ds[i].type == DS_TYPE_ABSOLUTE) {
-      PyList_SetItem(
-          list, i, PyLong_FromUnsignedLongLong(value_list->values[i].absolute));
     } else {
       Py_BEGIN_ALLOW_THREADS;
       ERROR("cpy_write_callback: Unknown value type %d.", ds->ds[i].type);
@@ -1340,8 +1337,6 @@ static int cpy_init_python(void) {
                              DS_TYPE_TO_STRING(DS_TYPE_GAUGE));
   PyModule_AddStringConstant(module, "DS_TYPE_DERIVE",
                              DS_TYPE_TO_STRING(DS_TYPE_DERIVE));
-  PyModule_AddStringConstant(module, "DS_TYPE_ABSOLUTE",
-                             DS_TYPE_TO_STRING(DS_TYPE_ABSOLUTE));
   return 0;
 }
 
index 967fecfd8857978b32422465d3deb33af65e76f5..0fc987a35d8f0963abf68cb1898370d7bb4c21f8 100644 (file)
@@ -673,15 +673,6 @@ static PyObject *Values_dispatch(Values *self, PyObject *args, PyObject *kwds) {
         Py_XDECREF(num);
       }
       break;
-    case DS_TYPE_ABSOLUTE:
-      /* This might overflow without raising an exception.
-       * Not much we can do about it */
-      num = PyNumber_Long(item); /* New reference. */
-      if (num != NULL) {
-        value[i].absolute = PyLong_AsUnsignedLongLong(num);
-        Py_XDECREF(num);
-      }
-      break;
     default:
       free(value);
       PyErr_Format(PyExc_RuntimeError, "unknown data type %d for %s",
@@ -798,15 +789,6 @@ static PyObject *Values_write(Values *self, PyObject *args, PyObject *kwds) {
         Py_XDECREF(num);
       }
       break;
-    case DS_TYPE_ABSOLUTE:
-      /* This might overflow without raising an exception.
-       * Not much we can do about it */
-      num = PyNumber_Long(item); /* New reference. */
-      if (num != NULL) {
-        value[i].absolute = PyLong_AsUnsignedLongLong(num);
-        Py_XDECREF(num);
-      }
-      break;
     default:
       free(value);
       PyErr_Format(PyExc_RuntimeError, "unknown data type %d for %s",
index 947fb392e42e8e6c224a8916464776dc456a7b6d..d2d77482071c6d3489d15cdaba56eb0df64e746e 100644 (file)
@@ -706,14 +706,6 @@ static int redfish_convert_val(redfish_value_t *value,
     else if (src_type == VAL_TYPE_REAL)
       vl->derive = (derive_t)value->real;
     break;
-  case DS_TYPE_ABSOLUTE:
-    if (src_type == VAL_TYPE_STR)
-      vl->absolute = strtoull(value->string, NULL, 0);
-    else if (src_type == VAL_TYPE_INT)
-      vl->absolute = (absolute_t)value->integer;
-    else if (src_type == VAL_TYPE_REAL)
-      vl->absolute = (absolute_t)value->real;
-    break;
   default:
     ERROR(PLUGIN_NAME ": Invalid data set type. Cannot convert value");
     return -EINVAL;
index 1decc9ef8bdc255f0e2dc23c855dd4bad70d290a..9d5cce01e35e661bfce6852c45d371dd713a37b4 100644 (file)
@@ -145,27 +145,6 @@ DEF_TEST(convert_val) {
   EXPECT_EQ_INT(0, ret);
   OK(vl.counter == 1);
 
-  val.string = "1";
-  src_type = VAL_TYPE_STR;
-  dst_type = DS_TYPE_ABSOLUTE;
-  ret = redfish_convert_val(&val, src_type, &vl, dst_type);
-  EXPECT_EQ_INT(0, ret);
-  OK(vl.absolute == 1);
-
-  val.integer = 1;
-  src_type = VAL_TYPE_INT;
-  dst_type = DS_TYPE_ABSOLUTE;
-  ret = redfish_convert_val(&val, src_type, &vl, dst_type);
-  EXPECT_EQ_INT(0, ret);
-  OK(vl.absolute == 1);
-
-  val.real = 1.0;
-  src_type = VAL_TYPE_REAL;
-  dst_type = DS_TYPE_ABSOLUTE;
-  ret = redfish_convert_val(&val, src_type, &vl, dst_type);
-  EXPECT_EQ_INT(0, ret);
-  OK(vl.absolute == 1);
-
   return 0;
 }
 
index 77ce5fb615adb52aca056e77e8e19c523d24aa37..e845d3766e712850d7aabe8b65b4d12f188f1ce3 100644 (file)
@@ -436,9 +436,6 @@ static int redis_handle_query(redis_node_t *rn, redis_query_t *rq) /* {{{ */
     case DS_TYPE_DERIVE:
       val.gauge = (derive_t)rr->integer;
       break;
-    case DS_TYPE_ABSOLUTE:
-      val.gauge = (absolute_t)rr->integer;
-      break;
     }
     break;
   case REDIS_REPLY_STRING:
index 1e75ff8330aadd35f8d103f37d77368725700ef3..1f6891a1e82d3e844beaaf2f0d05e333a0d81d43 100644 (file)
@@ -73,12 +73,6 @@ static int value_list_to_string(char *buffer, int buffer_len,
   int offset = status;
 
   for (size_t i = 0; i < ds->ds_num; i++) {
-    if ((ds->ds[i].type != DS_TYPE_COUNTER) &&
-        (ds->ds[i].type != DS_TYPE_GAUGE) &&
-        (ds->ds[i].type != DS_TYPE_DERIVE) &&
-        (ds->ds[i].type != DS_TYPE_ABSOLUTE))
-      return -1;
-
     if (ds->ds[i].type == DS_TYPE_COUNTER) {
       status = ssnprintf(buffer + offset, buffer_len - offset, ":%" PRIu64,
                          (uint64_t)vl->values[i].counter);
@@ -88,9 +82,8 @@ static int value_list_to_string(char *buffer, int buffer_len,
     } else if (ds->ds[i].type == DS_TYPE_DERIVE) {
       status = ssnprintf(buffer + offset, buffer_len - offset, ":%" PRIi64,
                          vl->values[i].derive);
-    } else /* if (ds->ds[i].type == DS_TYPE_ABSOLUTE) */ {
-      status = ssnprintf(buffer + offset, buffer_len - offset, ":%" PRIu64,
-                         vl->values[i].absolute);
+    } else {
+      return -1;
     }
 
     if ((status < 1) || (status >= (buffer_len - offset)))
index f188ac4ad008fdd735b4ed26172f8408b712b6b0..2374003d98b3471a1213c519532ddc6b2f003809 100644 (file)
@@ -120,7 +120,7 @@ static int srrd_update(char *filename, char *template, int argc,
 
   return status;
 } /* int srrd_update */
-  /* #endif HAVE_THREADSAFE_LIBRRD */
+/* #endif HAVE_THREADSAFE_LIBRRD */
 
 #else  /* !HAVE_THREADSAFE_LIBRRD */
 static int srrd_update(char *filename, char *template, int argc,
@@ -179,12 +179,6 @@ static int value_list_to_string_multiple(char *buffer, int buffer_len,
   offset = status;
 
   for (size_t i = 0; i < ds->ds_num; i++) {
-    if ((ds->ds[i].type != DS_TYPE_COUNTER) &&
-        (ds->ds[i].type != DS_TYPE_GAUGE) &&
-        (ds->ds[i].type != DS_TYPE_DERIVE) &&
-        (ds->ds[i].type != DS_TYPE_ABSOLUTE))
-      return -1;
-
     if (ds->ds[i].type == DS_TYPE_COUNTER)
       status = ssnprintf(buffer + offset, buffer_len - offset, ":%" PRIu64,
                          (uint64_t)vl->values[i].counter);
@@ -194,9 +188,8 @@ static int value_list_to_string_multiple(char *buffer, int buffer_len,
     else if (ds->ds[i].type == DS_TYPE_DERIVE)
       status = ssnprintf(buffer + offset, buffer_len - offset, ":%" PRIi64,
                          vl->values[i].derive);
-    else /*if (ds->ds[i].type == DS_TYPE_ABSOLUTE) */
-      status = ssnprintf(buffer + offset, buffer_len - offset, ":%" PRIu64,
-                         vl->values[i].absolute);
+    else
+      return -1;
 
     if ((status < 1) || (status >= (buffer_len - offset)))
       return -1;
@@ -229,10 +222,6 @@ static int value_list_to_string(char *buffer, int buffer_len,
     status = ssnprintf(buffer, buffer_len, "%u:%" PRIu64, (unsigned)tt,
                        (uint64_t)vl->values[0].counter);
     break;
-  case DS_TYPE_ABSOLUTE:
-    status = ssnprintf(buffer, buffer_len, "%u:%" PRIu64, (unsigned)tt,
-                       vl->values[0].absolute);
-    break;
   default:
     return EINVAL;
   }
index 98da2b824bc196a774029e6c2b75986254b22116..4c357b9f2d99a24e6896560f47fea44bed949e68 100644 (file)
@@ -1090,7 +1090,6 @@ static value_t csnmp_value_list_to_value(const struct variable_list *vl,
       switch (type) {
       case DS_TYPE_COUNTER:
       case DS_TYPE_DERIVE:
-      case DS_TYPE_ABSOLUTE:
         memset(&ret, 0, sizeof(ret));
         break;
 
@@ -1120,8 +1119,6 @@ static value_t csnmp_value_list_to_value(const struct variable_list *vl,
       ret.derive = (derive_t)tmp_signed;
     else
       ret.derive = (derive_t)tmp_unsigned;
-  } else if (type == DS_TYPE_ABSOLUTE) {
-    ret.absolute = (absolute_t)tmp_unsigned;
   } else {
     ERROR("snmp plugin: csnmp_value_list_to_value: Unknown data source "
           "type: %i.",
index bb4a7e4271ed459aa31ced5a4b6ba4378a119a02..342faf44bdfab3c20d7b37118b04eae0d15c1431 100644 (file)
@@ -1781,9 +1781,6 @@ static int snmp_agent_get_value_from_ds_type(const value_t *val, int type,
   case DS_TYPE_COUNTER:
     *value = (long)((val->counter * scale) + shift);
     break;
-  case DS_TYPE_ABSOLUTE:
-    *value = (long)((val->absolute * scale) + shift);
-    break;
   case DS_TYPE_DERIVE:
     *value = (long)((val->derive * scale) + shift);
     break;
index 4cb7ea5e412efa2c020a29ecff3f9b71a720a891..04f2c60dabd345d9900a0d46c8f68905da36f325 100644 (file)
@@ -118,12 +118,6 @@ static int ctail_config_add_match_dstype(ctail_config_match_t *cm,
       cm->flags |= UTILS_MATCH_CF_DERIVE_INC;
     else
       cm->flags = 0;
-  } else if (strncasecmp("Absolute", ds_type, strlen("Absolute")) == 0) {
-    cm->flags = UTILS_MATCH_DS_TYPE_ABSOLUTE;
-    if (strcasecmp("AbsoluteSet", ds_type) == 0)
-      cm->flags |= UTILS_MATCH_CF_ABSOLUTE_SET;
-    else
-      cm->flags = 0;
   } else {
     cm->flags = 0;
   }
index 4a9e9df4a9b8eae27c9a2b301a38c27913620dbd..b0b61139b0fdc3295ec113fbc8fd4a2f8f4c9c65 100644 (file)
@@ -220,49 +220,6 @@ static int ts_invoke_derive(const data_set_t *ds, value_list_t *vl, /* {{{ */
   return 0;
 } /* }}} int ts_invoke_derive */
 
-static int ts_invoke_absolute(const data_set_t *ds, value_list_t *vl, /* {{{ */
-                              ts_data_t *data, int dsrc_index) {
-  uint64_t curr_absolute;
-  double rate;
-  int status;
-
-  /* Required meta data */
-  double int_fraction;
-  char key_int_fraction[128];
-
-  curr_absolute = (uint64_t)vl->values[dsrc_index].absolute;
-
-  snprintf(key_int_fraction, sizeof(key_int_fraction),
-           "target_scale[%p,%i]:int_fraction", (void *)data, dsrc_index);
-
-  int_fraction = 0.0;
-
-  /* Query the meta data */
-  status = uc_meta_data_get_double(vl, key_int_fraction, &int_fraction);
-  if (status != 0)
-    int_fraction = 0.0;
-
-  rate = ((double)curr_absolute) / CDTIME_T_TO_DOUBLE(vl->interval);
-
-  /* Modify the rate. */
-  if (!isnan(data->factor))
-    rate *= data->factor;
-  if (!isnan(data->offset))
-    rate += data->offset;
-
-  /* Calculate the new absolute. */
-  int_fraction += (rate * CDTIME_T_TO_DOUBLE(vl->interval));
-  curr_absolute = (uint64_t)int_fraction;
-  int_fraction -= ((double)curr_absolute);
-
-  vl->values[dsrc_index].absolute = (absolute_t)curr_absolute;
-
-  /* Update to the new absolute value */
-  uc_meta_data_add_double(vl, key_int_fraction, int_fraction);
-
-  return 0;
-} /* }}} int ts_invoke_absolute */
-
 static int ts_config_set_double(double *ret, oconfig_item_t *ci) /* {{{ */
 {
   if ((ci->values_num != 1) || (ci->values[0].type != OCONFIG_TYPE_NUMBER)) {
@@ -439,8 +396,6 @@ static int ts_invoke(const data_set_t *ds, value_list_t *vl, /* {{{ */
       ts_invoke_gauge(ds, vl, data, i);
     else if (ds->ds[i].type == DS_TYPE_DERIVE)
       ts_invoke_derive(ds, vl, data, i);
-    else if (ds->ds[i].type == DS_TYPE_ABSOLUTE)
-      ts_invoke_absolute(ds, vl, data, i);
     else
       ERROR("Target `scale': Ignoring unknown data source type %i",
             ds->ds[i].type);
index c41c22e63a1ce8193095ff983de9e6604580ee40..c4db1189ecc666ca1124d0ddb62f2c1c683a925c 100644 (file)
@@ -1,4 +1,3 @@
-absolute                value:ABSOLUTE:0:U
 apache_bytes            value:DERIVE:0:U
 apache_connections      value:GAUGE:0:65535
 apache_idle_workers     value:GAUGE:0:65535
index 92f9e1ed49bd6725241bc102282664f69a39de8c..31b18402852c65cad2612044fdcfd954bc3222f2 100644 (file)
@@ -44,9 +44,7 @@ names must be unique within a data set.
 
 =item
 
-I<ds-type> may be B<DERIVE>, B<GAUGE>, or B<COUNTER>. For historic reasons a
-type called B<ABSOLUTE> is also supported, but its use is strongly discouraged,
-and it should not be used for new metric type definitions.
+I<ds-type> may be B<DERIVE>, B<GAUGE>, or B<COUNTER>.
 
 =item
 
index 4a106897cf14db059b44098e77d41a6366410ac6..015bb51acd36ae8a6684fe28f2b209046c65ecbc 100644 (file)
@@ -929,8 +929,6 @@ int format_values(char *ret, size_t ret_len, /* {{{ */
       strbuf_printf(&buf, ":%" PRIu64, (uint64_t)vl->values[i].counter);
     else if (ds->ds[i].type == DS_TYPE_DERIVE)
       strbuf_printf(&buf, ":%" PRIi64, vl->values[i].derive);
-    else if (ds->ds[i].type == DS_TYPE_ABSOLUTE)
-      strbuf_printf(&buf, ":%" PRIu64, vl->values[i].absolute);
     else {
       ERROR("format_values: Unknown data source type: %i", ds->ds[i].type);
       sfree(rates);
@@ -1058,10 +1056,6 @@ int parse_value(const char *value_orig, value_t *ret_value, int ds_type) {
     ret_value->derive = (derive_t)strtoll(value, &endptr, 0);
     break;
 
-  case DS_TYPE_ABSOLUTE:
-    ret_value->absolute = (absolute_t)strtoull(value, &endptr, 0);
-    break;
-
   default:
     sfree(value);
     P_ERROR("parse_value: Invalid data source type: %i.", ds_type);
@@ -1334,8 +1328,7 @@ int rate_to_value(value_t *ret_value, gauge_t rate, /* {{{ */
   /* Counter and absolute can't handle negative rates. Reset "last time"
    * to zero, so that the next valid rate will re-initialize the
    * structure. */
-  if ((rate < 0.0) &&
-      ((ds_type == DS_TYPE_COUNTER) || (ds_type == DS_TYPE_ABSOLUTE))) {
+  if ((rate < 0.0) && (ds_type == DS_TYPE_COUNTER)) {
     memset(state, 0, sizeof(*state));
     return EINVAL;
   }
@@ -1358,9 +1351,6 @@ int rate_to_value(value_t *ret_value, gauge_t rate, /* {{{ */
     } else if (ds_type == DS_TYPE_COUNTER) {
       state->last_value.counter = (counter_t)rate;
       state->residual = rate - ((gauge_t)state->last_value.counter);
-    } else if (ds_type == DS_TYPE_ABSOLUTE) {
-      state->last_value.absolute = (absolute_t)rate;
-      state->residual = rate - ((gauge_t)state->last_value.absolute);
     } else {
       assert(23 == 42);
     }
@@ -1379,11 +1369,6 @@ int rate_to_value(value_t *ret_value, gauge_t rate, /* {{{ */
 
     state->last_value.counter += delta_counter;
     state->residual = delta_gauge - ((gauge_t)delta_counter);
-  } else if (ds_type == DS_TYPE_ABSOLUTE) {
-    absolute_t delta_absolute = (absolute_t)delta_gauge;
-
-    state->last_value.absolute = delta_absolute;
-    state->residual = delta_gauge - ((gauge_t)delta_absolute);
   } else {
     assert(23 == 42);
   }
@@ -1428,11 +1413,6 @@ int value_to_rate(gauge_t *ret_rate, /* {{{ */
     *ret_rate = ((gauge_t)diff) / ((gauge_t)interval);
     break;
   }
-  case DS_TYPE_ABSOLUTE: {
-    absolute_t diff = value.absolute;
-    *ret_rate = ((gauge_t)diff) / ((gauge_t)interval);
-    break;
-  }
   default:
     return EINVAL;
   }
index 0cb31d19e4fac84a39d6b817e8d5b8d1498e3c45..ec7b08924e9193486103bcb05b999dcd130d7dbd 100644 (file)
@@ -92,8 +92,6 @@ static int gr_format_values(char *ret, size_t ret_len, int ds_num,
     BUFFER_ADD("%" PRIu64, (uint64_t)vl->values[ds_num].counter);
   else if (ds->ds[ds_num].type == DS_TYPE_DERIVE)
     BUFFER_ADD("%" PRIi64, vl->values[ds_num].derive);
-  else if (ds->ds[ds_num].type == DS_TYPE_ABSOLUTE)
-    BUFFER_ADD("%" PRIu64, vl->values[ds_num].absolute);
   else {
     P_ERROR("gr_format_values: Unknown data source type: %i",
             ds->ds[ds_num].type);
index ac3729acfb2588b598c0c27d9df6ba8e524bb40e..3ac3205a12e4ae9e5c38f87db6b40973ae747a20 100644 (file)
@@ -133,8 +133,6 @@ static int values_to_json(char *buffer, size_t buffer_size, /* {{{ */
       BUFFER_ADD("%" PRIu64, (uint64_t)vl->values[i].counter);
     else if (ds->ds[i].type == DS_TYPE_DERIVE)
       BUFFER_ADD("%" PRIi64, vl->values[i].derive);
-    else if (ds->ds[i].type == DS_TYPE_ABSOLUTE)
-      BUFFER_ADD("%" PRIu64, vl->values[i].absolute);
     else {
       ERROR("format_json: Unknown data source type: %i", ds->ds[i].type);
       sfree(rates);
index 3f29fcd963b590fbe3ad8420e4d4b44b4984c3a6..51e8d925d13f8f43c8724cb69526bcd70d912350 100644 (file)
@@ -160,11 +160,6 @@ static int values_to_kairosdb(char *buffer, size_t buffer_size, /* {{{ */
     BUFFER_ADD("%" PRIu64, CDTIME_T_TO_MS(vl->time));
     BUFFER_ADD(",");
     BUFFER_ADD("%" PRIi64, vl->values[ds_idx].derive);
-  } else if (ds->ds[ds_idx].type == DS_TYPE_ABSOLUTE) {
-    BUFFER_ADD("[[");
-    BUFFER_ADD("%" PRIu64, CDTIME_T_TO_MS(vl->time));
-    BUFFER_ADD(",");
-    BUFFER_ADD("%" PRIu64, vl->values[ds_idx].absolute);
   } else {
     ERROR("format_kairosdb: Unknown data source type: %i", ds->ds[ds_idx].type);
     sfree(rates);
index 3c45aacb42192dd2e0522178168b0950691f807c..1c27119bb5e44e24982a1b5d74e09e1d0648ed89 100644 (file)
@@ -153,10 +153,6 @@ static int format_typed_value(yajl_gen gen, int ds_type, value_t v,
     ssnprintf(integer, sizeof(integer), "%llu", diff);
     break;
   }
-  case DS_TYPE_ABSOLUTE: {
-    ssnprintf(integer, sizeof(integer), "%" PRIu64, v.absolute);
-    break;
-  }
   default: {
     ERROR("format_typed_value: unknown value type %d.", ds_type);
     return EINVAL;
@@ -182,7 +178,6 @@ static int format_typed_value(yajl_gen gen, int ds_type, value_t v,
 static int format_metric_kind(yajl_gen gen, int ds_type) {
   switch (ds_type) {
   case DS_TYPE_GAUGE:
-  case DS_TYPE_ABSOLUTE:
     return json_string(gen, "GAUGE");
   case DS_TYPE_COUNTER:
   case DS_TYPE_DERIVE:
index ca6f1aaa7779a86b2a54da95636b3ab52e56f6aa..a287606954fa58ffedb0fd4827c5bda170ae94a5 100644 (file)
@@ -174,25 +174,6 @@ static int default_callback(const char __attribute__((unused)) * str,
       return -1;
     }
 
-    data->values_num++;
-  } else if (data->ds_type & UTILS_MATCH_DS_TYPE_ABSOLUTE) {
-    absolute_t value;
-    char *endptr = NULL;
-
-    if (matches_num < 2)
-      return -1;
-
-    value = (absolute_t)strtoull(matches[1], &endptr, 0);
-    if (matches[1] == endptr)
-      return -1;
-
-    if (data->ds_type & UTILS_MATCH_CF_ABSOLUTE_SET)
-      data->value.absolute = value;
-    else {
-      ERROR("utils_match: default_callback: obj->ds_type is invalid!");
-      return -1;
-    }
-
     data->values_num++;
   } else {
     ERROR("utils_match: default_callback: obj->ds_type is invalid!");
index c4aee0a1c871f1f112f857344cec35e637496f35..7a0087f0448ba6acfc6ce632bebd590d183632c5 100644 (file)
@@ -39,7 +39,6 @@
 #define UTILS_MATCH_DS_TYPE_GAUGE 0x1000
 #define UTILS_MATCH_DS_TYPE_COUNTER 0x2000
 #define UTILS_MATCH_DS_TYPE_DERIVE 0x4000
-#define UTILS_MATCH_DS_TYPE_ABSOLUTE 0x8000
 
 #define UTILS_MATCH_CF_GAUGE_AVERAGE 0x01
 #define UTILS_MATCH_CF_GAUGE_MIN 0x02
 #define UTILS_MATCH_CF_DERIVE_ADD 0x02
 #define UTILS_MATCH_CF_DERIVE_INC 0x04
 
-#define UTILS_MATCH_CF_ABSOLUTE_SET 0x01
-#define UTILS_MATCH_CF_ABSOLUTE_ADD 0x02
-#define UTILS_MATCH_CF_ABSOLUTE_INC 0x04
-
 /*
  * Data types
  */
index f543e11caf5343c95c12a5f18bdf2a405d6105f4..1d94593afee607c590a752a98938b54df599cdf0 100644 (file)
@@ -268,8 +268,6 @@ static int ds_get(char ***ret, /* {{{ */
       type = "GAUGE";
     else if (d->type == DS_TYPE_DERIVE)
       type = "DERIVE";
-    else if (d->type == DS_TYPE_ABSOLUTE)
-      type = "ABSOLUTE";
     else {
       P_ERROR("ds_get: Unknown DS type: %i", d->type);
       break;
@@ -343,7 +341,7 @@ static int srrd_create(const char *filename, /* {{{ */
 
   return status;
 } /* }}} int srrd_create */
-  /* #endif HAVE_THREADSAFE_LIBRRD */
+/* #endif HAVE_THREADSAFE_LIBRRD */
 
 #else  /* !HAVE_THREADSAFE_LIBRRD */
 static int srrd_create(const char *filename, /* {{{ */
index d0de9085b66a721b5be102ec89be9491fcbd2932..bbec52c69e9d0f6bde22d34928e5b1a36397bf5c 100644 (file)
@@ -173,8 +173,6 @@ value_t luaC_tovalue(lua_State *L, int idx, int ds_type) /* {{{ */
     v.derive = (derive_t)lua_tointeger(L, /* stack pos = */ -1);
   else if (ds_type == DS_TYPE_COUNTER)
     v.counter = (counter_t)lua_tointeger(L, /* stack pos = */ -1);
-  else if (ds_type == DS_TYPE_ABSOLUTE)
-    v.absolute = (absolute_t)lua_tointeger(L, /* stack pos = */ -1);
 
   return v;
 } /* }}} value_t luaC_tovalue */
@@ -271,8 +269,6 @@ int luaC_pushvalue(lua_State *L, value_t v, int ds_type) /* {{{ */
     lua_pushinteger(L, (lua_Integer)v.derive);
   else if (ds_type == DS_TYPE_COUNTER)
     lua_pushinteger(L, (lua_Integer)v.counter);
-  else if (ds_type == DS_TYPE_ABSOLUTE)
-    lua_pushinteger(L, (lua_Integer)v.absolute);
   else
     return -1;
   return 0;
index 8e3e90e4ab34a9603d74ff73a60dcd79ed78a4af..32c8699a32ef0b6f5e33d09146fd86823a2b3763 100644 (file)
@@ -414,8 +414,7 @@ static int write_influxdb_point(char *buffer, int buffer_len,
   for (size_t i = 0; i < ds->ds_num; i++) {
     if ((ds->ds[i].type != DS_TYPE_COUNTER) &&
         (ds->ds[i].type != DS_TYPE_GAUGE) &&
-        (ds->ds[i].type != DS_TYPE_DERIVE) &&
-        (ds->ds[i].type != DS_TYPE_ABSOLUTE)) {
+        (ds->ds[i].type != DS_TYPE_DERIVE)) {
       sfree(rates);
       return -1;
     }
@@ -452,11 +451,6 @@ static int write_influxdb_point(char *buffer, int buffer_len,
         BUFFER_ADD(",");
       BUFFER_ADD("%s=%" PRIi64 "i", ds->ds[i].name, vl->values[i].derive);
       have_values = true;
-    } else if (ds->ds[i].type == DS_TYPE_ABSOLUTE) {
-      if (have_values)
-        BUFFER_ADD(",");
-      BUFFER_ADD("%s=%" PRIu64 "i", ds->ds[i].name, vl->values[i].absolute);
-      have_values = true;
     }
 
   } /* for ds->ds_num */
index b43906e6326c949b12ec46ac4561e3278c621f3f..34611b752cb7c63dcd6b7e57df5432ef3f869be9 100644 (file)
@@ -106,8 +106,6 @@ static bson_t *wm_create_bson(const data_set_t *ds, /* {{{ */
       BSON_APPEND_INT64(&subarray, key, vl->values[i].counter);
     else if (ds->ds[i].type == DS_TYPE_DERIVE)
       BSON_APPEND_INT64(&subarray, key, vl->values[i].derive);
-    else if (ds->ds[i].type == DS_TYPE_ABSOLUTE)
-      BSON_APPEND_INT64(&subarray, key, vl->values[i].absolute);
     else {
       ERROR("write_mongodb plugin: Unknown ds_type %d for index %" PRIsz,
             ds->ds[i].type, i);
index b9040223bcc0559855f4f2dd6f9e59cc473fcb53..ab836a895713f8b63dd746530596742c9f6d68f3 100644 (file)
@@ -474,9 +474,6 @@ static int metric_update(Io__Prometheus__Client__Metric *m, value_t value,
     }
 
     switch (ds_type) {
-    case DS_TYPE_ABSOLUTE:
-      m->counter->value = (double)value.absolute;
-      break;
     case DS_TYPE_COUNTER:
       m->counter->value = (double)value.counter;
       break;
index 20e5dc2435cc4041d9417e6b1c489773063d1c22..2d8b31bf42d8bf32e27f248660014286c8e9b17b 100644 (file)
@@ -384,8 +384,6 @@ wrr_value_to_event(struct riemann_host const *host, /* {{{ */
 
     if (ds->ds[index].type == DS_TYPE_DERIVE)
       metric = (int64_t)vl->values[index].derive;
-    else if (ds->ds[index].type == DS_TYPE_ABSOLUTE)
-      metric = (int64_t)vl->values[index].absolute;
     else
       metric = (int64_t)vl->values[index].counter;
 
index 03e633be408e8525f71f2a4529a025db672d9a67..5a2065f12764fed4fc4801c29f6af77f057b07c2 100644 (file)
@@ -521,13 +521,6 @@ static char *sensu_value_to_json(struct sensu_host const *host, /* {{{ */
         ERROR("write_sensu plugin: Unable to alloc memory");
         return NULL;
       }
-    } else if (ds->ds[index].type == DS_TYPE_ABSOLUTE) {
-      res = my_asprintf(&value_str, "%" PRIu64, vl->values[index].absolute);
-      if (res == -1) {
-        free(ret_str);
-        ERROR("write_sensu plugin: Unable to alloc memory");
-        return NULL;
-      }
     } else {
       res = my_asprintf(&value_str, "%" PRIu64,
                         (uint64_t)vl->values[index].counter);
index 92c5ddeba4192a99bfdc357dea133dc7c4f58fa5..b1daf412a8375c192b89e353dcad9ed4f5413cd7 100644 (file)
@@ -357,8 +357,6 @@ static int ws_format_values(char *ret, size_t ret_len, int ds_num,
     BUFFER_ADD("%" PRIu64, (uint64_t)vl->values[ds_num].counter);
   else if (ds->ds[ds_num].type == DS_TYPE_DERIVE)
     BUFFER_ADD("%" PRIi64, vl->values[ds_num].derive);
-  else if (ds->ds[ds_num].type == DS_TYPE_ABSOLUTE)
-    BUFFER_ADD("%" PRIu64, vl->values[ds_num].absolute);
   else {
     ERROR("format_values plugin: Unknown data source type: %i",
           ds->ds[ds_num].type);
index f8f4cb9104efb1753a875402510ecabc0eb1adc3..43d09bab68ac7b271ffcead78e22b85cb652c94b 100644 (file)
@@ -350,8 +350,6 @@ static int wt_format_values(char *ret, size_t ret_len, int ds_num,
     BUFFER_ADD("%" PRIu64, (uint64_t)vl->values[ds_num].counter);
   else if (ds->ds[ds_num].type == DS_TYPE_DERIVE)
     BUFFER_ADD("%" PRIi64, vl->values[ds_num].derive);
-  else if (ds->ds[ds_num].type == DS_TYPE_ABSOLUTE)
-    BUFFER_ADD("%" PRIu64, vl->values[ds_num].absolute);
   else {
     ERROR("format_values plugin: Unknown data source type: %i",
           ds->ds[ds_num].type);