提交 5051a9d8 编写于 作者: S Shengliang Guan

[TD-933] enable sqls like : alter dnode 1 monitor 1

上级 e57f38cc
...@@ -199,6 +199,9 @@ int32_t sDebugFlag = 135; ...@@ -199,6 +199,9 @@ int32_t sDebugFlag = 135;
int32_t wDebugFlag = 135; int32_t wDebugFlag = 135;
int32_t tsdbDebugFlag = 131; int32_t tsdbDebugFlag = 131;
int32_t (*monitorStartSystemFp)() = NULL;
void (*monitorStopSystemFp)() = NULL;
static pthread_once_t tsInitGlobalCfgOnce = PTHREAD_ONCE_INIT; static pthread_once_t tsInitGlobalCfgOnce = PTHREAD_ONCE_INIT;
void taosSetAllDebugFlag() { void taosSetAllDebugFlag() {
...@@ -248,11 +251,17 @@ bool taosCfgDynamicOptions(char *msg) { ...@@ -248,11 +251,17 @@ bool taosCfgDynamicOptions(char *msg) {
*((int32_t *)cfg->ptr) = vint; *((int32_t *)cfg->ptr) = vint;
if (strncasecmp(cfg->option, "monitor", olen) == 0) { if (strncasecmp(cfg->option, "monitor", olen) == 0) {
// if (0 == vint) { if (1 == vint) {
// monitorStartSystem(); if (monitorStartSystemFp) {
// } else { (*monitorStartSystemFp)();
// monitorStopSystem(); uInfo("monitor is enabled");
// } }
} else {
if (monitorStopSystemFp) {
(*monitorStopSystemFp)();
uInfo("monitor is disabled");
}
}
return true; return true;
} }
......
...@@ -76,6 +76,8 @@ static void monitorInitDatabase(); ...@@ -76,6 +76,8 @@ static void monitorInitDatabase();
static void monitorInitDatabaseCb(void *param, TAOS_RES *result, int32_t code); static void monitorInitDatabaseCb(void *param, TAOS_RES *result, int32_t code);
static void monitorStartTimer(); static void monitorStartTimer();
static void monitorSaveSystemInfo(); static void monitorSaveSystemInfo();
extern int32_t (*monitorStartSystemFp)();
extern void (*monitorStopSystemFp)();
static void monitorCheckDiskUsage(void *para, void *unused) { static void monitorCheckDiskUsage(void *para, void *unused) {
taosGetDisk(); taosGetDisk();
...@@ -85,6 +87,8 @@ static void monitorCheckDiskUsage(void *para, void *unused) { ...@@ -85,6 +87,8 @@ static void monitorCheckDiskUsage(void *para, void *unused) {
int32_t monitorInitSystem() { int32_t monitorInitSystem() {
taos_init(); taos_init();
taosTmrReset(monitorCheckDiskUsage, CHECK_INTERVAL, NULL, tscTmr, &tsMonitorConn.diskTimer); taosTmrReset(monitorCheckDiskUsage, CHECK_INTERVAL, NULL, tscTmr, &tsMonitorConn.diskTimer);
monitorStartSystemFp = monitorStartSystem;
monitorStopSystemFp = monitorStopSystem;
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册