X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fwrite_riemann_threshold.c;h=041ed7d5ad7de462300179ab22a6a24498a77ae8;hp=35f3814a5f26b8c4d64bf47867f658fce80ac05b;hb=54619dc85fd308b21ed09a0271e5c7383c7921b9;hpb=af12cc40e48331f8c98294239cef60393218a46d diff --git a/src/write_riemann_threshold.c b/src/write_riemann_threshold.c index 35f3814a..041ed7d5 100644 --- a/src/write_riemann_threshold.c +++ b/src/write_riemann_threshold.c @@ -27,9 +27,9 @@ #include "collectd.h" -#include "common.h" #include "plugin.h" -#include "utils_avltree.h" +#include "utils/avltree/avltree.h" +#include "utils/common/common.h" #include "utils_cache.h" #include "utils_threshold.h" #include "write_riemann_threshold.h" @@ -63,7 +63,7 @@ static int ut_check_one_data_source( if (ds != NULL) { ds_name = ds->ds[ds_index].name; if ((th->data_source[0] != 0) && (strcmp(ds_name, th->data_source) != 0)) - return STATE_OKAY; + return STATE_UNKNOWN; } if ((th->flags & UT_FLAG_INVERT) != 0) { @@ -73,8 +73,9 @@ static int ut_check_one_data_source( /* XXX: This is an experimental code, not optimized, not fast, not reliable, * and probably, do not work as you expect. Enjoy! :D */ - if ((th->hysteresis > 0) && - ((prev_state = uc_get_state(ds, vl)) != STATE_OKAY)) { + prev_state = uc_get_state(ds, vl); + if ((th->hysteresis > 0) && (prev_state != STATE_OKAY) && + (prev_state != STATE_UNKNOWN)) { switch (prev_state) { case STATE_ERROR: if ((!isnan(th->failure_min) &&