diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-01-26 18:05:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-01-26 18:05:10 +0000 |
commit | 34a0b66bc2d48223748ed1cf5bc1b305c396bd74 (patch) | |
tree | fbd36be86cc6bc4288fe627f2b5beada569848bb /ml/ml.cc | |
parent | Adding upstream version 1.32.1. (diff) | |
download | netdata-34a0b66bc2d48223748ed1cf5bc1b305c396bd74.tar.xz netdata-34a0b66bc2d48223748ed1cf5bc1b305c396bd74.zip |
Adding upstream version 1.33.0.upstream/1.33.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ml/ml.cc')
-rw-r--r-- | ml/ml.cc | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -75,7 +75,6 @@ char *ml_get_host_info(RRDHOST *RH) { if (RH && RH->ml_host) { Host *H = static_cast<Host *>(RH->ml_host); H->getConfigAsJson(ConfigJson); - H->getDetectionInfoAsJson(ConfigJson); } else { ConfigJson["enabled"] = false; } @@ -83,6 +82,19 @@ char *ml_get_host_info(RRDHOST *RH) { return strdup(ConfigJson.dump(2, '\t').c_str()); } +char *ml_get_host_runtime_info(RRDHOST *RH) { + nlohmann::json ConfigJson; + + if (RH && RH->ml_host) { + Host *H = static_cast<Host *>(RH->ml_host); + H->getDetectionInfoAsJson(ConfigJson); + } else { + return nullptr; + } + + return strdup(ConfigJson.dump(1, '\t').c_str()); +} + bool ml_is_anomalous(RRDDIM *RD, double Value, bool Exists) { Dimension *D = static_cast<Dimension *>(RD->state->ml_dimension); if (!D) |