diff --git a/include/os/osSysinfo.h b/include/os/osSysinfo.h index a8110ee06aac21f9b0fa65f9b0e9f75d12bc3a17..206dbecd219d30875267803664290415a1e0ff6d 100644 --- a/include/os/osSysinfo.h +++ b/include/os/osSysinfo.h @@ -18,8 +18,7 @@ #include "os.h" -// #include /* for _syscallX macros/related stuff */ -// #include /* for struct sysinfo */ + #ifdef __cplusplus diff --git a/source/dnode/mgmt/mgmt_dnode/src/dmWorker.c b/source/dnode/mgmt/mgmt_dnode/src/dmWorker.c index 5854450fc7a497d544257c14a96e5b00a46cb837..783babcb666bf42d6999c54aa8ecd130c091e710 100644 --- a/source/dnode/mgmt/mgmt_dnode/src/dmWorker.c +++ b/source/dnode/mgmt/mgmt_dnode/src/dmWorker.c @@ -26,7 +26,6 @@ static void *dmStatusThreadFp(void *param) { int32_t trimCount = 0; int32_t upTimeCount = 0; int64_t upTime = 0; - int64_t thrdTime = 0; while (1) { taosMsleep(200); @@ -44,17 +43,11 @@ static void *dmStatusThreadFp(void *param) { taosMemoryTrim(0); } - if ((upTimeCount = (++upTimeCount & 7)) == 0) { + if ((upTimeCount = (++upTimeCount & 63)) == 0) { upTime = (taosGetOsUptime() - tsDndStartOsUptime) * 1000; + tsDndUpTime = TMAX(tsDndUpTime, upTime); } } - - thrdTime += 200; - cost = taosGetTimestampMs() - curTime; - if (cost > 0) thrdTime += cost; - tsDndUpTime = upTime > thrdTime ? upTime : thrdTime; - printf("upTime:%" PRIi64 " thrdTime:%" PRIi64 " tsDndUpTime:%" PRIi64 " delta:%" PRIi64 "\n", upTime, thrdTime, - tsDndUpTime, upTime - thrdTime); } return NULL; diff --git a/source/os/src/osSysinfo.c b/source/os/src/osSysinfo.c index 1f631c7388c4b4f3fc67a2b912fd3fa5900c1f79..a29b96dd6f2e31b6c21fe5dc3c0600d78cff186a 100644 --- a/source/os/src/osSysinfo.c +++ b/source/os/src/osSysinfo.c @@ -963,16 +963,14 @@ char *taosGetCmdlineByPID(int pid) { int64_t taosGetOsUptime() { #ifdef WINDOWS - return 0; -// #else -// #elif defined(_TD_DARWIN_64) -// return 0; +#elif defined(_TD_DARWIN_64) #else struct sysinfo info; if (0 == sysinfo(&info)) { return info.uptime; }; #endif + return 0; } void taosSetCoreDump(bool enable) {