Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3fbb78a9
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
3fbb78a9
编写于
3月 03, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
io
上级
c890b0b5
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
26 addition
and
27 deletion
+26
-27
include/os/osSysinfo.h
include/os/osSysinfo.h
+2
-2
source/dnode/mgmt/impl/src/dndMgmt.c
source/dnode/mgmt/impl/src/dndMgmt.c
+3
-4
source/os/src/osSysinfo.c
source/os/src/osSysinfo.c
+21
-21
未找到文件。
include/os/osSysinfo.h
浏览文件 @
3fbb78a9
...
...
@@ -43,8 +43,8 @@ int32_t taosGetTotalMemory(int64_t *totalKB);
int32_t
taosGetProcMemory
(
int64_t
*
usedKB
);
int32_t
taosGetSysMemory
(
int64_t
*
usedKB
);
int32_t
taosGetDiskSize
(
char
*
dataDir
,
SDiskSize
*
diskSize
);
bool
taosReadProcIO
(
int64_t
*
rchars
,
int64_t
*
wchars
);
bool
taosGetProcIO
(
float
*
readKB
,
float
*
writeKB
);
int32_t
taosReadProcIO
(
int64_t
*
rchars
,
int64_t
*
wchars
);
int32_t
taosGetProcIO
(
float
*
readKB
,
float
*
writeKB
);
bool
taosGetCardInfo
(
int64_t
*
bytes
,
int64_t
*
rbytes
,
int64_t
*
tbytes
);
bool
taosGetBandSpeed
(
float
*
bandSpeedKb
);
...
...
source/dnode/mgmt/impl/src/dndMgmt.c
浏览文件 @
3fbb78a9
...
...
@@ -491,10 +491,9 @@ static void dndGetMonitorDnodeInfo(SDnode *pDnode, SMonDnodeInfo *pInfo) {
pInfo
->
disk_total
=
4
.
3
;
pInfo
->
net_in
=
5
.
1
;
pInfo
->
net_out
=
5
.
2
;
pInfo
->
io_read
=
6
.
1
;
pInfo
->
io_write
=
6
.
2
;
pInfo
->
io_read_disk
=
7
.
1
;
pInfo
->
io_write_disk
=
7
.
2
;
taosGetProcIO
(
&
pInfo
->
io_read
,
&
pInfo
->
io_write
);
pInfo
->
io_read_disk
=
0
;
pInfo
->
io_write_disk
=
0
;
pInfo
->
req_select
=
8
;
pInfo
->
req_select_rate
=
8
.
1
;
pInfo
->
req_insert
=
9
;
...
...
source/os/src/osSysinfo.c
浏览文件 @
3fbb78a9
...
...
@@ -124,31 +124,31 @@ bool taosGetBandSpeed(float *bandSpeedKb) {
return
true
;
}
bool
taosReadProcIO
(
int64_t
*
readbyte
,
int64_t
*
writebyte
)
{
int32_t
taosReadProcIO
(
int64_t
*
readbyte
,
int64_t
*
writebyte
)
{
IO_COUNTERS
io_counter
;
if
(
GetProcessIoCounters
(
GetCurrentProcess
(),
&
io_counter
))
{
if
(
readbyte
)
*
readbyte
=
io_counter
.
ReadTransferCount
;
if
(
writebyte
)
*
writebyte
=
io_counter
.
WriteTransferCount
;
return
true
;
return
0
;
}
return
false
;
return
-
1
;
}
bool
taosGetProcIO
(
float
*
readKB
,
float
*
writeKB
)
{
int32_t
taosGetProcIO
(
float
*
readKB
,
float
*
writeKB
)
{
static
int64_t
lastReadbyte
=
-
1
;
static
int64_t
lastWritebyte
=
-
1
;
int64_t
curReadbyte
=
0
;
int64_t
curWritebyte
=
0
;
if
(
!
taosReadProcIO
(
&
curReadbyte
,
&
curWritebyte
)
)
{
return
false
;
if
(
taosReadProcIO
(
&
curReadbyte
,
&
curWritebyte
)
!=
0
)
{
return
-
1
;
}
if
(
lastReadbyte
==
-
1
||
lastWritebyte
==
-
1
)
{
lastReadbyte
=
curReadbyte
;
lastWritebyte
=
curWritebyte
;
return
false
;
return
-
1
;
}
*
readKB
=
(
float
)((
double
)(
curReadbyte
-
lastReadbyte
)
/
1024
);
...
...
@@ -159,7 +159,7 @@ bool taosGetProcIO(float *readKB, float *writeKB) {
lastReadbyte
=
curReadbyte
;
lastWritebyte
=
curWritebyte
;
return
true
;
return
0
;
}
void
taosGetSystemInfo
()
{
...
...
@@ -259,16 +259,16 @@ void taosGetSystemInfo() {
tsNumOfCores
=
sysconf
(
_SC_NPROCESSORS_ONLN
);
}
bool
taosReadProcIO
(
int64_t
*
rchars
,
int64_t
*
wchars
)
{
int32_t
taosReadProcIO
(
int64_t
*
rchars
,
int64_t
*
wchars
)
{
if
(
rchars
)
*
rchars
=
0
;
if
(
wchars
)
*
wchars
=
0
;
return
true
;
return
0
;
}
bool
taosGetProcIO
(
float
*
readKB
,
float
*
writeKB
)
{
int32_t
taosGetProcIO
(
float
*
readKB
,
float
*
writeKB
)
{
*
readKB
=
0
;
*
writeKB
=
0
;
return
true
;
return
0
;
}
bool
taosGetCardInfo
(
int64_t
*
bytes
,
int64_t
*
rbytes
,
int64_t
*
tbytes
)
{
...
...
@@ -631,12 +631,12 @@ bool taosGetBandSpeed(float *bandSpeedKb) {
return
true
;
}
bool
taosReadProcIO
(
int64_t
*
rchars
,
int64_t
*
wchars
)
{
int32_t
taosReadProcIO
(
int64_t
*
rchars
,
int64_t
*
wchars
)
{
// FILE *fp = fopen(tsProcIOFile, "r");
TdFilePtr
pFile
=
taosOpenFile
(
tsProcIOFile
,
TD_FILE_READ
|
TD_FILE_STREAM
);
if
(
pFile
==
NULL
)
{
// printf("open file:%s failed", tsProcIOFile);
return
false
;
return
-
1
;
}
ssize_t
_bytes
=
0
;
...
...
@@ -666,27 +666,27 @@ bool taosReadProcIO(int64_t *rchars, int64_t *wchars) {
if
(
readIndex
<
2
)
{
// printf("read file:%s failed", tsProcIOFile);
return
false
;
return
-
1
;
}
return
true
;
return
0
;
}
bool
taosGetProcIO
(
float
*
readKB
,
float
*
writeKB
)
{
int32_t
taosGetProcIO
(
float
*
readKB
,
float
*
writeKB
)
{
static
int64_t
lastReadbyte
=
-
1
;
static
int64_t
lastWritebyte
=
-
1
;
int64_t
curReadbyte
=
0
;
int64_t
curWritebyte
=
0
;
if
(
!
taosReadProcIO
(
&
curReadbyte
,
&
curWritebyte
)
)
{
return
false
;
if
(
taosReadProcIO
(
&
curReadbyte
,
&
curWritebyte
)
!=
0
)
{
return
-
1
;
}
if
(
lastReadbyte
==
-
1
||
lastWritebyte
==
-
1
)
{
lastReadbyte
=
curReadbyte
;
lastWritebyte
=
curWritebyte
;
return
false
;
return
-
1
;
}
*
readKB
=
(
float
)((
double
)(
curReadbyte
-
lastReadbyte
)
/
1024
);
...
...
@@ -697,7 +697,7 @@ bool taosGetProcIO(float *readKB, float *writeKB) {
lastReadbyte
=
curReadbyte
;
lastWritebyte
=
curWritebyte
;
return
true
;
return
0
;
}
void
taosGetSystemInfo
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录