Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ce661e41
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看板
提交
ce661e41
编写于
2月 10, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
collect vload infos
上级
c2c74b82
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
41 addition
and
6 deletion
+41
-6
include/common/tmsg.h
include/common/tmsg.h
+2
-1
source/common/src/tmsg.c
source/common/src/tmsg.c
+4
-2
source/dnode/mnode/impl/inc/mndDef.h
source/dnode/mnode/impl/inc/mndDef.h
+2
-2
source/dnode/mnode/impl/src/mndDnode.c
source/dnode/mnode/impl/src/mndDnode.c
+21
-0
source/dnode/vnode/CMakeLists.txt
source/dnode/vnode/CMakeLists.txt
+1
-0
source/dnode/vnode/src/vnd/vnodeInt.c
source/dnode/vnode/src/vnd/vnodeInt.c
+11
-1
未找到文件。
include/common/tmsg.h
浏览文件 @
ce661e41
...
...
@@ -614,10 +614,11 @@ typedef struct {
typedef
struct
{
int32_t
vgId
;
int8_t
role
;
int64_t
numOfTables
;
int64_t
numOfTimeSeries
;
int64_t
totalStorage
;
int64_t
compStorage
;
int64_t
pointsWritten
;
int64_t
tablesNum
;
}
SVnodeLoad
;
typedef
struct
{
...
...
source/common/src/tmsg.c
浏览文件 @
ce661e41
...
...
@@ -489,10 +489,11 @@ int32_t tSerializeSStatusReq(void **buf, SStatusReq *pReq) {
SVnodeLoad
*
pload
=
taosArrayGet
(
pReq
->
pVloads
,
i
);
tlen
+=
taosEncodeFixedI32
(
buf
,
pload
->
vgId
);
tlen
+=
taosEncodeFixedI8
(
buf
,
pload
->
role
);
tlen
+=
taosEncodeFixedI64
(
buf
,
pload
->
numOfTables
);
tlen
+=
taosEncodeFixedI64
(
buf
,
pload
->
numOfTimeSeries
);
tlen
+=
taosEncodeFixedI64
(
buf
,
pload
->
totalStorage
);
tlen
+=
taosEncodeFixedI64
(
buf
,
pload
->
compStorage
);
tlen
+=
taosEncodeFixedI64
(
buf
,
pload
->
pointsWritten
);
tlen
+=
taosEncodeFixedI64
(
buf
,
pload
->
tablesNum
);
}
return
tlen
;
...
...
@@ -531,10 +532,11 @@ void *tDeserializeSStatusReq(void *buf, SStatusReq *pReq) {
SVnodeLoad
vload
=
{
0
};
buf
=
taosDecodeFixedI32
(
buf
,
&
vload
.
vgId
);
buf
=
taosDecodeFixedI8
(
buf
,
&
vload
.
role
);
buf
=
taosDecodeFixedI64
(
buf
,
&
vload
.
numOfTables
);
buf
=
taosDecodeFixedI64
(
buf
,
&
vload
.
numOfTimeSeries
);
buf
=
taosDecodeFixedI64
(
buf
,
&
vload
.
totalStorage
);
buf
=
taosDecodeFixedI64
(
buf
,
&
vload
.
compStorage
);
buf
=
taosDecodeFixedI64
(
buf
,
&
vload
.
pointsWritten
);
buf
=
taosDecodeFixedI64
(
buf
,
&
vload
.
tablesNum
);
if
(
taosArrayPush
(
pReq
->
pVloads
,
&
vload
)
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
NULL
;
...
...
source/dnode/mnode/impl/inc/mndDef.h
浏览文件 @
ce661e41
...
...
@@ -283,8 +283,8 @@ typedef struct {
uint32_t
hashEnd
;
char
dbName
[
TSDB_DB_FNAME_LEN
];
int64_t
dbUid
;
int
32
_t
numOfTables
;
int
32
_t
numOfTimeSeries
;
int
64
_t
numOfTables
;
int
64
_t
numOfTimeSeries
;
int64_t
totalStorage
;
int64_t
compStorage
;
int64_t
pointsWritten
;
...
...
source/dnode/mnode/impl/src/mndDnode.c
浏览文件 @
ce661e41
...
...
@@ -374,6 +374,27 @@ static int32_t mndProcessStatusReq(SMnodeMsg *pReq) {
pDnode
->
numOfCores
=
statusReq
.
numOfCores
;
pDnode
->
numOfSupportVnodes
=
statusReq
.
numOfSupportVnodes
;
int32_t
numOfVloads
=
(
int32_t
)
taosArrayGetSize
(
statusReq
.
pVloads
);
for
(
int32_t
v
=
0
;
v
<
numOfVloads
;
++
v
)
{
SVnodeLoad
*
pVload
=
taosArrayGet
(
statusReq
.
pVloads
,
v
);
SVgObj
*
pVgroup
=
mndAcquireVgroup
(
pMnode
,
pVload
->
vgId
);
if
(
pVgroup
!=
NULL
)
{
if
(
pVload
->
role
==
TAOS_SYNC_STATE_LEADER
)
{
pVgroup
->
numOfTables
=
pVload
->
numOfTables
;
pVgroup
->
numOfTimeSeries
=
pVload
->
numOfTimeSeries
;
pVgroup
->
totalStorage
=
pVload
->
totalStorage
;
pVgroup
->
compStorage
=
pVload
->
compStorage
;
pVgroup
->
pointsWritten
=
pVload
->
pointsWritten
;
}
for
(
int32_t
vg
=
0
;
vg
<
pVgroup
->
replica
;
++
vg
)
{
pVgroup
->
vnodeGid
[
vg
].
role
=
pVload
->
role
;
}
}
mndReleaseVgroup
(
pMnode
,
pVgroup
);
}
SStatusRsp
statusRsp
=
{
0
};
statusRsp
.
dver
=
sdbGetTableVer
(
pMnode
->
pSdb
,
SDB_DNODE
);
statusRsp
.
dnodeCfg
.
dnodeId
=
pDnode
->
id
;
...
...
source/dnode/vnode/CMakeLists.txt
浏览文件 @
ce661e41
...
...
@@ -28,6 +28,7 @@ target_link_libraries(
PUBLIC scheduler
PUBLIC executor
PUBLIC qworker
PUBLIC sync
)
if
(
${
BUILD_TEST
}
)
...
...
source/dnode/vnode/src/vnd/vnodeInt.c
浏览文件 @
ce661e41
...
...
@@ -15,6 +15,7 @@
#define _DEFAULT_SOURCE
#include "vnd.h"
#include "sync.h"
// #include "vnodeInt.h"
int32_t
vnodeAlter
(
SVnode
*
pVnode
,
const
SVnodeCfg
*
pCfg
)
{
return
0
;
}
...
...
@@ -23,7 +24,16 @@ int32_t vnodeCompact(SVnode *pVnode) { return 0; }
int32_t
vnodeSync
(
SVnode
*
pVnode
)
{
return
0
;
}
int32_t
vnodeGetLoad
(
SVnode
*
pVnode
,
SVnodeLoad
*
pLoad
)
{
return
0
;
}
int32_t
vnodeGetLoad
(
SVnode
*
pVnode
,
SVnodeLoad
*
pLoad
)
{
pLoad
->
vgId
=
pVnode
->
vgId
;
pLoad
->
role
=
TAOS_SYNC_STATE_LEADER
;
pLoad
->
numOfTables
=
500
;
pLoad
->
numOfTimeSeries
=
400
;
pLoad
->
totalStorage
=
300
;
pLoad
->
compStorage
=
200
;
pLoad
->
pointsWritten
=
100
;
return
0
;
}
int
vnodeProcessSyncReq
(
SVnode
*
pVnode
,
SRpcMsg
*
pMsg
,
SRpcMsg
**
pRsp
)
{
vInfo
(
"sync message is processed"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录