Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a2d19872
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看板
提交
a2d19872
编写于
6月 16, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
show apps
上级
49737397
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
42 addition
and
18 deletion
+42
-18
source/client/src/clientHb.c
source/client/src/clientHb.c
+3
-0
source/common/src/systable.c
source/common/src/systable.c
+1
-1
source/dnode/mnode/impl/src/mndProfile.c
source/dnode/mnode/impl/src/mndProfile.c
+19
-13
source/libs/nodes/src/nodesCodeFuncs.c
source/libs/nodes/src/nodesCodeFuncs.c
+0
-2
source/libs/nodes/src/nodesUtilFuncs.c
source/libs/nodes/src/nodesUtilFuncs.c
+0
-2
source/libs/parser/src/parAstParser.c
source/libs/parser/src/parAstParser.c
+19
-0
未找到文件。
source/client/src/clientHb.c
浏览文件 @
a2d19872
...
...
@@ -623,6 +623,8 @@ int32_t hbGatherAppInfo(void) {
req
.
appId
=
clientHbMgr
.
appId
;
taosGetAppName
(
req
.
name
,
NULL
);
}
taosHashClear
(
clientHbMgr
.
appSummary
);
for
(
int32_t
i
=
0
;
i
<
sz
;
++
i
)
{
SAppHbMgr
*
pAppHbMgr
=
taosArrayGetP
(
clientHbMgr
.
appHbMgrs
,
i
);
...
...
@@ -630,6 +632,7 @@ int32_t hbGatherAppInfo(void) {
SAppHbReq
*
pApp
=
taosHashGet
(
clientHbMgr
.
appSummary
,
&
clusterId
,
sizeof
(
clusterId
));
if
(
NULL
==
pApp
)
{
memcpy
(
&
req
.
summary
,
&
pAppHbMgr
->
pAppInstInfo
->
summary
,
sizeof
(
req
.
summary
));
req
.
startTime
=
pAppHbMgr
->
startTime
;
taosHashPut
(
clientHbMgr
.
appSummary
,
&
clusterId
,
sizeof
(
clusterId
),
&
req
,
sizeof
(
req
));
}
else
{
if
(
pAppHbMgr
->
startTime
<
pApp
->
startTime
)
{
...
...
source/common/src/systable.c
浏览文件 @
a2d19872
...
...
@@ -317,7 +317,7 @@ static const SSysDbTableSchema querySchema[] = {
static
const
SSysDbTableSchema
appSchema
[]
=
{
{.
name
=
"app_id"
,
.
bytes
=
8
,
.
type
=
TSDB_DATA_TYPE_UBIGINT
},
{.
name
=
"ip"
,
.
bytes
=
TSDB_IPv4ADDR_LEN
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_
UBIGINT
},
{.
name
=
"ip"
,
.
bytes
=
TSDB_IPv4ADDR_LEN
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_
VARCHAR
},
{.
name
=
"pid"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
},
{.
name
=
"name"
,
.
bytes
=
TSDB_APP_NAME_LEN
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"start_time"
,
.
bytes
=
8
,
.
type
=
TSDB_DATA_TYPE_TIMESTAMP
},
...
...
source/dnode/mnode/impl/src/mndProfile.c
浏览文件 @
a2d19872
...
...
@@ -863,47 +863,53 @@ static int32_t mndRetrieveApps(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlo
SColumnInfoData
*
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pApp
->
appId
,
false
);
char
ip
[
TSDB_IPv4ADDR_LEN
+
6
+
VARSTR_HEADER_SIZE
]
=
{
0
};
sprintf
(
&
ip
[
VARSTR_HEADER_SIZE
],
"%s"
,
taosIpStr
(
pApp
->
ip
));
varDataLen
(
ip
)
=
strlen
(
&
ip
[
VARSTR_HEADER_SIZE
]);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pApp
->
ip
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
ip
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pApp
->
pid
,
false
);
char
name
[
TSDB_APP_NAME_LEN
+
6
+
VARSTR_HEADER_SIZE
]
=
{
0
};
sprintf
(
&
name
[
VARSTR_HEADER_SIZE
],
"%s"
,
pApp
->
name
);
varDataLen
(
name
)
=
strlen
(
&
name
[
VARSTR_HEADER_SIZE
]);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
pApp
->
name
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
name
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
pApp
->
startTime
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pApp
->
startTime
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
pApp
->
summary
.
numOfInsertsReq
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pApp
->
summary
.
numOfInsertsReq
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
pApp
->
summary
.
numOfInsertRows
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pApp
->
summary
.
numOfInsertRows
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
pApp
->
summary
.
insertElapsedTime
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pApp
->
summary
.
insertElapsedTime
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
pApp
->
summary
.
insertBytes
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pApp
->
summary
.
insertBytes
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
pApp
->
summary
.
fetchBytes
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pApp
->
summary
.
fetchBytes
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
pApp
->
summary
.
queryElapsedTime
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pApp
->
summary
.
queryElapsedTime
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
pApp
->
summary
.
numOfSlowQueries
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pApp
->
summary
.
numOfSlowQueries
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
pApp
->
summary
.
totalRequests
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pApp
->
summary
.
totalRequests
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
pApp
->
summary
.
currentRequests
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pApp
->
summary
.
currentRequests
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
pApp
->
lastAccessTimeMs
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pApp
->
lastAccessTimeMs
,
false
);
numOfRows
++
;
}
...
...
source/libs/nodes/src/nodesCodeFuncs.c
浏览文件 @
a2d19872
...
...
@@ -172,8 +172,6 @@ const char* nodesNodeName(ENodeType type) {
return
"ShowSubscribesStmt"
;
case
QUERY_NODE_SHOW_SMAS_STMT
:
return
"ShowSmasStmt"
;
case
QUERY_NODE_SHOW_CONFIGS_STMT
:
return
"ShowConfigsStmt"
;
case
QUERY_NODE_SHOW_QUERIES_STMT
:
return
"ShowQueriesStmt"
;
case
QUERY_NODE_SHOW_VNODES_STMT
:
...
...
source/libs/nodes/src/nodesUtilFuncs.c
浏览文件 @
a2d19872
...
...
@@ -198,7 +198,6 @@ SNode* nodesMakeNode(ENodeType type) {
case
QUERY_NODE_SHOW_CONSUMERS_STMT
:
case
QUERY_NODE_SHOW_SUBSCRIBES_STMT
:
case
QUERY_NODE_SHOW_SMAS_STMT
:
case
QUERY_NODE_SHOW_CONFIGS_STMT
:
case
QUERY_NODE_SHOW_CONNECTIONS_STMT
:
case
QUERY_NODE_SHOW_QUERIES_STMT
:
case
QUERY_NODE_SHOW_VNODES_STMT
:
...
...
@@ -610,7 +609,6 @@ void nodesDestroyNode(SNode* pNode) {
case
QUERY_NODE_SHOW_CONSUMERS_STMT
:
case
QUERY_NODE_SHOW_SUBSCRIBES_STMT
:
case
QUERY_NODE_SHOW_SMAS_STMT
:
case
QUERY_NODE_SHOW_CONFIGS_STMT
:
case
QUERY_NODE_SHOW_CONNECTIONS_STMT
:
case
QUERY_NODE_SHOW_QUERIES_STMT
:
case
QUERY_NODE_SHOW_VNODES_STMT
:
...
...
source/libs/parser/src/parAstParser.c
浏览文件 @
a2d19872
...
...
@@ -387,6 +387,21 @@ static int32_t collectMetaKeyFromShowQueries(SCollectMetaKeyCxt* pCxt, SShowStmt
pCxt
->
pMetaCache
);
}
static
int32_t
collectMetaKeyFromShowConfigs
(
SCollectMetaKeyCxt
*
pCxt
,
SShowStmt
*
pStmt
)
{
return
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_CONFIGS
,
pCxt
->
pMetaCache
);
}
static
int32_t
collectMetaKeyFromShowVariables
(
SCollectMetaKeyCxt
*
pCxt
,
SShowStmt
*
pStmt
)
{
return
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_CONFIGS
,
pCxt
->
pMetaCache
);
}
static
int32_t
collectMetaKeyFromShowApps
(
SCollectMetaKeyCxt
*
pCxt
,
SShowStmt
*
pStmt
)
{
return
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
TSDB_PERFORMANCE_SCHEMA_DB
,
TSDB_PERFS_TABLE_APPS
,
pCxt
->
pMetaCache
);
}
static
int32_t
collectMetaKeyFromShowTransactions
(
SCollectMetaKeyCxt
*
pCxt
,
SShowStmt
*
pStmt
)
{
return
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
TSDB_PERFORMANCE_SCHEMA_DB
,
TSDB_PERFS_TABLE_TRANS
,
pCxt
->
pMetaCache
);
...
...
@@ -461,6 +476,10 @@ static int32_t collectMetaKeyFromQuery(SCollectMetaKeyCxt* pCxt, SNode* pStmt) {
return
collectMetaKeyFromShowConnections
(
pCxt
,
(
SShowStmt
*
)
pStmt
);
case
QUERY_NODE_SHOW_QUERIES_STMT
:
return
collectMetaKeyFromShowQueries
(
pCxt
,
(
SShowStmt
*
)
pStmt
);
case
QUERY_NODE_SHOW_VARIABLE_STMT
:
return
collectMetaKeyFromShowVariables
(
pCxt
,
(
SShowStmt
*
)
pStmt
);
case
QUERY_NODE_SHOW_APPS_STMT
:
return
collectMetaKeyFromShowApps
(
pCxt
,
(
SShowStmt
*
)
pStmt
);
case
QUERY_NODE_SHOW_TRANSACTIONS_STMT
:
return
collectMetaKeyFromShowTransactions
(
pCxt
,
(
SShowStmt
*
)
pStmt
);
case
QUERY_NODE_DELETE_STMT
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录