From eb5950b6d6e8775f521af40bc938c0ecc2349847 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Thu, 22 Oct 2020 10:31:09 +0000 Subject: [PATCH] TD-1767 --- src/os/src/detail/osSysinfo.c | 2 ++ src/plugins/monitor/src/monitorMain.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/src/os/src/detail/osSysinfo.c b/src/os/src/detail/osSysinfo.c index befd6f1cbd..87764de839 100644 --- a/src/os/src/detail/osSysinfo.c +++ b/src/os/src/detail/osSysinfo.c @@ -301,6 +301,7 @@ bool taosGetDisk() { struct statvfs info; const double unit = 1024 * 1024 * 1024; +#if 0 if (tscEmbedded) { if (statvfs(tsDataDir, &info)) { //tsTotalDataDirGB = 0; @@ -312,6 +313,7 @@ bool taosGetDisk() { tsAvailDataDirGB = (float)((double)info.f_bavail * (double)info.f_frsize / unit); } } +#endif if (statvfs(tsLogDir, &info)) { //tsTotalLogDirGB = 0; diff --git a/src/plugins/monitor/src/monitorMain.c b/src/plugins/monitor/src/monitorMain.c index 048f839b72..d5a661b31e 100644 --- a/src/plugins/monitor/src/monitorMain.c +++ b/src/plugins/monitor/src/monitorMain.c @@ -20,6 +20,7 @@ #include "tlog.h" #include "ttimer.h" #include "tutil.h" +#include "tdisk.h" #include "tsystem.h" #include "tscUtil.h" #include "tsclient.h" @@ -125,6 +126,10 @@ static void *monitorThreadFunc(void *param) { break; } else { taosGetDisk(); + tdUpdateTiersInfo(tsDnodeTier); + const double unit = 1024 * 1024 * 1024; + tsTotalDataDirGB = tsDnodeTier->meta.tsize / unit; + tsAvailDataDirGB = tsDnodeTier->meta.avail / unit; } if (tsMonitor.start == 0) { -- GitLab