Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
cd384419
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看板
提交
cd384419
编写于
11月 13, 2021
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add logs
上级
a6d6a21a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
30 addition
and
1 deletion
+30
-1
src/dnode/src/dnodeMain.c
src/dnode/src/dnodeMain.c
+1
-1
src/plugins/monitor/src/monMain.c
src/plugins/monitor/src/monMain.c
+29
-0
未找到文件。
src/dnode/src/dnodeMain.c
浏览文件 @
cd384419
...
...
@@ -54,7 +54,7 @@ void moduleStop() {}
void
*
tsDnodeTmr
=
NULL
;
static
SRunStatus
tsRunStatus
=
TSDB_RUN_STATUS_STOPPED
;
static
int32_t
tsDnodeErrors
;
static
int32_t
tsDnodeErrors
=
0
;
static
int32_t
dnodeInitStorage
();
static
void
dnodeCleanupStorage
();
...
...
src/plugins/monitor/src/monMain.c
浏览文件 @
cd384419
...
...
@@ -641,6 +641,10 @@ static int32_t monBuildMonIntervalSql(char *sql) {
static
int32_t
monBuildDnodesTotalSql
(
char
*
sql
)
{
int32_t
totalDnodes
=
0
,
totalDnodesAlive
=
0
;
TAOS_RES
*
result
=
taos_query
(
tsMonitor
.
conn
,
"show dnodes"
);
int32_t
code
=
taos_errno
(
result
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
monError
(
"failed to execute cmd: show dnodes, reason:%s"
,
tstrerror
(
code
));
}
TAOS_ROW
row
;
int32_t
num_fields
=
taos_num_fields
(
result
);
...
...
@@ -666,6 +670,10 @@ static int32_t monBuildDnodesTotalSql(char *sql) {
static
int32_t
monBuildMnodesTotalSql
(
char
*
sql
)
{
int32_t
totalMnodes
=
0
,
totalMnodesAlive
=
0
;
TAOS_RES
*
result
=
taos_query
(
tsMonitor
.
conn
,
"show mnodes"
);
int32_t
code
=
taos_errno
(
result
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
monError
(
"failed to execute cmd: show mnodes, reason:%s"
,
tstrerror
(
code
));
}
TAOS_ROW
row
;
int32_t
num_fields
=
taos_num_fields
(
result
);
...
...
@@ -696,6 +704,10 @@ static int32_t monGetVgroupsTotalStats(char *dbName, int32_t *totalVgroups,
memset
(
subsql
,
0
,
sizeof
(
subsql
));
sprintf
(
subsql
,
"show %s.vgroups"
,
dbName
);
TAOS_RES
*
result
=
taos_query
(
tsMonitor
.
conn
,
subsql
);
int32_t
code
=
taos_errno
(
result
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
monError
(
"failed to execute cmd: show %s.vgroups, reason:%s"
,
dbName
,
tstrerror
(
code
));
}
TAOS_ROW
row
;
int32_t
num_fields
=
taos_num_fields
(
result
);
...
...
@@ -720,6 +732,10 @@ static int32_t monGetVgroupsTotalStats(char *dbName, int32_t *totalVgroups,
static
int32_t
monBuildVgroupsTotalSql
(
char
*
sql
)
{
int32_t
totalVgroups
=
0
,
totalVgroupsAlive
=
0
;
TAOS_RES
*
result
=
taos_query
(
tsMonitor
.
conn
,
"show databases"
);
int32_t
code
=
taos_errno
(
result
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
monError
(
"failed to execute cmd: show databases, reason:%s"
,
tstrerror
(
code
));
}
TAOS_ROW
row
;
int32_t
num_fields
=
taos_num_fields
(
result
);
...
...
@@ -745,6 +761,10 @@ static int32_t monGetVnodesTotalStats(char *ep, int32_t *totalVnodes,
memset
(
subsql
,
0
,
sizeof
(
subsql
));
sprintf
(
subsql
,
"show vnodes
\"
%s
\"
"
,
ep
);
TAOS_RES
*
result
=
taos_query
(
tsMonitor
.
conn
,
subsql
);
int32_t
code
=
taos_errno
(
result
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
monError
(
"failed to execute cmd: show vnodes
\"
%s
\"
, reason:%s"
,
ep
,
tstrerror
(
code
));
}
TAOS_ROW
row
;
int32_t
num_fields
=
taos_num_fields
(
result
);
...
...
@@ -770,6 +790,10 @@ static int32_t monGetVnodesTotalStats(char *ep, int32_t *totalVnodes,
static
int32_t
monBuildVnodesTotalSql
(
char
*
sql
)
{
int32_t
totalVnodes
=
0
,
totalVnodesAlive
=
0
;
TAOS_RES
*
result
=
taos_query
(
tsMonitor
.
conn
,
"show dnodes"
);
int32_t
code
=
taos_errno
(
result
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
monError
(
"failed to execute cmd: show dnodes, reason:%s"
,
tstrerror
(
code
));
}
TAOS_ROW
row
;
int32_t
num_fields
=
taos_num_fields
(
result
);
...
...
@@ -794,6 +818,11 @@ static int32_t monBuildConnsTotalSql(char *sql) {
TAOS_RES
*
result
=
taos_query
(
tsMonitor
.
conn
,
"show connections"
);
TAOS_ROW
row
;
int32_t
code
=
taos_errno
(
result
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
monError
(
"failed to execute cmd: show connections, reason:%s"
,
tstrerror
(
code
));
}
while
((
row
=
taos_fetch_row
(
result
)))
{
totalConns
++
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录