From b82cd97b80d8abfa2a71baf061806e7807a66b67 Mon Sep 17 00:00:00 2001 From: dmchen Date: Tue, 24 Oct 2023 04:10:56 +0000 Subject: [PATCH] memory leak and enable --- source/dnode/mgmt/node_mgmt/src/dmMonitor.c | 2 +- source/libs/monitor/src/monMain.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/source/dnode/mgmt/node_mgmt/src/dmMonitor.c b/source/dnode/mgmt/node_mgmt/src/dmMonitor.c index c237ce73c0..14732cb509 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmMonitor.c +++ b/source/dnode/mgmt/node_mgmt/src/dmMonitor.c @@ -107,7 +107,7 @@ void dmSendMonitorReport() { dmGetSmMonitorInfo(pDnode); monSendReport(); - monSendPromReport(); + //monSendPromReport(); } void dmGetVnodeLoads(SMonVloadInfo *pInfo) { diff --git a/source/libs/monitor/src/monMain.c b/source/libs/monitor/src/monMain.c index 20bd064d69..b62cde5c5b 100644 --- a/source/libs/monitor/src/monMain.c +++ b/source/libs/monitor/src/monMain.c @@ -19,6 +19,7 @@ #include "thttp.h" #include "ttime.h" #include "taos_monitor.h" +#include "tglobal.h" static SMonitor tsMonitor = {0}; static char* tsMonUri = "/report"; @@ -553,7 +554,7 @@ void monSendReport() { void monSendPromReport() { char *pCont = (char *)taos_collector_registry_bridge( TAOS_COLLECTOR_REGISTRY_DEFAULT, taosGetTimestamp(TSDB_TIME_PRECISION_MILLI)); - uInfoL("report cont:\n%s\n", pCont); + //uInfoL("report cont:\n%s\n", pCont); if (pCont != NULL) { EHttpCompFlag flag = tsMonitor.cfg.comp ? HTTP_GZIP : HTTP_FLAT; if (taosSendHttpReport(tsMonitor.cfg.server, tsMonUri, tsMonitor.cfg.port, pCont, strlen(pCont), flag) != 0) { @@ -565,7 +566,8 @@ void monSendPromReport() { } void monSendContent(char *pCont) { - uInfoL("report cont:\n%s\n", pCont); + if (!tsEnableMonitor || tsMonitorFqdn[0] == 0 || tsMonitorPort == 0) return; + //uInfoL("report cont:\n%s\n", pCont); if (pCont != NULL) { EHttpCompFlag flag = tsMonitor.cfg.comp ? HTTP_GZIP : HTTP_FLAT; if (taosSendHttpReport(tsMonitor.cfg.server, tsMonUri, tsMonitor.cfg.port, pCont, strlen(pCont), flag) != 0) {