From 37a06960f90c046f21c125c2b4265713da04f851 Mon Sep 17 00:00:00 2001 From: vkalintiris Date: Fri, 10 Mar 2023 12:20:40 +0200 Subject: Refactor ML code. (#14659) * Refactor ML code. This commit introduces only non-functional changes. Originally, the C++ code exposed C functions to be called from the rest of the agent. When we migrated from C++ to C, we did not eliminate these wrapper functions to make the PR easier to understand and keep the total LOC low. This commit removes the wrapper functions and "reclaims" the `ml_` prefix that we used for the public API of the old implementation. Also, the nlohmann Json library has been removed and its functionality was replaced with the equivalent Json functionality that we added in libnetdata's BUFFERs. * Remove missing headers from build systems. * Fix CMake build. * rrddim_free is outside of rrd "internals" now. --- collectors/plugins.d/pluginsd_parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'collectors') diff --git a/collectors/plugins.d/pluginsd_parser.c b/collectors/plugins.d/pluginsd_parser.c index 787f85d358..28fc0bd496 100644 --- a/collectors/plugins.d/pluginsd_parser.c +++ b/collectors/plugins.d/pluginsd_parser.c @@ -1693,10 +1693,10 @@ PARSER_RC pluginsd_set_v2(char **words, size_t num_words, void *user) { flags = SN_EMPTY_SLOT; if(u->v2.ml_locked) - ml_is_anomalous(rd, u->v2.end_time, 0, false); + ml_dimension_is_anomalous(rd, u->v2.end_time, 0, false); } else if(u->v2.ml_locked) { - if (ml_is_anomalous(rd, u->v2.end_time, value, true)) { + if (ml_dimension_is_anomalous(rd, u->v2.end_time, value, true)) { // clear anomaly bit: 0 -> is anomalous, 1 -> not anomalous flags &= ~((storage_number) SN_FLAG_NOT_ANOMALOUS); } -- cgit v1.2.3