Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
97d533d5
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
Star
22018
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看板
提交
97d533d5
编写于
9月 01, 2022
作者:
M
Minglei Jin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tsdbCache/usage: new cacheload column for db.vgroups to check usage
上级
bd0523dd
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
23 addition
and
11 deletion
+23
-11
include/common/tmsg.h
include/common/tmsg.h
+4
-3
source/common/src/systable.c
source/common/src/systable.c
+1
-0
source/common/src/tmsg.c
source/common/src/tmsg.c
+2
-0
source/dnode/mnode/impl/inc/mndDef.h
source/dnode/mnode/impl/inc/mndDef.h
+1
-0
source/dnode/mnode/impl/src/mndDnode.c
source/dnode/mnode/impl/src/mndDnode.c
+4
-3
source/dnode/mnode/impl/src/mndVgroup.c
source/dnode/mnode/impl/src/mndVgroup.c
+3
-0
source/dnode/vnode/inc/vnode.h
source/dnode/vnode/inc/vnode.h
+1
-0
source/dnode/vnode/src/tsdb/tsdbCache.c
source/dnode/vnode/src/tsdb/tsdbCache.c
+2
-0
source/dnode/vnode/src/vnd/vnodeQuery.c
source/dnode/vnode/src/vnd/vnodeQuery.c
+3
-2
source/libs/monitor/src/monMsg.c
source/libs/monitor/src/monMsg.c
+2
-3
未找到文件。
include/common/tmsg.h
浏览文件 @
97d533d5
...
...
@@ -1066,6 +1066,7 @@ typedef struct {
typedef
struct
{
int32_t
vgId
;
int32_t
syncState
;
int64_t
cacheUsage
;
int64_t
numOfTables
;
int64_t
numOfTimeSeries
;
int64_t
totalStorage
;
...
...
@@ -2069,9 +2070,9 @@ int32_t tDeserializeSVCreateTbBatchRsp(void* buf, int32_t bufLen, SVCreateTbBatc
// TDMT_VND_DROP_TABLE =================
typedef
struct
{
char
*
name
;
uint64_t
suid
;
// for tmq in wal format
int8_t
igNotExists
;
char
*
name
;
uint64_t
suid
;
// for tmq in wal format
int8_t
igNotExists
;
}
SVDropTbReq
;
typedef
struct
{
...
...
source/common/src/systable.c
浏览文件 @
97d533d5
...
...
@@ -206,6 +206,7 @@ static const SSysDbTableSchema vgroupsSchema[] = {
{.
name
=
"v3_dnode"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
,
.
sysInfo
=
true
},
{.
name
=
"v3_status"
,
.
bytes
=
10
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
,
.
sysInfo
=
true
},
{.
name
=
"status"
,
.
bytes
=
12
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
,
.
sysInfo
=
true
},
{.
name
=
"cacheload"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
,
.
sysInfo
=
true
},
{.
name
=
"nfiles"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
,
.
sysInfo
=
true
},
{.
name
=
"file_size"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
,
.
sysInfo
=
true
},
{.
name
=
"tsma"
,
.
bytes
=
1
,
.
type
=
TSDB_DATA_TYPE_TINYINT
,
.
sysInfo
=
true
},
...
...
source/common/src/tmsg.c
浏览文件 @
97d533d5
...
...
@@ -994,6 +994,7 @@ int32_t tSerializeSStatusReq(void *buf, int32_t bufLen, SStatusReq *pReq) {
SVnodeLoad
*
pload
=
taosArrayGet
(
pReq
->
pVloads
,
i
);
if
(
tEncodeI32
(
&
encoder
,
pload
->
vgId
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pload
->
syncState
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
&
encoder
,
pload
->
cacheUsage
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
&
encoder
,
pload
->
numOfTables
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
&
encoder
,
pload
->
numOfTimeSeries
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
&
encoder
,
pload
->
totalStorage
)
<
0
)
return
-
1
;
...
...
@@ -1063,6 +1064,7 @@ int32_t tDeserializeSStatusReq(void *buf, int32_t bufLen, SStatusReq *pReq) {
SVnodeLoad
vload
=
{
0
};
if
(
tDecodeI32
(
&
decoder
,
&
vload
.
vgId
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
vload
.
syncState
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
&
decoder
,
&
vload
.
cacheUsage
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
&
decoder
,
&
vload
.
numOfTables
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
&
decoder
,
&
vload
.
numOfTimeSeries
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
&
decoder
,
&
vload
.
totalStorage
)
<
0
)
return
-
1
;
...
...
source/dnode/mnode/impl/inc/mndDef.h
浏览文件 @
97d533d5
...
...
@@ -340,6 +340,7 @@ typedef struct {
uint32_t
hashEnd
;
char
dbName
[
TSDB_DB_FNAME_LEN
];
int64_t
dbUid
;
int64_t
cacheUsage
;
int64_t
numOfTables
;
int64_t
numOfTimeSeries
;
int64_t
totalStorage
;
...
...
source/dnode/mnode/impl/src/mndDnode.c
浏览文件 @
97d533d5
...
...
@@ -347,6 +347,7 @@ static int32_t mndProcessStatusReq(SRpcMsg *pReq) {
SVgObj
*
pVgroup
=
mndAcquireVgroup
(
pMnode
,
pVload
->
vgId
);
if
(
pVgroup
!=
NULL
)
{
if
(
pVload
->
syncState
==
TAOS_SYNC_STATE_LEADER
)
{
pVgroup
->
cacheUsage
=
pVload
->
cacheUsage
;
pVgroup
->
numOfTables
=
pVload
->
numOfTables
;
pVgroup
->
numOfTimeSeries
=
pVload
->
numOfTimeSeries
;
pVgroup
->
totalStorage
=
pVload
->
totalStorage
;
...
...
@@ -853,8 +854,8 @@ static int32_t mndProcessConfigDnodeReq(SRpcMsg *pReq) {
}
int32_t
code
=
-
1
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
void
*
pIter
=
NULL
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
void
*
pIter
=
NULL
;
while
(
1
)
{
SDnodeObj
*
pDnode
=
NULL
;
pIter
=
sdbFetch
(
pSdb
,
SDB_DNODE
,
pIter
,
(
void
**
)
&
pDnode
);
...
...
@@ -877,7 +878,7 @@ static int32_t mndProcessConfigDnodeReq(SRpcMsg *pReq) {
sdbRelease
(
pSdb
,
pDnode
);
}
if
(
code
==
-
1
)
{
terrno
=
TSDB_CODE_MND_DNODE_NOT_EXIST
;
}
...
...
source/dnode/mnode/impl/src/mndVgroup.c
浏览文件 @
97d533d5
...
...
@@ -693,6 +693,9 @@ static int32_t mndRetrieveVgroups(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *p
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppendNULL
(
pColInfo
,
numOfRows
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pVgroup
->
cacheUsage
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppendNULL
(
pColInfo
,
numOfRows
);
...
...
source/dnode/vnode/inc/vnode.h
浏览文件 @
97d533d5
...
...
@@ -155,6 +155,7 @@ int32_t tsdbGetTableSchema(SVnode *pVnode, int64_t uid, STSchema **pSchema, int6
void
tsdbCacheSetCapacity
(
SVnode
*
pVnode
,
size_t
capacity
);
size_t
tsdbCacheGetCapacity
(
SVnode
*
pVnode
);
size_t
tsdbCacheGetUsage
(
SVnode
*
pVnode
);
// tq
typedef
struct
SMetaTableInfo
{
...
...
source/dnode/vnode/src/tsdb/tsdbCache.c
浏览文件 @
97d533d5
...
...
@@ -1334,3 +1334,5 @@ void tsdbCacheSetCapacity(SVnode *pVnode, size_t capacity) {
}
size_t
tsdbCacheGetCapacity
(
SVnode
*
pVnode
)
{
return
taosLRUCacheGetCapacity
(
pVnode
->
pTsdb
->
lruCache
);
}
size_t
tsdbCacheGetUsage
(
SVnode
*
pVnode
)
{
return
taosLRUCacheGetUsage
(
pVnode
->
pTsdb
->
lruCache
);
}
source/dnode/vnode/src/vnd/vnodeQuery.c
浏览文件 @
97d533d5
...
...
@@ -368,6 +368,7 @@ _exit:
int32_t
vnodeGetLoad
(
SVnode
*
pVnode
,
SVnodeLoad
*
pLoad
)
{
pLoad
->
vgId
=
TD_VID
(
pVnode
);
pLoad
->
syncState
=
syncGetMyRole
(
pVnode
->
sync
);
pLoad
->
cacheUsage
=
tsdbCacheGetUsage
(
pVnode
);
pLoad
->
numOfTables
=
metaGetTbNum
(
pVnode
->
pMeta
);
pLoad
->
numOfTimeSeries
=
metaGetTimeSeriesNum
(
pVnode
->
pMeta
);
pLoad
->
totalStorage
=
(
int64_t
)
3
*
1073741824
;
...
...
@@ -424,8 +425,8 @@ int32_t vnodeGetCtbIdList(SVnode *pVnode, int64_t suid, SArray *list) {
return
TSDB_CODE_SUCCESS
;
}
int32_t
vnodeGetStbIdList
(
SVnode
*
pVnode
,
int64_t
suid
,
SArray
*
list
)
{
SMStbCursor
*
pCur
=
metaOpenStbCursor
(
pVnode
->
pMeta
,
suid
);
int32_t
vnodeGetStbIdList
(
SVnode
*
pVnode
,
int64_t
suid
,
SArray
*
list
)
{
SMStbCursor
*
pCur
=
metaOpenStbCursor
(
pVnode
->
pMeta
,
suid
);
if
(
!
pCur
)
{
return
TSDB_CODE_FAILED
;
}
...
...
source/libs/monitor/src/monMsg.c
浏览文件 @
97d533d5
...
...
@@ -510,6 +510,7 @@ int32_t tSerializeSMonVloadInfo(void *buf, int32_t bufLen, SMonVloadInfo *pInfo)
SVnodeLoad
*
pLoad
=
taosArrayGet
(
pInfo
->
pVloads
,
i
);
if
(
tEncodeI32
(
&
encoder
,
pLoad
->
vgId
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pLoad
->
syncState
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
&
encoder
,
pLoad
->
cacheUsage
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
&
encoder
,
pLoad
->
numOfTables
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
&
encoder
,
pLoad
->
numOfTimeSeries
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
&
encoder
,
pLoad
->
totalStorage
)
<
0
)
return
-
1
;
...
...
@@ -544,6 +545,7 @@ int32_t tDeserializeSMonVloadInfo(void *buf, int32_t bufLen, SMonVloadInfo *pInf
SVnodeLoad
load
=
{
0
};
if
(
tDecodeI32
(
&
decoder
,
&
load
.
vgId
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
load
.
syncState
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
&
decoder
,
&
load
.
cacheUsage
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
&
decoder
,
&
load
.
numOfTables
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
&
decoder
,
&
load
.
numOfTimeSeries
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
&
decoder
,
&
load
.
totalStorage
)
<
0
)
return
-
1
;
...
...
@@ -594,7 +596,6 @@ int32_t tDeserializeSMonMloadInfo(void *buf, int32_t bufLen, SMonMloadInfo *pInf
return
0
;
}
int32_t
tSerializeSQnodeLoad
(
void
*
buf
,
int32_t
bufLen
,
SQnodeLoad
*
pInfo
)
{
SEncoder
encoder
=
{
0
};
tEncoderInit
(
&
encoder
,
buf
,
bufLen
);
...
...
@@ -639,5 +640,3 @@ int32_t tDeserializeSQnodeLoad(void *buf, int32_t bufLen, SQnodeLoad *pInfo) {
tDecoderClear
(
&
decoder
);
return
0
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录