| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | |
| 3 | #ifndef NETDATA_ML_ENUMS_H |
| 4 | #define NETDATA_ML_ENUMS_H |
| 5 | |
| 6 | enum ml_metric_type : unsigned char { |
| 7 | // The dimension has constant values, no need to train |
| 8 | METRIC_TYPE_CONSTANT, |
| 9 | |
| 10 | // The dimension's values fluctuate, we need to generate a model |
| 11 | METRIC_TYPE_VARIABLE, |
| 12 | }; |
| 13 | |
| 14 | const char *ml_metric_type_to_string(enum ml_metric_type mt); |
| 15 | |
| 16 | enum ml_machine_learning_status : unsigned char { |
| 17 | // Enable training/prediction |
| 18 | MACHINE_LEARNING_STATUS_ENABLED, |
| 19 | |
| 20 | // Disable because configuration pattern matches the chart's id |
| 21 | MACHINE_LEARNING_STATUS_DISABLED_DUE_TO_EXCLUDED_CHART, |
| 22 | }; |
| 23 | |
| 24 | const char *ml_machine_learning_status_to_string(enum ml_machine_learning_status mls); |
| 25 | |
| 26 | enum ml_training_status : unsigned char { |
| 27 | // We don't have a model for this dimension |
| 28 | TRAINING_STATUS_UNTRAINED, |
| 29 | |
| 30 | // Have a valid, up-to-date model |
| 31 | TRAINING_STATUS_TRAINED, |
| 32 | |
| 33 | // Have a valid, up-to-date model that is silenced because its too noisy |
| 34 | TRAINING_STATUS_SILENCED, |
| 35 | }; |
| 36 | |
| 37 | const char *ml_training_status_to_string(enum ml_training_status ts); |
| 38 | |
| 39 | enum ml_worker_result { |
| 40 | // We managed to create a KMeans model |
| 41 | ML_WORKER_RESULT_OK, |
| 42 | |
| 43 | // Could not query DB with a correct time range |
| 44 | ML_WORKER_RESULT_INVALID_QUERY_TIME_RANGE, |
| 45 | |
| 46 | // Did not gather enough data from DB to run KMeans |
| 47 | ML_WORKER_RESULT_NOT_ENOUGH_COLLECTED_VALUES, |
| 48 | |
| 49 | // Acquired a null dimension |
| 50 | ML_WORKER_RESULT_NULL_ACQUIRED_DIMENSION, |
| 51 | |
| 52 | // Chart is under replication |
| 53 | ML_WORKER_RESULT_CHART_UNDER_REPLICATION, |
| 54 | |
| 55 | // This dimension is now supplied by downstream ML models; stop local requeueing |
| 56 | ML_WORKER_RESULT_DOWNSTREAM_MODEL_SUPPLIED, |
| 57 | |
| 58 | // Another worker is already training this dimension; the item is requeued |
| 59 | // so the dim stays in the periodic retrain cycle. |
| 60 | ML_WORKER_RESULT_TRAINING_IN_PROGRESS, |
| 61 | }; |
| 62 | |
| 63 | const char *ml_worker_result_to_string(enum ml_worker_result tr); |
| 64 | |
| 65 | enum ml_queue_item_type { |
| 66 | ML_QUEUE_ITEM_TYPE_CREATE_NEW_MODEL, |
| 67 | ML_QUEUE_ITEM_TYPE_ADD_EXISTING_MODEL, |
| 68 | ML_QUEUE_ITEM_STOP_REQUEST, |
| 69 | }; |
| 70 | |
| 71 | const char *ml_queue_item_type_to_string(enum ml_queue_item_type qit); |
| 72 | |
| 73 | #endif /* NETDATA_ML_ENUMS_H */ |