X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fplugin.h;h=b35fcf189874b452aff00c03138ec068db54b36a;hb=9c98fa31ef50a6ff849d36cac4f5297faa6f7909;hp=fd741501d8cc9724f7889a75ebda9c931486377b;hpb=25ac639c505394e4ae9600ee62f5d5aeea97c6d4;p=collectd.git diff --git a/src/plugin.h b/src/plugin.h index fd741501..b35fcf18 100644 --- a/src/plugin.h +++ b/src/plugin.h @@ -28,10 +28,17 @@ #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_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 @@ -60,15 +67,15 @@ */ typedef unsigned long long counter_t; typedef double gauge_t; -typedef unsigned long long derive_t; -typedef unsigned long long absolute_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; + absolute_t absolute; }; typedef union value_u value_t;