Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b34ea72a
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
提交
b34ea72a
编写于
4月 08, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat[cluster]: send monitor information in multi-process mode
上级
41058425
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
68 addition
and
60 deletion
+68
-60
include/libs/monitor/monitor.h
include/libs/monitor/monitor.h
+5
-5
source/dnode/mgmt/bm/bmHandle.c
source/dnode/mgmt/bm/bmHandle.c
+1
-1
source/dnode/mgmt/dm/dmWorker.c
source/dnode/mgmt/dm/dmWorker.c
+5
-5
source/dnode/mgmt/inc/dmInt.h
source/dnode/mgmt/inc/dmInt.h
+1
-1
source/dnode/mgmt/mm/mmHandle.c
source/dnode/mgmt/mm/mmHandle.c
+1
-1
source/dnode/mgmt/qm/qmHandle.c
source/dnode/mgmt/qm/qmHandle.c
+1
-1
source/dnode/mgmt/sm/smHandle.c
source/dnode/mgmt/sm/smHandle.c
+1
-1
source/dnode/mgmt/vm/vmHandle.c
source/dnode/mgmt/vm/vmHandle.c
+1
-1
source/libs/monitor/inc/monInt.h
source/libs/monitor/inc/monInt.h
+1
-1
source/libs/monitor/src/monMain.c
source/libs/monitor/src/monMain.c
+16
-16
source/libs/monitor/src/monMsg.c
source/libs/monitor/src/monMsg.c
+28
-20
source/libs/monitor/test/monTest.cpp
source/libs/monitor/test/monTest.cpp
+5
-5
source/os/src/osSysinfo.c
source/os/src/osSysinfo.c
+2
-2
未找到文件。
include/libs/monitor/monitor.h
浏览文件 @
b34ea72a
...
...
@@ -143,7 +143,7 @@ typedef struct {
SMonVgroupInfo
vgroup
;
SMonGrantInfo
grant
;
SMonSysInfo
sys
;
SMonLogs
log
s
;
SMonLogs
log
;
}
SMonMmInfo
;
int32_t
tSerializeSMonMmInfo
(
void
*
buf
,
int32_t
bufLen
,
SMonMmInfo
*
pInfo
);
...
...
@@ -158,7 +158,7 @@ typedef struct {
SMonDiskInfo
tfs
;
SVnodesStat
vstat
;
SMonSysInfo
sys
;
SMonLogs
log
s
;
SMonLogs
log
;
}
SMonVmInfo
;
int32_t
tSerializeSMonVmInfo
(
void
*
buf
,
int32_t
bufLen
,
SMonVmInfo
*
pInfo
);
...
...
@@ -167,7 +167,7 @@ void tFreeSMonVmInfo(SMonVmInfo *pInfo);
typedef
struct
{
SMonSysInfo
sys
;
SMonLogs
log
s
;
SMonLogs
log
;
}
SMonQmInfo
;
int32_t
tSerializeSMonQmInfo
(
void
*
buf
,
int32_t
bufLen
,
SMonQmInfo
*
pInfo
);
...
...
@@ -176,7 +176,7 @@ void tFreeSMonQmInfo(SMonQmInfo *pInfo);
typedef
struct
{
SMonSysInfo
sys
;
SMonLogs
log
s
;
SMonLogs
log
;
}
SMonSmInfo
;
int32_t
tSerializeSMonSmInfo
(
void
*
buf
,
int32_t
bufLen
,
SMonSmInfo
*
pInfo
);
...
...
@@ -184,7 +184,7 @@ int32_t tDeserializeSMonSmInfo(void *buf, int32_t bufLen, SMonSmInfo *pInfo);
void
tFreeSMonSmInfo
(
SMonSmInfo
*
pInfo
);
typedef
struct
{
SMonSysInfo
sys
;
SMonLogs
log
s
;
SMonLogs
log
;
}
SMonBmInfo
;
int32_t
tSerializeSMonBmInfo
(
void
*
buf
,
int32_t
bufLen
,
SMonBmInfo
*
pInfo
);
...
...
source/dnode/mgmt/bm/bmHandle.c
浏览文件 @
b34ea72a
...
...
@@ -19,7 +19,7 @@
void
bmGetMonitorInfo
(
SMgmtWrapper
*
pWrapper
,
SMonBmInfo
*
bmInfo
)
{
if
(
pWrapper
->
procType
==
PROC_CHILD
)
{
dmGetMonitorSysInfo
(
&
bmInfo
->
sys
);
monGetLogs
(
&
bmInfo
->
log
s
);
monGetLogs
(
&
bmInfo
->
log
);
}
}
...
...
source/dnode/mgmt/dm/dmWorker.c
浏览文件 @
b34ea72a
...
...
@@ -119,9 +119,9 @@ int32_t dmStartWorker(SDnodeMgmt *pMgmt) {
return
-
1
;
}
SSingleWorkerCfg
scfg
=
{.
min
=
1
,
.
max
=
1
,
.
name
=
"dnode-
status
"
,
.
fp
=
(
FItem
)
dmProcessQueue
,
.
param
=
pMgmt
};
if
(
tSingleWorkerInit
(
&
pMgmt
->
status
Worker
,
&
scfg
)
!=
0
)
{
dError
(
"failed to start dnode
status
worker since %s"
,
terrstr
());
SSingleWorkerCfg
scfg
=
{.
min
=
1
,
.
max
=
1
,
.
name
=
"dnode-
monitor
"
,
.
fp
=
(
FItem
)
dmProcessQueue
,
.
param
=
pMgmt
};
if
(
tSingleWorkerInit
(
&
pMgmt
->
monitor
Worker
,
&
scfg
)
!=
0
)
{
dError
(
"failed to start dnode
monitor
worker since %s"
,
terrstr
());
return
-
1
;
}
...
...
@@ -131,7 +131,7 @@ int32_t dmStartWorker(SDnodeMgmt *pMgmt) {
void
dmStopWorker
(
SDnodeMgmt
*
pMgmt
)
{
tSingleWorkerCleanup
(
&
pMgmt
->
mgmtWorker
);
tSingleWorkerCleanup
(
&
pMgmt
->
status
Worker
);
tSingleWorkerCleanup
(
&
pMgmt
->
monitor
Worker
);
if
(
pMgmt
->
threadId
!=
NULL
)
{
taosDestoryThread
(
pMgmt
->
threadId
);
...
...
@@ -151,7 +151,7 @@ int32_t dmProcessMgmtMsg(SMgmtWrapper *pWrapper, SNodeMsg *pMsg) {
int32_t
dmProcessMonitorMsg
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
)
{
SDnodeMgmt
*
pMgmt
=
pWrapper
->
pMgmt
;
SSingleWorker
*
pWorker
=
&
pMgmt
->
status
Worker
;
SSingleWorker
*
pWorker
=
&
pMgmt
->
monitor
Worker
;
dTrace
(
"msg:%p, put into worker %s"
,
pMsg
,
pWorker
->
name
);
taosWriteQitem
(
pWorker
->
queue
,
pMsg
);
...
...
source/dnode/mgmt/inc/dmInt.h
浏览文件 @
b34ea72a
...
...
@@ -32,7 +32,7 @@ typedef struct SDnodeMgmt {
TdThread
*
threadId
;
SRWLatch
latch
;
SSingleWorker
mgmtWorker
;
SSingleWorker
status
Worker
;
SSingleWorker
monitor
Worker
;
SMsgCb
msgCb
;
const
char
*
path
;
SDnode
*
pDnode
;
...
...
source/dnode/mgmt/mm/mmHandle.c
浏览文件 @
b34ea72a
...
...
@@ -21,7 +21,7 @@ void mmGetMonitorInfo(SMgmtWrapper *pWrapper, SMonMmInfo *mmInfo) {
mndGetMonitorInfo
(
pMgmt
->
pMnode
,
&
mmInfo
->
cluster
,
&
mmInfo
->
vgroup
,
&
mmInfo
->
grant
);
if
(
pWrapper
->
procType
==
PROC_CHILD
)
{
dmGetMonitorSysInfo
(
&
mmInfo
->
sys
);
monGetLogs
(
&
mmInfo
->
log
s
);
monGetLogs
(
&
mmInfo
->
log
);
}
}
...
...
source/dnode/mgmt/qm/qmHandle.c
浏览文件 @
b34ea72a
...
...
@@ -19,7 +19,7 @@
void
qmGetMonitorInfo
(
SMgmtWrapper
*
pWrapper
,
SMonQmInfo
*
qmInfo
)
{
if
(
pWrapper
->
procType
==
PROC_CHILD
)
{
dmGetMonitorSysInfo
(
&
qmInfo
->
sys
);
monGetLogs
(
&
qmInfo
->
log
s
);
monGetLogs
(
&
qmInfo
->
log
);
}
}
...
...
source/dnode/mgmt/sm/smHandle.c
浏览文件 @
b34ea72a
...
...
@@ -19,7 +19,7 @@
void
smGetMonitorInfo
(
SMgmtWrapper
*
pWrapper
,
SMonSmInfo
*
smInfo
)
{
if
(
pWrapper
->
procType
==
PROC_CHILD
)
{
dmGetMonitorSysInfo
(
&
smInfo
->
sys
);
monGetLogs
(
&
smInfo
->
log
s
);
monGetLogs
(
&
smInfo
->
log
);
}
}
...
...
source/dnode/mgmt/vm/vmHandle.c
浏览文件 @
b34ea72a
...
...
@@ -34,7 +34,7 @@ void vmGetMonitorInfo(SMgmtWrapper *pWrapper, SMonVmInfo *vmInfo) {
if
(
pWrapper
->
procType
==
PROC_CHILD
)
{
dmGetMonitorSysInfo
(
&
vmInfo
->
sys
);
monGetLogs
(
&
vmInfo
->
log
s
);
monGetLogs
(
&
vmInfo
->
log
);
}
}
...
...
source/libs/monitor/inc/monInt.h
浏览文件 @
b34ea72a
...
...
@@ -24,7 +24,7 @@ typedef struct {
int64_t
curTime
;
int64_t
lastTime
;
SJson
*
pJson
;
SMonLogs
log
s
;
SMonLogs
log
;
SMonDmInfo
dmInfo
;
SMonMmInfo
mmInfo
;
SMonVmInfo
vmInfo
;
...
...
source/libs/monitor/src/monMain.c
浏览文件 @
b34ea72a
...
...
@@ -124,7 +124,7 @@ void monCleanup() {
static
void
monCleanupMonitorInfo
(
SMonInfo
*
pMonitor
)
{
tsMonitor
.
lastTime
=
pMonitor
->
curTime
;
taosArrayDestroy
(
pMonitor
->
log
s
.
logs
);
taosArrayDestroy
(
pMonitor
->
log
.
logs
);
tFreeSMonMmInfo
(
&
pMonitor
->
mmInfo
);
tFreeSMonVmInfo
(
&
pMonitor
->
vmInfo
);
tFreeSMonSmInfo
(
&
pMonitor
->
smInfo
);
...
...
@@ -141,7 +141,7 @@ static SMonInfo *monCreateMonitorInfo() {
return
NULL
;
}
monGetLogs
(
&
pMonitor
->
log
s
);
monGetLogs
(
&
pMonitor
->
log
);
taosThreadMutexLock
(
&
tsMonitor
.
lock
);
memcpy
(
&
pMonitor
->
dmInfo
,
&
tsMonitor
.
dmInfo
,
sizeof
(
SMonDmInfo
));
...
...
@@ -159,7 +159,7 @@ static SMonInfo *monCreateMonitorInfo() {
taosThreadMutexUnlock
(
&
tsMonitor
.
lock
);
pMonitor
->
pJson
=
tjsonCreateObject
();
if
(
pMonitor
->
pJson
==
NULL
||
pMonitor
->
log
s
.
logs
==
NULL
)
{
if
(
pMonitor
->
pJson
==
NULL
||
pMonitor
->
log
.
logs
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
monCleanupMonitorInfo
(
pMonitor
);
return
NULL
;
...
...
@@ -447,12 +447,12 @@ static void monGenLogJson(SMonInfo *pMonitor) {
if
(
pLogsJson
==
NULL
)
return
;
SMonLogs
*
logs
[
6
];
logs
[
0
]
=
&
pMonitor
->
log
s
;
logs
[
1
]
=
&
pMonitor
->
mmInfo
.
log
s
;
logs
[
2
]
=
&
pMonitor
->
vmInfo
.
log
s
;
logs
[
3
]
=
&
pMonitor
->
smInfo
.
log
s
;
logs
[
4
]
=
&
pMonitor
->
qmInfo
.
log
s
;
logs
[
5
]
=
&
pMonitor
->
bmInfo
.
log
s
;
logs
[
0
]
=
&
pMonitor
->
log
;
logs
[
1
]
=
&
pMonitor
->
mmInfo
.
log
;
logs
[
2
]
=
&
pMonitor
->
vmInfo
.
log
;
logs
[
3
]
=
&
pMonitor
->
smInfo
.
log
;
logs
[
4
]
=
&
pMonitor
->
qmInfo
.
log
;
logs
[
5
]
=
&
pMonitor
->
bmInfo
.
log
;
int32_t
numOfErrorLogs
=
0
;
int32_t
numOfInfoLogs
=
0
;
...
...
@@ -460,17 +460,17 @@ static void monGenLogJson(SMonInfo *pMonitor) {
int32_t
numOfTraceLogs
=
0
;
for
(
int32_t
j
=
0
;
j
<
6
;
j
++
)
{
SMonLogs
*
pLog
s
=
logs
[
j
];
numOfErrorLogs
+=
pLog
s
->
numOfErrorLogs
;
numOfInfoLogs
+=
pLog
s
->
numOfInfoLogs
;
numOfDebugLogs
+=
pLog
s
->
numOfDebugLogs
;
numOfTraceLogs
+=
pLog
s
->
numOfTraceLogs
;
SMonLogs
*
pLog
=
logs
[
j
];
numOfErrorLogs
+=
pLog
->
numOfErrorLogs
;
numOfInfoLogs
+=
pLog
->
numOfInfoLogs
;
numOfDebugLogs
+=
pLog
->
numOfDebugLogs
;
numOfTraceLogs
+=
pLog
->
numOfTraceLogs
;
for
(
int32_t
i
=
0
;
i
<
taosArrayGetSize
(
pLog
s
->
logs
);
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
taosArrayGetSize
(
pLog
->
logs
);
++
i
)
{
SJson
*
pLogJson
=
tjsonCreateObject
();
if
(
pLogJson
==
NULL
)
continue
;
SMonLogItem
*
pLogItem
=
taosArrayGet
(
pLog
s
->
logs
,
i
);
SMonLogItem
*
pLogItem
=
taosArrayGet
(
pLog
->
logs
,
i
);
char
buf
[
40
]
=
{
0
};
taosFormatUtcTime
(
buf
,
sizeof
(
buf
),
pLogItem
->
ts
,
TSDB_TIME_PRECISION_MILLI
);
...
...
source/libs/monitor/src/monMsg.c
浏览文件 @
b34ea72a
...
...
@@ -226,7 +226,7 @@ int32_t tSerializeSMonMmInfo(void *buf, int32_t bufLen, SMonMmInfo *pInfo) {
if
(
tEncodeSMonVgroupInfo
(
&
encoder
,
&
pInfo
->
vgroup
)
<
0
)
return
-
1
;
if
(
tEncodeSMonGrantInfo
(
&
encoder
,
&
pInfo
->
grant
)
<
0
)
return
-
1
;
if
(
tEncodeSMonSysInfo
(
&
encoder
,
&
pInfo
->
sys
)
<
0
)
return
-
1
;
if
(
tEncodeSMonLogs
(
&
encoder
,
&
pInfo
->
log
s
)
<
0
)
return
-
1
;
if
(
tEncodeSMonLogs
(
&
encoder
,
&
pInfo
->
log
)
<
0
)
return
-
1
;
tEndEncode
(
&
encoder
);
int32_t
tlen
=
encoder
.
pos
;
...
...
@@ -243,7 +243,7 @@ int32_t tDeserializeSMonMmInfo(void *buf, int32_t bufLen, SMonMmInfo *pInfo) {
if
(
tDecodeSMonVgroupInfo
(
&
decoder
,
&
pInfo
->
vgroup
)
<
0
)
return
-
1
;
if
(
tDecodeSMonGrantInfo
(
&
decoder
,
&
pInfo
->
grant
)
<
0
)
return
-
1
;
if
(
tDecodeSMonSysInfo
(
&
decoder
,
&
pInfo
->
sys
)
<
0
)
return
-
1
;
if
(
tDecodeSMonLogs
(
&
decoder
,
&
pInfo
->
log
s
)
<
0
)
return
-
1
;
if
(
tDecodeSMonLogs
(
&
decoder
,
&
pInfo
->
log
)
<
0
)
return
-
1
;
tEndDecode
(
&
decoder
);
tCoderClear
(
&
decoder
);
...
...
@@ -251,8 +251,14 @@ int32_t tDeserializeSMonMmInfo(void *buf, int32_t bufLen, SMonMmInfo *pInfo) {
}
void
tFreeSMonMmInfo
(
SMonMmInfo
*
pInfo
)
{
taosArrayDestroy
(
pInfo
->
logs
.
logs
);
pInfo
->
logs
.
logs
=
NULL
;
taosArrayDestroy
(
pInfo
->
log
.
logs
);
taosArrayDestroy
(
pInfo
->
cluster
.
mnodes
);
taosArrayDestroy
(
pInfo
->
cluster
.
dnodes
);
taosArrayDestroy
(
pInfo
->
vgroup
.
vgroups
);
pInfo
->
cluster
.
mnodes
=
NULL
;
pInfo
->
cluster
.
dnodes
=
NULL
;
pInfo
->
vgroup
.
vgroups
=
NULL
;
pInfo
->
log
.
logs
=
NULL
;
}
int32_t
tEncodeSMonDiskDesc
(
SCoder
*
encoder
,
const
SMonDiskDesc
*
pDesc
)
{
...
...
@@ -331,7 +337,7 @@ int32_t tSerializeSMonVmInfo(void *buf, int32_t bufLen, SMonVmInfo *pInfo) {
if
(
tEncodeSMonDiskInfo
(
&
encoder
,
&
pInfo
->
tfs
)
<
0
)
return
-
1
;
if
(
tEncodeSVnodesStat
(
&
encoder
,
&
pInfo
->
vstat
)
<
0
)
return
-
1
;
if
(
tEncodeSMonSysInfo
(
&
encoder
,
&
pInfo
->
sys
)
<
0
)
return
-
1
;
if
(
tEncodeSMonLogs
(
&
encoder
,
&
pInfo
->
log
s
)
<
0
)
return
-
1
;
if
(
tEncodeSMonLogs
(
&
encoder
,
&
pInfo
->
log
)
<
0
)
return
-
1
;
tEndEncode
(
&
encoder
);
int32_t
tlen
=
encoder
.
pos
;
...
...
@@ -347,7 +353,7 @@ int32_t tDeserializeSMonVmInfo(void *buf, int32_t bufLen, SMonVmInfo *pInfo) {
if
(
tDecodeSMonDiskInfo
(
&
decoder
,
&
pInfo
->
tfs
)
<
0
)
return
-
1
;
if
(
tDecodeSVnodesStat
(
&
decoder
,
&
pInfo
->
vstat
)
<
0
)
return
-
1
;
if
(
tDecodeSMonSysInfo
(
&
decoder
,
&
pInfo
->
sys
)
<
0
)
return
-
1
;
if
(
tDecodeSMonLogs
(
&
decoder
,
&
pInfo
->
log
s
)
<
0
)
return
-
1
;
if
(
tDecodeSMonLogs
(
&
decoder
,
&
pInfo
->
log
)
<
0
)
return
-
1
;
tEndDecode
(
&
decoder
);
tCoderClear
(
&
decoder
);
...
...
@@ -355,8 +361,10 @@ int32_t tDeserializeSMonVmInfo(void *buf, int32_t bufLen, SMonVmInfo *pInfo) {
}
void
tFreeSMonVmInfo
(
SMonVmInfo
*
pInfo
)
{
taosArrayDestroy
(
pInfo
->
logs
.
logs
);
pInfo
->
logs
.
logs
=
NULL
;
taosArrayDestroy
(
pInfo
->
log
.
logs
);
taosArrayDestroy
(
pInfo
->
tfs
.
datadirs
);
pInfo
->
log
.
logs
=
NULL
;
pInfo
->
tfs
.
datadirs
=
NULL
;
}
int32_t
tSerializeSMonQmInfo
(
void
*
buf
,
int32_t
bufLen
,
SMonQmInfo
*
pInfo
)
{
...
...
@@ -365,7 +373,7 @@ int32_t tSerializeSMonQmInfo(void *buf, int32_t bufLen, SMonQmInfo *pInfo) {
if
(
tStartEncode
(
&
encoder
)
<
0
)
return
-
1
;
if
(
tEncodeSMonSysInfo
(
&
encoder
,
&
pInfo
->
sys
)
<
0
)
return
-
1
;
if
(
tEncodeSMonLogs
(
&
encoder
,
&
pInfo
->
log
s
)
<
0
)
return
-
1
;
if
(
tEncodeSMonLogs
(
&
encoder
,
&
pInfo
->
log
)
<
0
)
return
-
1
;
tEndEncode
(
&
encoder
);
int32_t
tlen
=
encoder
.
pos
;
...
...
@@ -379,7 +387,7 @@ int32_t tDeserializeSMonQmInfo(void *buf, int32_t bufLen, SMonQmInfo *pInfo) {
if
(
tStartDecode
(
&
decoder
)
<
0
)
return
-
1
;
if
(
tDecodeSMonSysInfo
(
&
decoder
,
&
pInfo
->
sys
)
<
0
)
return
-
1
;
if
(
tDecodeSMonLogs
(
&
decoder
,
&
pInfo
->
log
s
)
<
0
)
return
-
1
;
if
(
tDecodeSMonLogs
(
&
decoder
,
&
pInfo
->
log
)
<
0
)
return
-
1
;
tEndDecode
(
&
decoder
);
tCoderClear
(
&
decoder
);
...
...
@@ -387,8 +395,8 @@ int32_t tDeserializeSMonQmInfo(void *buf, int32_t bufLen, SMonQmInfo *pInfo) {
}
void
tFreeSMonQmInfo
(
SMonQmInfo
*
pInfo
)
{
taosArrayDestroy
(
pInfo
->
log
s
.
logs
);
pInfo
->
log
s
.
logs
=
NULL
;
taosArrayDestroy
(
pInfo
->
log
.
logs
);
pInfo
->
log
.
logs
=
NULL
;
}
int32_t
tSerializeSMonSmInfo
(
void
*
buf
,
int32_t
bufLen
,
SMonSmInfo
*
pInfo
)
{
...
...
@@ -397,7 +405,7 @@ int32_t tSerializeSMonSmInfo(void *buf, int32_t bufLen, SMonSmInfo *pInfo) {
if
(
tStartEncode
(
&
encoder
)
<
0
)
return
-
1
;
if
(
tEncodeSMonSysInfo
(
&
encoder
,
&
pInfo
->
sys
)
<
0
)
return
-
1
;
if
(
tEncodeSMonLogs
(
&
encoder
,
&
pInfo
->
log
s
)
<
0
)
return
-
1
;
if
(
tEncodeSMonLogs
(
&
encoder
,
&
pInfo
->
log
)
<
0
)
return
-
1
;
tEndEncode
(
&
encoder
);
int32_t
tlen
=
encoder
.
pos
;
...
...
@@ -411,7 +419,7 @@ int32_t tDeserializeSMonSmInfo(void *buf, int32_t bufLen, SMonSmInfo *pInfo) {
if
(
tStartDecode
(
&
decoder
)
<
0
)
return
-
1
;
if
(
tDecodeSMonSysInfo
(
&
decoder
,
&
pInfo
->
sys
)
<
0
)
return
-
1
;
if
(
tDecodeSMonLogs
(
&
decoder
,
&
pInfo
->
log
s
)
<
0
)
return
-
1
;
if
(
tDecodeSMonLogs
(
&
decoder
,
&
pInfo
->
log
)
<
0
)
return
-
1
;
tEndDecode
(
&
decoder
);
tCoderClear
(
&
decoder
);
...
...
@@ -419,8 +427,8 @@ int32_t tDeserializeSMonSmInfo(void *buf, int32_t bufLen, SMonSmInfo *pInfo) {
}
void
tFreeSMonSmInfo
(
SMonSmInfo
*
pInfo
)
{
taosArrayDestroy
(
pInfo
->
log
s
.
logs
);
pInfo
->
log
s
.
logs
=
NULL
;
taosArrayDestroy
(
pInfo
->
log
.
logs
);
pInfo
->
log
.
logs
=
NULL
;
}
int32_t
tSerializeSMonBmInfo
(
void
*
buf
,
int32_t
bufLen
,
SMonBmInfo
*
pInfo
)
{
...
...
@@ -429,7 +437,7 @@ int32_t tSerializeSMonBmInfo(void *buf, int32_t bufLen, SMonBmInfo *pInfo) {
if
(
tStartEncode
(
&
encoder
)
<
0
)
return
-
1
;
if
(
tEncodeSMonSysInfo
(
&
encoder
,
&
pInfo
->
sys
)
<
0
)
return
-
1
;
if
(
tEncodeSMonLogs
(
&
encoder
,
&
pInfo
->
log
s
)
<
0
)
return
-
1
;
if
(
tEncodeSMonLogs
(
&
encoder
,
&
pInfo
->
log
)
<
0
)
return
-
1
;
tEndEncode
(
&
encoder
);
int32_t
tlen
=
encoder
.
pos
;
...
...
@@ -443,7 +451,7 @@ int32_t tDeserializeSMonBmInfo(void *buf, int32_t bufLen, SMonBmInfo *pInfo) {
if
(
tStartDecode
(
&
decoder
)
<
0
)
return
-
1
;
if
(
tDecodeSMonSysInfo
(
&
decoder
,
&
pInfo
->
sys
)
<
0
)
return
-
1
;
if
(
tDecodeSMonLogs
(
&
decoder
,
&
pInfo
->
log
s
)
<
0
)
return
-
1
;
if
(
tDecodeSMonLogs
(
&
decoder
,
&
pInfo
->
log
)
<
0
)
return
-
1
;
tEndDecode
(
&
decoder
);
tCoderClear
(
&
decoder
);
...
...
@@ -451,8 +459,8 @@ int32_t tDeserializeSMonBmInfo(void *buf, int32_t bufLen, SMonBmInfo *pInfo) {
}
void
tFreeSMonBmInfo
(
SMonBmInfo
*
pInfo
)
{
taosArrayDestroy
(
pInfo
->
log
s
.
logs
);
pInfo
->
log
s
.
logs
=
NULL
;
taosArrayDestroy
(
pInfo
->
log
.
logs
);
pInfo
->
log
.
logs
=
NULL
;
}
int32_t
tSerializeSMonVloadInfo
(
void
*
buf
,
int32_t
bufLen
,
SMonVloadInfo
*
pInfo
)
{
...
...
source/libs/monitor/test/monTest.cpp
浏览文件 @
b34ea72a
...
...
@@ -248,25 +248,25 @@ TEST_F(MonitorTest, 01_Full) {
GetVgroupInfo
(
&
mmInfo
.
vgroup
);
GetGrantInfo
(
&
mmInfo
.
grant
);
GetSysInfo
(
&
mmInfo
.
sys
);
GetLogInfo
(
&
mmInfo
.
log
s
);
GetLogInfo
(
&
mmInfo
.
log
);
SMonVmInfo
vmInfo
=
{
0
};
GetDiskInfo
(
&
vmInfo
.
tfs
);
GetVnodeStat
(
&
vmInfo
.
vstat
);
GetSysInfo
(
&
vmInfo
.
sys
);
GetLogInfo
(
&
vmInfo
.
log
s
);
GetLogInfo
(
&
vmInfo
.
log
);
SMonQmInfo
qmInfo
=
{
0
};
GetSysInfo
(
&
qmInfo
.
sys
);
GetLogInfo
(
&
qmInfo
.
log
s
);
GetLogInfo
(
&
qmInfo
.
log
);
SMonSmInfo
smInfo
=
{
0
};
GetSysInfo
(
&
smInfo
.
sys
);
GetLogInfo
(
&
smInfo
.
log
s
);
GetLogInfo
(
&
smInfo
.
log
);
SMonBmInfo
bmInfo
=
{
0
};
GetSysInfo
(
&
bmInfo
.
sys
);
GetLogInfo
(
&
bmInfo
.
log
s
);
GetLogInfo
(
&
bmInfo
.
log
);
monSetDmInfo
(
&
dmInfo
);
monSetMmInfo
(
&
mmInfo
);
...
...
source/os/src/osSysinfo.c
浏览文件 @
b34ea72a
...
...
@@ -623,7 +623,7 @@ void taosGetProcIODelta(int64_t *rchars, int64_t *wchars, int64_t *read_bytes, i
static
int64_t
cur_wchars
=
0
;
static
int64_t
cur_read_bytes
=
0
;
static
int64_t
cur_write_bytes
=
0
;
if
(
taosGetProcIO
(
&
cur_rchars
,
&
cur_wchars
,
&
cur_read_bytes
,
&
cur_write_bytes
)
!
=
0
)
{
if
(
taosGetProcIO
(
&
cur_rchars
,
&
cur_wchars
,
&
cur_read_bytes
,
&
cur_write_bytes
)
=
=
0
)
{
*
rchars
=
cur_rchars
-
last_rchars
;
*
wchars
=
cur_wchars
-
last_wchars
;
*
read_bytes
=
cur_read_bytes
-
last_read_bytes
;
...
...
@@ -696,7 +696,7 @@ void taosGetCardInfoDelta(int64_t *receive_bytes, int64_t *transmit_bytes) {
static
int64_t
cur_receive_bytes
=
0
;
static
int64_t
cur_transmit_bytes
=
0
;
if
(
taosGetCardInfo
(
&
cur_receive_bytes
,
&
cur_transmit_bytes
)
!
=
0
)
{
if
(
taosGetCardInfo
(
&
cur_receive_bytes
,
&
cur_transmit_bytes
)
=
=
0
)
{
*
receive_bytes
=
cur_receive_bytes
-
last_receive_bytes
;
*
transmit_bytes
=
cur_transmit_bytes
-
last_transmit_bytes
;
last_receive_bytes
=
cur_receive_bytes
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录