X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fplugin.h;h=b35fcf189874b452aff00c03138ec068db54b36a;hb=4858a84e3e51830a103a5ff4aee6b844b708ce62;hp=e54b27d69e554628060e08f686e18aa76a45fe70;hpb=9d15d1058b93acb7be041934acfe76548539041a;p=collectd.git diff --git a/src/plugin.h b/src/plugin.h index e54b27d6..b35fcf18 100644 --- a/src/plugin.h +++ b/src/plugin.h @@ -24,11 +24,21 @@ #include "collectd.h" #include "configfile.h" +#include "meta_data.h" #define DATA_MAX_NAME_LEN 64 -#define DS_TYPE_COUNTER 0 -#define DS_TYPE_GAUGE 1 +#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" + #ifndef LOG_ERR # define LOG_ERR 3 @@ -57,11 +67,15 @@ */ 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; + counter_t counter; + gauge_t gauge; + derive_t derive; + absolute_t absolute; }; typedef union value_u value_t; @@ -76,11 +90,12 @@ struct value_list_s char plugin_instance[DATA_MAX_NAME_LEN]; char type[DATA_MAX_NAME_LEN]; char type_instance[DATA_MAX_NAME_LEN]; + meta_data_t *meta; }; typedef struct value_list_s value_list_t; -#define VALUE_LIST_INIT { NULL, 0, 0, interval_g, "localhost", "", "", "", "" } -#define VALUE_LIST_STATIC { NULL, 0, 0, 0, "localhost", "", "", "", "" } +#define VALUE_LIST_INIT { NULL, 0, 0, interval_g, "localhost", "", "", "", "", NULL } +#define VALUE_LIST_STATIC { NULL, 0, 0, 0, "localhost", "", "", "", "", NULL } struct data_source_s {