Merge pull request #26756 from taosdata/fix/TD-30989-monitor
fix/TD-30989
This commit is contained in:
commit
7ece4acf5c
|
@ -15,11 +15,11 @@
|
||||||
|
|
||||||
#define _DEFAULT_SOURCE
|
#define _DEFAULT_SOURCE
|
||||||
#include "monInt.h"
|
#include "monInt.h"
|
||||||
|
#include "taos_monitor.h"
|
||||||
#include "taoserror.h"
|
#include "taoserror.h"
|
||||||
|
#include "tglobal.h"
|
||||||
#include "thttp.h"
|
#include "thttp.h"
|
||||||
#include "ttime.h"
|
#include "ttime.h"
|
||||||
#include "taos_monitor.h"
|
|
||||||
#include "tglobal.h"
|
|
||||||
|
|
||||||
SMonitor tsMonitor = {0};
|
SMonitor tsMonitor = {0};
|
||||||
char *tsMonUri = "/report";
|
char *tsMonUri = "/report";
|
||||||
|
@ -54,8 +54,7 @@ int32_t monGetLogs(SMonLogs *logs) {
|
||||||
taosArrayClear(tsMonitor.logs);
|
taosArrayClear(tsMonitor.logs);
|
||||||
taosThreadMutexUnlock(&tsMonitor.lock);
|
taosThreadMutexUnlock(&tsMonitor.lock);
|
||||||
if (logs->logs == NULL) {
|
if (logs->logs == NULL) {
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -105,8 +104,7 @@ void monSetBmInfo(SMonBmInfo *pInfo) {
|
||||||
int32_t monInit(const SMonCfg *pCfg) {
|
int32_t monInit(const SMonCfg *pCfg) {
|
||||||
tsMonitor.logs = taosArrayInit(16, sizeof(SMonLogItem));
|
tsMonitor.logs = taosArrayInit(16, sizeof(SMonLogItem));
|
||||||
if (tsMonitor.logs == NULL) {
|
if (tsMonitor.logs == NULL) {
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tsMonitor.cfg = *pCfg;
|
tsMonitor.cfg = *pCfg;
|
||||||
|
@ -146,6 +144,7 @@ static void monCleanupMonitorInfo(SMonInfo *pMonitor) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static SMonInfo *monCreateMonitorInfo() {
|
static SMonInfo *monCreateMonitorInfo() {
|
||||||
|
terrno = 0;
|
||||||
SMonInfo *pMonitor = taosMemoryCalloc(1, sizeof(SMonInfo));
|
SMonInfo *pMonitor = taosMemoryCalloc(1, sizeof(SMonInfo));
|
||||||
if (pMonitor == NULL) {
|
if (pMonitor == NULL) {
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||||
|
@ -602,8 +601,7 @@ void monGenAndSendReport() {
|
||||||
monGenLogJson(pMonitor);
|
monGenLogJson(pMonitor);
|
||||||
|
|
||||||
monSendReport(pMonitor);
|
monSendReport(pMonitor);
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
monGenClusterInfoTable(pMonitor);
|
monGenClusterInfoTable(pMonitor);
|
||||||
monGenVgroupInfoTable(pMonitor);
|
monGenVgroupInfoTable(pMonitor);
|
||||||
monGenDnodeInfoTable(pMonitor);
|
monGenDnodeInfoTable(pMonitor);
|
||||||
|
|
Loading…
Reference in New Issue