ml.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // SPDX-License-Identifier: GPL-3.0-or-later
  2. #ifndef NETDATA_ML_H
  3. #define NETDATA_ML_H
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. #include "daemon/common.h"
  8. #include "web/api/queries/rrdr.h"
  9. // This is a DBEngine function redeclared here so that we can free
  10. // the anomaly rate dimension, whenever its backing dimension is freed.
  11. void rrddim_free(RRDSET *st, RRDDIM *rd);
  12. bool ml_capable();
  13. bool ml_enabled(RRDHOST *RH);
  14. void ml_init(void);
  15. void ml_host_new(RRDHOST *RH);
  16. void ml_host_delete(RRDHOST *RH);
  17. void ml_chart_new(RRDSET *RS);
  18. void ml_chart_delete(RRDSET *RS);
  19. void ml_dimension_new(RRDDIM *RD);
  20. void ml_dimension_delete(RRDDIM *RD);
  21. void ml_start_anomaly_detection_threads(RRDHOST *RH);
  22. void ml_stop_anomaly_detection_threads(RRDHOST *RH);
  23. void ml_cancel_anomaly_detection_threads(RRDHOST *RH);
  24. char *ml_get_host_info(RRDHOST *RH);
  25. char *ml_get_host_runtime_info(RRDHOST *RH);
  26. char *ml_get_host_models(RRDHOST *RH);
  27. void ml_chart_update_begin(RRDSET *RS);
  28. void ml_chart_update_end(RRDSET *RS);
  29. bool ml_is_anomalous(RRDDIM *RD, time_t curr_t, double value, bool exists);
  30. bool ml_streaming_enabled();
  31. #ifdef __cplusplus
  32. };
  33. #endif
  34. #endif /* NETDATA_ML_H */