summaryrefslogtreecommitdiffstats
path: root/ml/ml-private.h
diff options
context:
space:
mode:
Diffstat (limited to 'ml/ml-private.h')
-rw-r--r--ml/ml-private.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/ml/ml-private.h b/ml/ml-private.h
index f0e2e7eaf..f373456fa 100644
--- a/ml/ml-private.h
+++ b/ml/ml-private.h
@@ -8,6 +8,7 @@
#include <vector>
#include <queue>
+#include <unordered_map>
typedef double calculated_number_t;
typedef dlib::matrix<calculated_number_t, 6, 1> DSample;
@@ -211,6 +212,12 @@ typedef struct {
void ml_chart_update_dimension(ml_chart_t *chart, ml_dimension_t *dim, bool is_anomalous);
typedef struct {
+ RRDDIM *rd;
+ size_t normal_dimensions;
+ size_t anomalous_dimensions;
+} ml_type_anomaly_rate_t;
+
+typedef struct {
RRDHOST *rh;
std::atomic<bool> ml_running;
@@ -255,6 +262,9 @@ typedef struct {
RRDSET *detector_events_rs;
RRDDIM *detector_events_above_threshold_rd;
RRDDIM *detector_events_new_anomaly_event_rd;
+
+ RRDSET *type_anomaly_rate_rs;
+ std::unordered_map<STRING *, ml_type_anomaly_rate_t> type_anomaly_rate;
} ml_host_t;
typedef struct {
@@ -291,6 +301,9 @@ typedef struct {
RRDDIM *training_results_not_enough_collected_values_rd;
RRDDIM *training_results_null_acquired_dimension_rd;
RRDDIM *training_results_chart_under_replication_rd;
+
+ size_t num_db_transactions;
+ size_t num_models_to_prune;
} ml_training_thread_t;
typedef struct {
@@ -301,6 +314,7 @@ typedef struct {
unsigned train_every;
unsigned num_models_to_use;
+ unsigned delete_models_older_than;
unsigned db_engine_anomaly_rate_every;