summaryrefslogtreecommitdiffstats
path: root/ml/ml-dummy.c
diff options
context:
space:
mode:
authorvkalintiris <vasilis@netdata.cloud>2022-02-24 10:57:30 +0200
committerGitHub <noreply@github.com>2022-02-24 10:57:30 +0200
commit69ea17d6ec534e1ed796a92fd042bd76a3ca9215 (patch)
tree4345e3405b2ac1e37a9be1615d6dad799e15327d /ml/ml-dummy.c
parent8756eb80c77caf411f7fae605d3f1bb03dd60b76 (diff)
Track anomaly rates with DBEngine. (#12083)
* Track anomaly rates with DBEngine. This commit adds support for tracking anomaly rates with DBEngine. We do so by creating a single chart with id "anomaly_detection.anomaly_rates" for each trainable/predictable host, which is responsible for tracking the anomaly rate of each dimension that we train/predict for that host. The rrdset->state->is_ar_chart boolean flag is set to true only for anomaly rates charts. We use this flag to: - Disable exposing the anomaly rates charts through the functionality in backends/, exporting/ and streaming/. - Skip generation of configuration options for the name, algorithm, multiplier, divisor of each dimension in an anomaly rates chart. - Skip the creation of health variables for anomaly rates dimensions. - Skip the chart/dim queue of ACLK. - Post-process the RRDR result of an anomaly rates chart, so that we can return a sorted, trimmed number of anomalous dimensions. In a child/parent configuration where both the child and the parent run ML for the child, we want to be able to stream the rest of the ML-related charts to the parent. To be able to do this without any chart name collisions, the charts are now created on localhost and their IDs and titles have the node's machine_guid and hostname as a suffix, respectively. * Fix exporting_engine tests. * Restore default ML configuration. The reverted changes where meant for local testing only. This commit restores the default values that we want to have when someone runs anomaly detection on their node. * Set context for anomaly_detection.* charts. * Check for anomaly rates chart only with a valid pointer. * Remove duplicate code. * Use a more descriptive name for id/title pair variable
Diffstat (limited to 'ml/ml-dummy.c')
-rw-r--r--ml/ml-dummy.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/ml/ml-dummy.c b/ml/ml-dummy.c
index 222f0b0f66..3e8498afb4 100644
--- a/ml/ml-dummy.c
+++ b/ml/ml-dummy.c
@@ -4,6 +4,15 @@
#if !defined(ENABLE_ML)
+bool ml_capable() {
+ return false;
+}
+
+bool ml_enabled(RRDHOST *RH) {
+ (void) RH;
+ return false;
+}
+
void ml_init(void) {}
void ml_new_host(RRDHOST *RH) { (void) RH; }
@@ -38,4 +47,15 @@ char *ml_get_anomaly_event_info(RRDHOST *RH, const char *AnomalyDetectorName,
return NULL;
}
+void ml_process_rrdr(RRDR *R, int MaxAnomalyRates) {
+ (void) R;
+ (void) MaxAnomalyRates;
+}
+
+void ml_dimension_update_name(RRDSET *RS, RRDDIM *RD, const char *name) {
+ (void) RS;
+ (void) RD;
+ (void) name;
+}
+
#endif