[TD-933] enable sqls like : alter dnode 1 monitor 1
This commit is contained in:
parent
e57f38cc64
commit
5051a9d84e
|
@ -199,6 +199,9 @@ int32_t sDebugFlag = 135;
|
|||
int32_t wDebugFlag = 135;
|
||||
int32_t tsdbDebugFlag = 131;
|
||||
|
||||
int32_t (*monitorStartSystemFp)() = NULL;
|
||||
void (*monitorStopSystemFp)() = NULL;
|
||||
|
||||
static pthread_once_t tsInitGlobalCfgOnce = PTHREAD_ONCE_INIT;
|
||||
|
||||
void taosSetAllDebugFlag() {
|
||||
|
@ -248,11 +251,17 @@ bool taosCfgDynamicOptions(char *msg) {
|
|||
*((int32_t *)cfg->ptr) = vint;
|
||||
|
||||
if (strncasecmp(cfg->option, "monitor", olen) == 0) {
|
||||
// if (0 == vint) {
|
||||
// monitorStartSystem();
|
||||
// } else {
|
||||
// monitorStopSystem();
|
||||
// }
|
||||
if (1 == vint) {
|
||||
if (monitorStartSystemFp) {
|
||||
(*monitorStartSystemFp)();
|
||||
uInfo("monitor is enabled");
|
||||
}
|
||||
} else {
|
||||
if (monitorStopSystemFp) {
|
||||
(*monitorStopSystemFp)();
|
||||
uInfo("monitor is disabled");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -76,6 +76,8 @@ static void monitorInitDatabase();
|
|||
static void monitorInitDatabaseCb(void *param, TAOS_RES *result, int32_t code);
|
||||
static void monitorStartTimer();
|
||||
static void monitorSaveSystemInfo();
|
||||
extern int32_t (*monitorStartSystemFp)();
|
||||
extern void (*monitorStopSystemFp)();
|
||||
|
||||
static void monitorCheckDiskUsage(void *para, void *unused) {
|
||||
taosGetDisk();
|
||||
|
@ -85,6 +87,8 @@ static void monitorCheckDiskUsage(void *para, void *unused) {
|
|||
int32_t monitorInitSystem() {
|
||||
taos_init();
|
||||
taosTmrReset(monitorCheckDiskUsage, CHECK_INTERVAL, NULL, tscTmr, &tsMonitorConn.diskTimer);
|
||||
monitorStartSystemFp = monitorStartSystem;
|
||||
monitorStopSystemFp = monitorStopSystem;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue