diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-06-09 04:52:47 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-06-09 04:52:57 +0000 |
commit | 00151562145df50cc65e9902d52d5fa77f89fe50 (patch) | |
tree | 2737716802f6725a5074d606ec8fe5422c58a83c /registry/registry.c | |
parent | Releasing debian version 1.34.1-1. (diff) | |
download | netdata-00151562145df50cc65e9902d52d5fa77f89fe50.tar.xz netdata-00151562145df50cc65e9902d52d5fa77f89fe50.zip |
Merging upstream version 1.35.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | registry/registry.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/registry/registry.c b/registry/registry.c index 64053fe2..a4f9c6de 100644 --- a/registry/registry.c +++ b/registry/registry.c @@ -108,7 +108,9 @@ static int registry_json_person_url_callback(void *entry, void *data) { } // callback for rendering MACHINE_URLs -static int registry_json_machine_url_callback(void *entry, void *data) { +static int registry_json_machine_url_callback(const char *name, void *entry, void *data) { + (void)name; + REGISTRY_MACHINE_URL *mu = (REGISTRY_MACHINE_URL *)entry; struct registry_json_walk_person_urls_callback *c = (struct registry_json_walk_person_urls_callback *)data; struct web_client *w = c->w; @@ -272,7 +274,7 @@ int registry_request_search_json(RRDHOST *host, struct web_client *w, char *pers buffer_strcat(w->response.data, ",\n\t\"urls\": ["); struct registry_json_walk_person_urls_callback c = { NULL, m, w, 0 }; - dictionary_get_all(m->machine_urls, registry_json_machine_url_callback, &c); + dictionary_walkthrough_read(m->machine_urls, registry_json_machine_url_callback, &c); buffer_strcat(w->response.data, "\n\t]\n"); registry_json_footer(w); @@ -441,10 +443,10 @@ void registry_statistics(void) { } else rrdset_next(stm); - rrddim_set(stm, "persons", registry.persons_memory + registry.persons_count * sizeof(NAME_VALUE) + sizeof(DICTIONARY)); - rrddim_set(stm, "machines", registry.machines_memory + registry.machines_count * sizeof(NAME_VALUE) + sizeof(DICTIONARY)); + rrddim_set(stm, "persons", registry.persons_memory + dictionary_stats_allocated_memory(registry.persons)); + rrddim_set(stm, "machines", registry.machines_memory + dictionary_stats_allocated_memory(registry.machines)); rrddim_set(stm, "urls", registry.urls_memory); rrddim_set(stm, "persons_urls", registry.persons_urls_memory); - rrddim_set(stm, "machines_urls", registry.machines_urls_memory + registry.machines_count * sizeof(DICTIONARY) + registry.machines_urls_count * sizeof(NAME_VALUE)); + rrddim_set(stm, "machines_urls", registry.machines_urls_memory); rrdset_done(stm); } |