From 758d9c405d2d768a3c125052a02c7a1503b01bd8 Mon Sep 17 00:00:00 2001 From: Costa Tsaousis Date: Sun, 9 Oct 2022 21:58:21 +0300 Subject: full memory tracking and profiling of Netdata Agent (#13789) * full memory tracking and profiling of Netdata Agent * initialize dbengine only when it is needed * handling of dbengine compiled but not available * restore unittest * restore unittest again * more improvements about ifdef dbengine * fix compilation when dbengine is not enabled * check if dbengine is enabled on exit * call freez() not free() * aral unittest * internal checks activate trace allocations; dev mode activates internal checks --- web/api/web_api_v1.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'web') diff --git a/web/api/web_api_v1.c b/web/api/web_api_v1.c index ce4f196be9..9b1b10c3ca 100644 --- a/web/api/web_api_v1.c +++ b/web/api/web_api_v1.c @@ -1621,9 +1621,14 @@ int web_client_api_request_v1_dbengine_stats(RRDHOST *host __maybe_unused, struc BUFFER *wb = w->response.data; buffer_flush(wb); + + if(!dbengine_enabled) { + buffer_strcat(wb, "dbengine is not enabled"); + return HTTP_RESP_NOT_FOUND; + } + wb->contenttype = CT_APPLICATION_JSON; buffer_no_cacheable(wb); - buffer_strcat(wb, "{"); for(int tier = 0; tier < storage_tiers ;tier++) { buffer_sprintf(wb, "%s\n\t\"tier%d\": {", tier?",":"", tier); -- cgit v1.2.3