Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
5e2417a1
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看板
提交
5e2417a1
编写于
11月 18, 2021
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix dnodes uptime and interval
上级
30898f26
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
21 addition
and
13 deletion
+21
-13
src/os/src/detail/osSysinfo.c
src/os/src/detail/osSysinfo.c
+9
-5
src/os/src/windows/wSysinfo.c
src/os/src/windows/wSysinfo.c
+9
-5
src/plugins/monitor/src/monMain.c
src/plugins/monitor/src/monMain.c
+3
-3
未找到文件。
src/os/src/detail/osSysinfo.c
浏览文件 @
5e2417a1
...
@@ -516,6 +516,8 @@ bool taosReadProcIO(int64_t *rchars, int64_t *wchars, int64_t *rbytes, int64_t *
...
@@ -516,6 +516,8 @@ bool taosReadProcIO(int64_t *rchars, int64_t *wchars, int64_t *rbytes, int64_t *
bool
taosGetProcIO
(
float
*
rcharKB
,
float
*
wcharKB
,
float
*
rbyteKB
,
float
*
wbyteKB
)
{
bool
taosGetProcIO
(
float
*
rcharKB
,
float
*
wcharKB
,
float
*
rbyteKB
,
float
*
wbyteKB
)
{
static
int64_t
lastRchar
=
-
1
,
lastRbyte
=
-
1
;
static
int64_t
lastRchar
=
-
1
,
lastRbyte
=
-
1
;
static
int64_t
lastWchar
=
-
1
,
lastWbyte
=
-
1
;
static
int64_t
lastWchar
=
-
1
,
lastWbyte
=
-
1
;
static
time_t
lastTime
=
0
;
time_t
curTime
=
time
(
NULL
);
int64_t
curRchar
=
0
,
curRbyte
=
0
;
int64_t
curRchar
=
0
,
curRbyte
=
0
;
int64_t
curWchar
=
0
,
curWbyte
=
0
;
int64_t
curWchar
=
0
,
curWbyte
=
0
;
...
@@ -524,7 +526,8 @@ bool taosGetProcIO(float *rcharKB, float *wcharKB, float *rbyteKB, float *wbyteK
...
@@ -524,7 +526,8 @@ bool taosGetProcIO(float *rcharKB, float *wcharKB, float *rbyteKB, float *wbyteK
return
false
;
return
false
;
}
}
if
(
lastRchar
==
-
1
||
lastWchar
==
-
1
||
lastRbyte
==
-
1
||
lastWbyte
==
-
1
)
{
if
(
lastTime
==
0
||
lastRchar
==
-
1
||
lastWchar
==
-
1
||
lastRbyte
==
-
1
||
lastWbyte
==
-
1
)
{
lastTime
=
curTime
;
lastRchar
=
curRchar
;
lastRchar
=
curRchar
;
lastWchar
=
curWchar
;
lastWchar
=
curWchar
;
lastRbyte
=
curRbyte
;
lastRbyte
=
curRbyte
;
...
@@ -532,13 +535,13 @@ bool taosGetProcIO(float *rcharKB, float *wcharKB, float *rbyteKB, float *wbyteK
...
@@ -532,13 +535,13 @@ bool taosGetProcIO(float *rcharKB, float *wcharKB, float *rbyteKB, float *wbyteK
return
false
;
return
false
;
}
}
*
rcharKB
=
(
float
)((
double
)(
curRchar
-
lastRchar
)
/
1024
);
*
rcharKB
=
(
float
)((
double
)(
curRchar
-
lastRchar
)
/
1024
/
(
double
)(
curTime
-
lastTime
)
);
*
wcharKB
=
(
float
)((
double
)(
curWchar
-
lastWchar
)
/
1024
);
*
wcharKB
=
(
float
)((
double
)(
curWchar
-
lastWchar
)
/
1024
/
(
double
)(
curTime
-
lastTime
)
);
if
(
*
rcharKB
<
0
)
*
rcharKB
=
0
;
if
(
*
rcharKB
<
0
)
*
rcharKB
=
0
;
if
(
*
wcharKB
<
0
)
*
wcharKB
=
0
;
if
(
*
wcharKB
<
0
)
*
wcharKB
=
0
;
*
rbyteKB
=
(
float
)((
double
)(
curRbyte
-
lastRbyte
)
/
1024
);
*
rbyteKB
=
(
float
)((
double
)(
curRbyte
-
lastRbyte
)
/
1024
/
(
double
)(
curTime
-
lastTime
)
);
*
wbyteKB
=
(
float
)((
double
)(
curWbyte
-
lastWbyte
)
/
1024
);
*
wbyteKB
=
(
float
)((
double
)(
curWbyte
-
lastWbyte
)
/
1024
/
(
double
)(
curTime
-
lastTime
)
);
if
(
*
rbyteKB
<
0
)
*
rbyteKB
=
0
;
if
(
*
rbyteKB
<
0
)
*
rbyteKB
=
0
;
if
(
*
wbyteKB
<
0
)
*
wbyteKB
=
0
;
if
(
*
wbyteKB
<
0
)
*
wbyteKB
=
0
;
...
@@ -546,6 +549,7 @@ bool taosGetProcIO(float *rcharKB, float *wcharKB, float *rbyteKB, float *wbyteK
...
@@ -546,6 +549,7 @@ bool taosGetProcIO(float *rcharKB, float *wcharKB, float *rbyteKB, float *wbyteK
lastWchar
=
curWchar
;
lastWchar
=
curWchar
;
lastRbyte
=
curRbyte
;
lastRbyte
=
curRbyte
;
lastWbyte
=
curWbyte
;
lastWbyte
=
curWbyte
;
lastTime
=
curTime
;
return
true
;
return
true
;
}
}
...
...
src/os/src/windows/wSysinfo.c
浏览文件 @
5e2417a1
...
@@ -188,6 +188,8 @@ bool taosReadProcIO(int64_t *rchars, int64_t *wchars, int64_t *rbytes, int64_t *
...
@@ -188,6 +188,8 @@ bool taosReadProcIO(int64_t *rchars, int64_t *wchars, int64_t *rbytes, int64_t *
bool
taosGetProcIO
(
float
*
rcharKB
,
float
*
wcharKB
,
float
*
rbyteKB
,
float
*
wbyteKB
)
{
bool
taosGetProcIO
(
float
*
rcharKB
,
float
*
wcharKB
,
float
*
rbyteKB
,
float
*
wbyteKB
)
{
static
int64_t
lastRchar
=
-
1
,
lastRbyte
=
-
1
;
static
int64_t
lastRchar
=
-
1
,
lastRbyte
=
-
1
;
static
int64_t
lastWchar
=
-
1
,
lastWbyte
=
-
1
;
static
int64_t
lastWchar
=
-
1
,
lastWbyte
=
-
1
;
static
time_t
lastTime
=
0
;
time_t
curTime
=
time
(
NULL
);
int64_t
curRchar
=
0
,
curRbyte
=
0
;
int64_t
curRchar
=
0
,
curRbyte
=
0
;
int64_t
curWchar
=
0
,
curWbyte
=
0
;
int64_t
curWchar
=
0
,
curWbyte
=
0
;
...
@@ -196,7 +198,8 @@ bool taosGetProcIO(float *rcharKB, float *wcharKB, float *rbyteKB, float *wbyteK
...
@@ -196,7 +198,8 @@ bool taosGetProcIO(float *rcharKB, float *wcharKB, float *rbyteKB, float *wbyteK
return
false
;
return
false
;
}
}
if
(
lastRchar
==
-
1
||
lastWchar
==
-
1
||
lastRbyte
==
-
1
||
lastWbyte
==
-
1
)
{
if
(
lastTime
==
0
||
lastRchar
==
-
1
||
lastWchar
==
-
1
||
lastRbyte
==
-
1
||
lastWbyte
==
-
1
)
{
lastTime
=
curTime
;
lastRchar
=
curRchar
;
lastRchar
=
curRchar
;
lastWchar
=
curWchar
;
lastWchar
=
curWchar
;
lastRbyte
=
curRbyte
;
lastRbyte
=
curRbyte
;
...
@@ -204,13 +207,13 @@ bool taosGetProcIO(float *rcharKB, float *wcharKB, float *rbyteKB, float *wbyteK
...
@@ -204,13 +207,13 @@ bool taosGetProcIO(float *rcharKB, float *wcharKB, float *rbyteKB, float *wbyteK
return
false
;
return
false
;
}
}
*
rcharKB
=
(
float
)((
double
)(
curRchar
-
lastRchar
)
/
1024
);
*
rcharKB
=
(
float
)((
double
)(
curRchar
-
lastRchar
)
/
1024
/
(
double
)(
curTime
-
lastTime
)
);
*
wcharKB
=
(
float
)((
double
)(
curWchar
-
lastWchar
)
/
1024
);
*
wcharKB
=
(
float
)((
double
)(
curWchar
-
lastWchar
)
/
1024
/
(
double
)(
curTime
-
lastTime
)
);
if
(
*
rcharKB
<
0
)
*
rcharKB
=
0
;
if
(
*
rcharKB
<
0
)
*
rcharKB
=
0
;
if
(
*
wcharKB
<
0
)
*
wcharKB
=
0
;
if
(
*
wcharKB
<
0
)
*
wcharKB
=
0
;
*
rbyteKB
=
(
float
)((
double
)(
curRbyte
-
lastRbyte
)
/
1024
);
*
rbyteKB
=
(
float
)((
double
)(
curRbyte
-
lastRbyte
)
/
1024
/
(
double
)(
curTime
-
lastTime
)
);
*
wbyteKB
=
(
float
)((
double
)(
curWbyte
-
lastWbyte
)
/
1024
);
*
wbyteKB
=
(
float
)((
double
)(
curWbyte
-
lastWbyte
)
/
1024
/
(
double
)(
curTime
-
lastTime
)
);
if
(
*
rbyteKB
<
0
)
*
rbyteKB
=
0
;
if
(
*
rbyteKB
<
0
)
*
rbyteKB
=
0
;
if
(
*
wbyteKB
<
0
)
*
wbyteKB
=
0
;
if
(
*
wbyteKB
<
0
)
*
wbyteKB
=
0
;
...
@@ -218,6 +221,7 @@ bool taosGetProcIO(float *rcharKB, float *wcharKB, float *rbyteKB, float *wbyteK
...
@@ -218,6 +221,7 @@ bool taosGetProcIO(float *rcharKB, float *wcharKB, float *rbyteKB, float *wbyteK
lastWchar
=
curWchar
;
lastWchar
=
curWchar
;
lastRbyte
=
curRbyte
;
lastRbyte
=
curRbyte
;
lastWbyte
=
curWbyte
;
lastWbyte
=
curWbyte
;
lastTime
=
curTime
;
return
true
;
return
true
;
}
}
...
...
src/plugins/monitor/src/monMain.c
浏览文件 @
5e2417a1
...
@@ -860,7 +860,7 @@ static int32_t monBuildDnodeUptimeSql(char *sql) {
...
@@ -860,7 +860,7 @@ static int32_t monBuildDnodeUptimeSql(char *sql) {
for
(
int
i
=
0
;
i
<
num_fields
;
++
i
)
{
for
(
int
i
=
0
;
i
<
num_fields
;
++
i
)
{
if
(
strcmp
(
fields
[
i
].
name
,
"end_point"
)
==
0
)
{
if
(
strcmp
(
fields
[
i
].
name
,
"end_point"
)
==
0
)
{
int32_t
charLen
=
monGetRowElemCharLen
(
fields
[
i
],
(
char
*
)
row
[
i
]);
int32_t
charLen
=
monGetRowElemCharLen
(
fields
[
i
],
(
char
*
)
row
[
i
]);
if
(
strncmp
((
char
*
)
row
[
i
],
tsLocalEp
,
charLen
))
{
if
(
strncmp
((
char
*
)
row
[
i
],
tsLocalEp
,
charLen
)
==
0
)
{
is_self_ep
=
true
;
is_self_ep
=
true
;
}
}
}
}
...
@@ -887,8 +887,8 @@ static int32_t monBuildDnodeIoSql(char *sql) {
...
@@ -887,8 +887,8 @@ static int32_t monBuildDnodeIoSql(char *sql) {
rbyteKB
=
tsMonStat
.
io_read_disk
;
rbyteKB
=
tsMonStat
.
io_read_disk
;
wbyteKB
=
tsMonStat
.
io_write_disk
;
wbyteKB
=
tsMonStat
.
io_write_disk
;
return
snprintf
(
sql
,
SQL_LENGTH
,
", %f, %f, %f, %f"
,
(
rcharKB
/
1024
)
/
tsMonitorInterval
,
(
wcharKB
/
1024
)
/
tsMonitorInterval
,
return
snprintf
(
sql
,
SQL_LENGTH
,
", %f, %f, %f, %f"
,
rcharKB
/
1024
,
wcharKB
/
1024
,
(
rbyteKB
/
1024
)
/
tsMonitorInterval
,
(
wbyteKB
/
1024
)
/
tsMonitorInterval
);
rbyteKB
/
1024
,
wbyteKB
/
1024
);
}
}
static
int32_t
monBuildNetworkIOSql
(
char
*
sql
)
{
static
int32_t
monBuildNetworkIOSql
(
char
*
sql
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录