summaryrefslogtreecommitdiffstats
path: root/registry/registry.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-06-09 04:52:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-06-09 04:52:39 +0000
commit89f3604407aff8f4cb2ed958252c61e23c767e24 (patch)
tree7fbf408102cab051557d38193524d8c6e991d070 /registry/registry.c
parentAdding upstream version 1.34.1. (diff)
downloadnetdata-89f3604407aff8f4cb2ed958252c61e23c767e24.tar.xz
netdata-89f3604407aff8f4cb2ed958252c61e23c767e24.zip
Adding upstream version 1.35.0.upstream/1.35.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'registry/registry.c')
-rw-r--r--registry/registry.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/registry/registry.c b/registry/registry.c
index 64053fe25..a4f9c6de3 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);
}