diff options
author | vkalintiris <vasilis@netdata.cloud> | 2021-12-22 11:15:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-22 11:15:53 +0200 |
commit | df8930ddd370b2a9fec96b1cbb45e8ae530c0aad (patch) | |
tree | f745ec451109f68b1301d16bbebe74d99c3f6dd3 /streaming | |
parent | e167d2d2d3fed0e4f4a803ca8b0210c3ffa843fe (diff) |
Send ML feature information with UpdateNodeInfo. (#11913)
* Send ML feature information with UpdateNodeInfo.
We achieve this by adding the `ml_{capable,enabled}` fields in
`system_info`. When streaming, these fields allow a parent to understand if
the child has ML and if it runs ML for itself.
The UpdateNodeInfo includes this information about a child, plus a
boolean that is set to true when the parent runs ML for the child.
* Fix unit test and building with --disable-ml.
* Refactoring to use the new MachineLearningInfo message
* Update aclk-schemas repository to include latest ML info message.
Diffstat (limited to 'streaming')
-rw-r--r-- | streaming/rrdpush.c | 4 | ||||
-rw-r--r-- | streaming/sender.c | 18 |
2 files changed, 21 insertions, 1 deletions
diff --git a/streaming/rrdpush.c b/streaming/rrdpush.c index 53a8976999..be94742168 100644 --- a/streaming/rrdpush.c +++ b/streaming/rrdpush.c @@ -522,6 +522,10 @@ int rrdpush_receiver_thread_spawn(struct web_client *w, char *url) { utc_offset = (int32_t)strtol(value, NULL, 0); else if(!strcmp(name, "hops")) system_info->hops = (uint16_t) strtoul(value, NULL, 0); + else if(!strcmp(name, "ml_capable")) + system_info->ml_capable = strtoul(value, NULL, 0); + else if(!strcmp(name, "ml_enabled")) + system_info->ml_enabled = strtoul(value, NULL, 0); else if(!strcmp(name, "tags")) tags = value; else if(!strcmp(name, "ver")) diff --git a/streaming/sender.c b/streaming/sender.c index 0abfac1804..341f600ca2 100644 --- a/streaming/sender.c +++ b/streaming/sender.c @@ -214,7 +214,21 @@ static int rrdpush_sender_thread_connect_to_parent(RRDHOST *host, int default_po char http[HTTP_HEADER_SIZE + 1]; int eol = snprintfz(http, HTTP_HEADER_SIZE, - "STREAM key=%s&hostname=%s®istry_hostname=%s&machine_guid=%s&update_every=%d&os=%s&timezone=%s&abbrev_timezone=%s&utc_offset=%d&hops=%d&tags=%s&ver=%u" + "STREAM " + "key=%s" + "&hostname=%s" + "®istry_hostname=%s" + "&machine_guid=%s" + "&update_every=%d" + "&os=%s" + "&timezone=%s" + "&abbrev_timezone=%s" + "&utc_offset=%d" + "&hops=%d" + "&ml_capable=%d" + "&ml_enabled=%d" + "&tags=%s" + "&ver=%u" "&NETDATA_SYSTEM_OS_NAME=%s" "&NETDATA_SYSTEM_OS_ID=%s" "&NETDATA_SYSTEM_OS_ID_LIKE=%s" @@ -253,6 +267,8 @@ static int rrdpush_sender_thread_connect_to_parent(RRDHOST *host, int default_po , host->abbrev_timezone , host->utc_offset , host->system_info->hops + 1 + , host->system_info->ml_capable + , host->system_info->ml_enabled , (host->tags) ? host->tags : "" , STREAMING_PROTOCOL_CURRENT_VERSION , se.os_name |