Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
XKZJ_WCL
TDengine
提交
20f2a7b7
T
TDengine
项目概览
XKZJ_WCL
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
20f2a7b7
编写于
3月 19, 2021
作者:
M
Minglei Jin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-3370]<fix>: fix used disk size, show acctual used instead of non-avail to current user
上级
1601a1e5
变更
12
显示空白变更内容
内联
并排
Showing
12 changed file
with
25 addition
and
5 deletion
+25
-5
src/common/inc/tglobal.h
src/common/inc/tglobal.h
+1
-0
src/common/src/tglobal.c
src/common/src/tglobal.c
+1
-0
src/inc/tfs.h
src/inc/tfs.h
+2
-1
src/os/inc/osSysinfo.h
src/os/inc/osSysinfo.h
+1
-0
src/os/src/darwin/darwinSysInfo.c
src/os/src/darwin/darwinSysInfo.c
+3
-0
src/os/src/detail/osSysinfo.c
src/os/src/detail/osSysinfo.c
+3
-0
src/os/src/windows/wSysinfo.c
src/os/src/windows/wSysinfo.c
+4
-1
src/plugins/monitor/src/monMain.c
src/plugins/monitor/src/monMain.c
+1
-1
src/tfs/inc/tfsint.h
src/tfs/inc/tfsint.h
+4
-1
src/tfs/src/tdisk.c
src/tfs/src/tdisk.c
+1
-0
src/tfs/src/tfs.c
src/tfs/src/tfs.c
+2
-0
src/tfs/src/ttier.c
src/tfs/src/ttier.c
+2
-1
未找到文件。
src/common/inc/tglobal.h
浏览文件 @
20f2a7b7
...
...
@@ -163,6 +163,7 @@ extern float tsTotalDataDirGB;
extern
float
tsAvailLogDirGB
;
extern
float
tsAvailTmpDirectorySpace
;
extern
float
tsAvailDataDirGB
;
extern
float
tsUsedDataDirGB
;
extern
float
tsMinimalLogDirGB
;
extern
float
tsReservedTmpDirectorySpace
;
extern
float
tsMinimalDataDirGB
;
...
...
src/common/src/tglobal.c
浏览文件 @
20f2a7b7
...
...
@@ -210,6 +210,7 @@ float tsTotalTmpDirGB = 0;
float
tsTotalDataDirGB
=
0
;
float
tsAvailTmpDirectorySpace
=
0
;
float
tsAvailDataDirGB
=
0
;
float
tsUsedDataDirGB
=
0
;
float
tsReservedTmpDirectorySpace
=
1
.
0
f
;
float
tsMinimalDataDirGB
=
1
.
0
f
;
int32_t
tsTotalMemoryMB
=
0
;
...
...
src/inc/tfs.h
浏览文件 @
20f2a7b7
...
...
@@ -35,6 +35,7 @@ typedef struct {
// FS APIs ====================================
typedef
struct
{
int64_t
tsize
;
int64_t
used
;
int64_t
avail
;
}
SFSMeta
;
...
...
src/os/inc/osSysinfo.h
浏览文件 @
20f2a7b7
...
...
@@ -23,6 +23,7 @@ extern "C" {
// TAOS_OS_FUNC_SYSINFO
typedef
struct
{
int64_t
tsize
;
int64_t
used
;
int64_t
avail
;
}
SysDiskSize
;
...
...
src/os/src/darwin/darwinSysInfo.c
浏览文件 @
20f2a7b7
...
...
@@ -138,6 +138,8 @@ void taosPrintOsInfo() {
// uInfo(" os streamMax: %" PRId64, tsStreamMax);
uInfo
(
" os numOfCores: %d"
,
tsNumOfCores
);
uInfo
(
" os totalDisk: %f(GB)"
,
tsTotalDataDirGB
);
uInfo
(
" os usedDisk: %f(GB)"
,
tsUsedDataDirGB
);
uInfo
(
" os availDisk: %f(GB)"
,
tsAvailDataDirGB
);
uInfo
(
" os totalMemory: %d(MB)"
,
tsTotalMemoryMB
);
struct
utsname
buf
;
...
...
@@ -222,6 +224,7 @@ int32_t taosGetDiskSize(char *dataDir, SysDiskSize *diskSize) {
}
else
{
diskSize
->
tsize
=
info
.
f_blocks
*
info
.
f_frsize
;
diskSize
->
avail
=
info
.
f_bavail
*
info
.
f_frsize
;
diskSize
->
used
=
(
info
.
f_blocks
-
info
.
f_bfree
)
*
info
.
f_frsize
;
return
0
;
}
}
...
...
src/os/src/detail/osSysinfo.c
浏览文件 @
20f2a7b7
...
...
@@ -326,6 +326,7 @@ int32_t taosGetDiskSize(char *dataDir, SysDiskSize *diskSize) {
}
else
{
diskSize
->
tsize
=
info
.
f_blocks
*
info
.
f_frsize
;
diskSize
->
avail
=
info
.
f_bavail
*
info
.
f_frsize
;
diskSize
->
used
=
(
info
.
f_blocks
-
info
.
f_bfree
)
*
info
.
f_frsize
;
return
0
;
}
}
...
...
@@ -506,6 +507,8 @@ void taosPrintOsInfo() {
uInfo
(
" os streamMax: %"
PRId64
,
tsStreamMax
);
uInfo
(
" os numOfCores: %d"
,
tsNumOfCores
);
uInfo
(
" os totalDisk: %f(GB)"
,
tsTotalDataDirGB
);
uInfo
(
" os usedDisk: %f(GB)"
,
tsUsedDataDirGB
);
uInfo
(
" os availDisk: %f(GB)"
,
tsAvailDataDirGB
);
uInfo
(
" os totalMemory: %d(MB)"
,
tsTotalMemoryMB
);
struct
utsname
buf
;
...
...
src/os/src/windows/wSysinfo.c
浏览文件 @
20f2a7b7
...
...
@@ -136,7 +136,8 @@ int32_t taosGetDiskSize(char *dataDir, SysDiskSize *diskSize) {
(
PULARGE_INTEGER
)
&
i64FreeBytes
);
if
(
fResult
)
{
diskSize
->
tsize
=
(
int64_t
)(
i64TotalBytes
);
diskSize
->
avail
=
(
int64_t
)(
i64FreeBytes
);
diskSize
->
avail
=
(
int64_t
)(
i64FreeBytesToCaller
);
diskSize
->
used
=
(
int64_t
)(
i64TotalBytes
-
i64FreeBytes
);
return
0
;
}
else
{
uError
(
"failed to get disk size, dataDir:%s errno:%s"
,
tsDataDir
,
strerror
(
errno
));
...
...
@@ -205,6 +206,8 @@ void taosGetSystemInfo() {
void
taosPrintOsInfo
()
{
uInfo
(
" os numOfCores: %d"
,
tsNumOfCores
);
uInfo
(
" os totalDisk: %f(GB)"
,
tsTotalDataDirGB
);
uInfo
(
" os usedDisk: %f(GB)"
,
tsUsedDataDirGB
);
uInfo
(
" os availDisk: %f(GB)"
,
tsAvailDataDirGB
);
uInfo
(
" os totalMemory: %d(MB)"
,
tsTotalMemoryMB
);
uInfo
(
"=================================="
);
}
...
...
src/plugins/monitor/src/monMain.c
浏览文件 @
20f2a7b7
...
...
@@ -292,7 +292,7 @@ static int32_t monBuildCpuSql(char *sql) {
// unit is GB
static
int32_t
monBuildDiskSql
(
char
*
sql
)
{
return
sprintf
(
sql
,
", %f, %d"
,
(
tsTotalDataDirGB
-
tsAvailDataDirGB
)
,
(
int32_t
)
tsTotalDataDirGB
);
return
sprintf
(
sql
,
", %f, %d"
,
tsUsedDataDirGB
,
(
int32_t
)
tsTotalDataDirGB
);
}
// unit is Kb
...
...
src/tfs/inc/tfsint.h
浏览文件 @
20f2a7b7
...
...
@@ -41,6 +41,7 @@ extern int fsDebugFlag;
// tdisk.c ======================================================
typedef
struct
{
int64_t
size
;
int64_t
used
;
int64_t
free
;
}
SDiskMeta
;
...
...
@@ -56,6 +57,7 @@ typedef struct SDisk {
#define DISK_DIR(pd) ((pd)->dir)
#define DISK_META(pd) ((pd)->dmeta)
#define DISK_SIZE(pd) ((pd)->dmeta.size)
#define DISK_USED_SIZE(pd) ((pd)->dmeta.used)
#define DISK_FREE_SIZE(pd) ((pd)->dmeta.free)
SDisk
*
tfsNewDisk
(
int
level
,
int
id
,
const
char
*
dir
);
...
...
@@ -65,6 +67,7 @@ int tfsUpdateDiskInfo(SDisk *pDisk);
// ttier.c ======================================================
typedef
struct
{
int64_t
size
;
int64_t
used
;
int64_t
free
;
int16_t
nAvailDisks
;
// # of Available disks
}
STierMeta
;
...
...
src/tfs/src/tdisk.c
浏览文件 @
20f2a7b7
...
...
@@ -52,6 +52,7 @@ int tfsUpdateDiskInfo(SDisk *pDisk) {
}
pDisk
->
dmeta
.
size
=
diskSize
.
tsize
;
pDisk
->
dmeta
.
used
=
diskSize
.
used
;
pDisk
->
dmeta
.
free
=
diskSize
.
avail
;
return
code
;
...
...
src/tfs/src/tfs.c
浏览文件 @
20f2a7b7
...
...
@@ -134,6 +134,7 @@ void tfsUpdateInfo(SFSMeta *pFSMeta) {
tfsUpdateTierInfo
(
pTier
,
&
tierMeta
);
pFSMeta
->
tsize
+=
tierMeta
.
size
;
pFSMeta
->
avail
+=
tierMeta
.
free
;
pFSMeta
->
used
+=
tierMeta
.
used
;
}
tfsLock
();
...
...
@@ -585,6 +586,7 @@ void taosGetDisk() {
if
(
tscEmbedded
)
{
tfsUpdateInfo
(
&
fsMeta
);
tsTotalDataDirGB
=
(
float
)(
fsMeta
.
tsize
/
unit
);
tsUsedDataDirGB
=
(
float
)(
fsMeta
.
used
/
unit
);
tsAvailDataDirGB
=
(
float
)(
fsMeta
.
avail
/
unit
);
}
...
...
src/tfs/src/ttier.c
浏览文件 @
20f2a7b7
...
...
@@ -100,6 +100,7 @@ void tfsUpdateTierInfo(STier *pTier, STierMeta *pTierMeta) {
continue
;
}
pTierMeta
->
size
+=
DISK_SIZE
(
DISK_AT_TIER
(
pTier
,
id
));
pTierMeta
->
used
+=
DISK_USED_SIZE
(
DISK_AT_TIER
(
pTier
,
id
));
pTierMeta
->
free
+=
DISK_FREE_SIZE
(
DISK_AT_TIER
(
pTier
,
id
));
pTierMeta
->
nAvailDisks
++
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录