Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ce381225
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看板
提交
ce381225
编写于
11月 14, 2021
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix negative req_insert numbers
上级
1c16959a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
30 addition
and
45 deletion
+30
-45
src/dnode/src/dnodeShell.c
src/dnode/src/dnodeShell.c
+2
-12
src/inc/dnode.h
src/inc/dnode.h
+0
-1
src/inc/vnode.h
src/inc/vnode.h
+0
-1
src/plugins/monitor/src/monMain.c
src/plugins/monitor/src/monMain.c
+25
-22
src/vnode/src/vnodeWrite.c
src/vnode/src/vnodeWrite.c
+3
-9
未找到文件。
src/dnode/src/dnodeShell.c
浏览文件 @
ce381225
...
...
@@ -243,23 +243,13 @@ SDnodeStatisInfo dnodeGetStatisInfo() {
#ifdef HTTP_EMBEDDED
info
.
httpReqNum
=
httpGetReqCount
();
#endif
info
.
queryReqNum
=
atomic_
load_32
(
&
tsQueryReqNum
);
info
.
submitReqNum
=
atomic_
load_32
(
&
tsSubmitReqNum
);
info
.
queryReqNum
=
atomic_
exchange_32
(
&
tsQueryReqNum
,
0
);
info
.
submitReqNum
=
atomic_
exchange_32
(
&
tsSubmitReqNum
,
0
);
}
return
info
;
}
void
dnodeClearStatisInfo
()
{
if
(
dnodeGetRunStatus
()
==
TSDB_RUN_STATUS_RUNING
)
{
#ifdef HTTP_EMBEDDED
httpClearReqCount
();
#endif
atomic_exchange_32
(
&
tsQueryReqNum
,
0
);
atomic_exchange_32
(
&
tsSubmitReqNum
,
0
);
}
}
int32_t
dnodeGetHttpStatusInfo
(
int32_t
index
)
{
int32_t
httpStatus
=
0
;
#ifdef HTTP_EMBEDDED
...
...
src/inc/dnode.h
浏览文件 @
ce381225
...
...
@@ -31,7 +31,6 @@ typedef struct {
}
SDnodeStatisInfo
;
SDnodeStatisInfo
dnodeGetStatisInfo
();
void
dnodeClearStatisInfo
();
int32_t
dnodeGetHttpStatusInfo
(
int32_t
index
);
void
dnodeClearHttpStatusInfo
();
...
...
src/inc/vnode.h
浏览文件 @
ce381225
...
...
@@ -87,7 +87,6 @@ void vnodeFreeFromWQueue(void *pVnode, SVWriteMsg *pWrite);
int32_t
vnodeProcessWrite
(
void
*
pVnode
,
void
*
pHead
,
int32_t
qtype
,
void
*
pRspRet
);
SVnodeStatisInfo
vnodeGetStatisInfo
();
void
vnodeClearStatisInfo
();
// vnodeSync
void
vnodeConfirmForward
(
void
*
pVnode
,
uint64_t
version
,
int32_t
code
,
bool
force
);
...
...
src/plugins/monitor/src/monMain.c
浏览文件 @
ce381225
...
...
@@ -149,10 +149,14 @@ typedef struct {
}
SMonConn
;
typedef
struct
{
SDnodeStatisInfo
dInfo
;
SVnodeStatisInfo
vInfo
;
float
io_read
;
float
io_write
;
float
io_read_disk
;
float
io_write_disk
;
int32_t
monQueryReqCnt
;
int32_t
monSubmitReqCnt
;
}
SMonStat
;
static
void
*
monHttpStatusHashTable
;
...
...
@@ -170,7 +174,6 @@ static void monSaveSlowQueryInfo();
static
void
monSaveDisksInfo
();
static
void
monSaveGrantsInfo
();
static
void
monSaveHttpReqInfo
();
static
void
monClearStatisInfo
();
static
void
monGetSysStats
();
static
void
*
monThreadFunc
(
void
*
param
);
static
void
monBuildMonitorSql
(
char
*
sql
,
int32_t
cmd
);
...
...
@@ -503,6 +506,12 @@ static void monGetSysStats() {
if
(
!
suc
)
{
monDebug
(
"failed to get io info"
);
}
tsMonStat
.
dInfo
=
dnodeGetStatisInfo
();
tsMonStat
.
vInfo
=
vnodeGetStatisInfo
();
tsMonStat
.
monQueryReqCnt
=
monFetchQueryReqCnt
();
tsMonStat
.
monSubmitReqCnt
=
monFetchSubmitReqCnt
();
}
// unit is MB
...
...
@@ -554,7 +563,7 @@ static int32_t monBuildBandSql(char *sql) {
}
static
int32_t
monBuildReqSql
(
char
*
sql
)
{
SDnodeStatisInfo
info
=
dnodeGetStatisInfo
()
;
SDnodeStatisInfo
info
=
tsMonStat
.
dInfo
;
return
sprintf
(
sql
,
", %d, %d, %d)"
,
info
.
httpReqNum
,
info
.
queryReqNum
,
info
.
submitReqNum
);
}
...
...
@@ -882,23 +891,22 @@ static int32_t monBuildNetworkIOSql(char *sql) {
}
static
int32_t
monBuildDnodeReqSql
(
char
*
sql
)
{
SDnodeStatisInfo
dInfo
=
dnodeGetStatisInfo
()
;
SVnodeStatisInfo
vInfo
=
vnodeGetStatisInfo
()
;
int32_t
monQueryReqCnt
=
monFetchQueryReqCnt
()
;
int32_t
monSubmitReqCnt
=
monFetchSubmitReqCnt
()
;
int32_t
queryReqNum
=
tsMonStat
.
dInfo
.
queryReqNum
-
tsMonStat
.
monQueryReqCnt
;
int32_t
submitReqNum
=
tsMonStat
.
dInfo
.
submitReqNum
-
tsMonStat
.
monSubmitReqCnt
;
int32_t
submitRowNum
=
tsMonStat
.
vInfo
.
submitRowNum
-
tsMonStat
.
monSubmitReqCnt
;
int32_t
submitReqSucNum
=
tsMonStat
.
vInfo
.
submitReqSucNum
-
tsMonStat
.
monSubmitReqCnt
;
int32_t
submitRowSucNum
=
tsMonStat
.
vInfo
.
submitRowSucNum
-
tsMonStat
.
monSubmitReqCnt
;
float
interval
=
(
float
)(
tsMonitorInterval
*
1
.
0
);
float
httpReqRate
=
dInfo
.
httpReqNum
/
interval
;
float
queryReqRate
=
(
dInfo
.
queryReqNum
-
monQueryReqCnt
)
/
interval
;
float
submitReqRate
=
(
dInfo
.
submitReqNum
-
monSubmitReqCnt
)
/
interval
;
float
submitRowRate
=
(
vInfo
.
submitRowNum
-
monSubmitReqCnt
)
/
interval
;
monClearStatisInfo
();
return
sprintf
(
sql
,
", %d, %f, %d, %f, %d, %d, %f, %d, %d, %f"
,
dInfo
.
httpReqNum
,
httpReqRate
,
dInfo
.
queryReqNum
-
monQueryReqCnt
,
queryReqRate
,
vInfo
.
submitRowNum
-
monSubmitReqCnt
,
vInfo
.
submitRowSucNum
-
monSubmitReqCnt
,
submitRowRate
,
dInfo
.
submitReqNum
-
monSubmitReqCnt
,
vInfo
.
submitReqSucNum
-
monSubmitReqCnt
,
submitReqRate
);
float
httpReqRate
=
tsMonStat
.
dInfo
.
httpReqNum
/
interval
;
float
queryReqRate
=
queryReqNum
/
interval
;
float
submitReqRate
=
submitReqNum
/
interval
;
float
submitRowRate
=
submitRowNum
/
interval
;
return
sprintf
(
sql
,
", %d, %f, %d, %f, %d, %d, %f, %d, %d, %f"
,
tsMonStat
.
dInfo
.
httpReqNum
,
httpReqRate
,
queryReqNum
,
queryReqRate
,
submitRowNum
,
submitRowSucNum
,
submitRowRate
,
submitReqNum
,
submitReqSucNum
,
submitReqRate
);
}
static
int32_t
monBuildDnodeErrorsSql
(
char
*
sql
)
{
...
...
@@ -1316,11 +1324,6 @@ static void monSaveHttpReqInfo() {
}
}
static
void
monClearStatisInfo
()
{
dnodeClearStatisInfo
();
vnodeClearStatisInfo
();
}
static
void
monExecSqlCb
(
void
*
param
,
TAOS_RES
*
result
,
int32_t
code
)
{
int32_t
c
=
taos_errno
(
result
);
if
(
c
!=
TSDB_CODE_SUCCESS
)
{
...
...
src/vnode/src/vnodeWrite.c
浏览文件 @
ce381225
...
...
@@ -441,15 +441,9 @@ void vnodeWaitWriteCompleted(SVnodeObj *pVnode) {
SVnodeStatisInfo
vnodeGetStatisInfo
()
{
SVnodeStatisInfo
info
=
{
0
};
info
.
submitReqSucNum
=
atomic_
load_32
(
&
tsSubmitReqSucNum
);
info
.
submitRowNum
=
atomic_
load_32
(
&
tsSubmitRowNum
);
info
.
submitRowSucNum
=
atomic_
load_32
(
&
tsSubmitRowSucNum
);
info
.
submitReqSucNum
=
atomic_
exchange_32
(
&
tsSubmitReqSucNum
,
0
);
info
.
submitRowNum
=
atomic_
exchange_32
(
&
tsSubmitRowNum
,
0
);
info
.
submitRowSucNum
=
atomic_
exchange_32
(
&
tsSubmitRowSucNum
,
0
);
return
info
;
}
void
vnodeClearStatisInfo
()
{
atomic_exchange_32
(
&
tsSubmitReqSucNum
,
0
);
atomic_exchange_32
(
&
tsSubmitRowNum
,
0
);
atomic_exchange_32
(
&
tsSubmitRowSucNum
,
0
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录