Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
8ffb0688
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看板
提交
8ffb0688
编写于
11月 15, 2021
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
changed req counters fron int32_t to int64_t
上级
060ca48c
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
37 addition
and
37 deletion
+37
-37
src/dnode/src/dnodeShell.c
src/dnode/src/dnodeShell.c
+6
-6
src/inc/dnode.h
src/inc/dnode.h
+3
-3
src/inc/vnode.h
src/inc/vnode.h
+3
-3
src/plugins/http/inc/httpInt.h
src/plugins/http/inc/httpInt.h
+1
-1
src/plugins/http/src/httpServer.c
src/plugins/http/src/httpServer.c
+1
-1
src/plugins/http/src/httpSystem.c
src/plugins/http/src/httpSystem.c
+1
-2
src/plugins/monitor/src/monMain.c
src/plugins/monitor/src/monMain.c
+13
-12
src/vnode/src/vnodeWrite.c
src/vnode/src/vnodeWrite.c
+9
-9
未找到文件。
src/dnode/src/dnodeShell.c
浏览文件 @
8ffb0688
...
...
@@ -28,8 +28,8 @@ static void (*dnodeProcessShellMsgFp[TSDB_MSG_TYPE_MAX])(SRpcMsg *);
static
void
dnodeProcessMsgFromShell
(
SRpcMsg
*
pMsg
,
SRpcEpSet
*
);
static
int
dnodeRetrieveUserAuthInfo
(
char
*
user
,
char
*
spi
,
char
*
encrypt
,
char
*
secret
,
char
*
ckey
);
static
void
*
tsShellRpc
=
NULL
;
static
int
32
_t
tsQueryReqNum
=
0
;
static
int
32
_t
tsSubmitReqNum
=
0
;
static
int
64
_t
tsQueryReqNum
=
0
;
static
int
64
_t
tsSubmitReqNum
=
0
;
int32_t
dnodeInitShell
()
{
dnodeProcessShellMsgFp
[
TSDB_MSG_TYPE_SUBMIT
]
=
dnodeDispatchToVWriteQueue
;
...
...
@@ -136,9 +136,9 @@ static void dnodeProcessMsgFromShell(SRpcMsg *pMsg, SRpcEpSet *pEpSet) {
}
if
(
pMsg
->
msgType
==
TSDB_MSG_TYPE_QUERY
)
{
atomic_fetch_add_
32
(
&
tsQueryReqNum
,
1
);
atomic_fetch_add_
64
(
&
tsQueryReqNum
,
1
);
}
else
if
(
pMsg
->
msgType
==
TSDB_MSG_TYPE_SUBMIT
)
{
atomic_fetch_add_
32
(
&
tsSubmitReqNum
,
1
);
atomic_fetch_add_
64
(
&
tsSubmitReqNum
,
1
);
}
else
{}
if
(
dnodeProcessShellMsgFp
[
pMsg
->
msgType
]
)
{
...
...
@@ -243,8 +243,8 @@ SDnodeStatisInfo dnodeGetStatisInfo() {
#ifdef HTTP_EMBEDDED
info
.
httpReqNum
=
httpGetReqCount
();
#endif
info
.
queryReqNum
=
atomic_exchange_
32
(
&
tsQueryReqNum
,
0
);
info
.
submitReqNum
=
atomic_exchange_
32
(
&
tsSubmitReqNum
,
0
);
info
.
queryReqNum
=
atomic_exchange_
64
(
&
tsQueryReqNum
,
0
);
info
.
submitReqNum
=
atomic_exchange_
64
(
&
tsSubmitReqNum
,
0
);
}
return
info
;
...
...
src/inc/dnode.h
浏览文件 @
8ffb0688
...
...
@@ -25,9 +25,9 @@ extern "C" {
#define MAX_HTTP_STATUS_CODE_NUM 63
typedef
struct
{
int
32
_t
queryReqNum
;
int
32
_t
submitReqNum
;
int
32
_t
httpReqNum
;
int
64
_t
queryReqNum
;
int
64
_t
submitReqNum
;
int
64
_t
httpReqNum
;
}
SDnodeStatisInfo
;
SDnodeStatisInfo
dnodeGetStatisInfo
();
...
...
src/inc/vnode.h
浏览文件 @
8ffb0688
...
...
@@ -23,9 +23,9 @@ extern "C" {
#include "twal.h"
typedef
struct
{
int
32
_t
submitReqSucNum
;
int
32
_t
submitRowNum
;
int
32
_t
submitRowSucNum
;
int
64
_t
submitReqSucNum
;
int
64
_t
submitRowNum
;
int
64
_t
submitRowSucNum
;
}
SVnodeStatisInfo
;
typedef
struct
{
...
...
src/plugins/http/inc/httpInt.h
浏览文件 @
8ffb0688
...
...
@@ -188,7 +188,7 @@ typedef struct HttpServer {
SOCKET
fd
;
int32_t
numOfThreads
;
int32_t
methodScannerLen
;
int
32
_t
requestNum
;
int
64
_t
requestNum
;
int32_t
status
;
int32_t
statusCodeErrs
[
HTTP_STATUS_CODE_NUM
];
pthread_t
thread
;
...
...
src/plugins/http/src/httpServer.c
浏览文件 @
8ffb0688
...
...
@@ -190,7 +190,7 @@ static void httpProcessHttpData(void *param) {
}
else
{
if
(
httpReadData
(
pContext
))
{
(
*
(
pThread
->
processData
))(
pContext
);
atomic_fetch_add_
32
(
&
pServer
->
requestNum
,
1
);
atomic_fetch_add_
64
(
&
pServer
->
requestNum
,
1
);
}
}
}
...
...
src/plugins/http/src/httpSystem.c
浏览文件 @
8ffb0688
...
...
@@ -120,8 +120,7 @@ void httpCleanUpSystem() {
tsHttpServer
.
status
=
HTTP_SERVER_CLOSED
;
}
int32_t
httpGetReqCount
()
{
return
atomic_load_32
(
&
tsHttpServer
.
requestNum
);
}
int32_t
httpClearReqCount
()
{
return
atomic_exchange_32
(
&
tsHttpServer
.
requestNum
,
0
);
}
int32_t
httpGetReqCount
()
{
return
atomic_exchange_64
(
&
tsHttpServer
.
requestNum
,
0
);
}
int32_t
httpGetStatusCodeCount
(
int
index
)
{
return
atomic_load_32
(
&
tsHttpServer
.
statusCodeErrs
[
index
]);
}
...
...
src/plugins/monitor/src/monMain.c
浏览文件 @
8ffb0688
...
...
@@ -355,7 +355,7 @@ static void monBuildMonitorSql(char *sql, int32_t cmd) {
", disk_used float, disk_total int"
", band_speed float"
", io_read float, io_write float"
", req_http
int, req_select int, req_insert
int"
", req_http
bigint, req_select bigint, req_insert big
int"
") tags (dnodeid int, fqdn binary(%d))"
,
tsMonitorDbName
,
TSDB_FQDN_LEN
);
}
else
if
(
cmd
==
MON_CMD_CREATE_TB_DN
)
{
...
...
@@ -411,10 +411,10 @@ static void monBuildMonitorSql(char *sql, int32_t cmd) {
", net_in float, net_out float"
", io_read float, io_write float"
", io_read_disk float, io_write_disk float"
", req_http int, req_http_rate float"
", req_select int, req_select_rate float"
", req_insert
int, req_insert_success
int, req_insert_rate float"
", req_insert_batch
int, req_insert_batch_success
int, req_insert_batch_rate float"
", req_http
big
int, req_http_rate float"
", req_select
big
int, req_select_rate float"
", req_insert
bigint, req_insert_success big
int, req_insert_rate float"
", req_insert_batch
bigint, req_insert_batch_success big
int, req_insert_batch_rate float"
", errors bigint"
", vnodes_num int"
", masters int"
...
...
@@ -564,7 +564,7 @@ static int32_t monBuildBandSql(char *sql) {
static
int32_t
monBuildReqSql
(
char
*
sql
)
{
SDnodeStatisInfo
info
=
tsMonStat
.
dInfo
;
return
snprintf
(
sql
,
SQL_LENGTH
,
", %
d, %d, %d
)"
,
info
.
httpReqNum
,
info
.
queryReqNum
,
info
.
submitReqNum
);
return
snprintf
(
sql
,
SQL_LENGTH
,
", %
"
PRId64
", %"
PRId64
", %"
PRId64
"
)"
,
info
.
httpReqNum
,
info
.
queryReqNum
,
info
.
submitReqNum
);
}
static
int32_t
monBuildIoSql
(
char
*
sql
)
{
...
...
@@ -891,11 +891,11 @@ static int32_t monBuildNetworkIOSql(char *sql) {
}
static
int32_t
monBuildDnodeReqSql
(
char
*
sql
)
{
int
32
_t
queryReqNum
=
tsMonStat
.
dInfo
.
queryReqNum
-
tsMonStat
.
monQueryReqCnt
;
int
32
_t
submitReqNum
=
tsMonStat
.
dInfo
.
submitReqNum
;
int
32
_t
submitRowNum
=
tsMonStat
.
vInfo
.
submitRowNum
;
int
32
_t
submitReqSucNum
=
tsMonStat
.
vInfo
.
submitReqSucNum
;
int
32
_t
submitRowSucNum
=
tsMonStat
.
vInfo
.
submitRowSucNum
;
int
64
_t
queryReqNum
=
tsMonStat
.
dInfo
.
queryReqNum
-
tsMonStat
.
monQueryReqCnt
;
int
64
_t
submitReqNum
=
tsMonStat
.
dInfo
.
submitReqNum
;
int
64
_t
submitRowNum
=
tsMonStat
.
vInfo
.
submitRowNum
;
int
64
_t
submitReqSucNum
=
tsMonStat
.
vInfo
.
submitReqSucNum
;
int
64
_t
submitRowSucNum
=
tsMonStat
.
vInfo
.
submitRowSucNum
;
float
interval
=
(
float
)(
tsMonitorInterval
*
1
.
0
);
float
httpReqRate
=
tsMonStat
.
dInfo
.
httpReqNum
/
interval
;
...
...
@@ -903,7 +903,8 @@ static int32_t monBuildDnodeReqSql(char *sql) {
float
submitReqRate
=
submitReqNum
/
interval
;
float
submitRowRate
=
submitRowNum
/
interval
;
return
snprintf
(
sql
,
SQL_LENGTH
,
", %d, %f, %d, %f, %d, %d, %f, %d, %d, %f"
,
tsMonStat
.
dInfo
.
httpReqNum
,
httpReqRate
,
return
snprintf
(
sql
,
SQL_LENGTH
,
", %"
PRId64
", %f, %"
PRId64
", %f, %"
PRId64
", %"
PRId64
", %f, %"
PRId64
", %"
PRId64
", %f"
,
tsMonStat
.
dInfo
.
httpReqNum
,
httpReqRate
,
queryReqNum
,
queryReqRate
,
submitRowNum
,
submitRowSucNum
,
submitRowRate
,
submitReqNum
,
submitReqSucNum
,
submitReqRate
);
...
...
src/vnode/src/vnodeWrite.c
浏览文件 @
8ffb0688
...
...
@@ -27,9 +27,9 @@
#define MAX_QUEUED_MSG_NUM 100000
#define MAX_QUEUED_MSG_SIZE 1024*1024*1024 //1GB
static
int
32
_t
tsSubmitReqSucNum
=
0
;
static
int
32
_t
tsSubmitRowNum
=
0
;
static
int
32
_t
tsSubmitRowSucNum
=
0
;
static
int
64
_t
tsSubmitReqSucNum
=
0
;
static
int
64
_t
tsSubmitRowNum
=
0
;
static
int
64
_t
tsSubmitRowSucNum
=
0
;
extern
void
*
tsDnodeTmr
;
static
int32_t
(
*
vnodeProcessWriteMsgFp
[
TSDB_MSG_TYPE_MAX
])(
SVnodeObj
*
,
void
*
pCont
,
SRspRet
*
);
...
...
@@ -170,12 +170,12 @@ static int32_t vnodeProcessSubmitMsg(SVnodeObj *pVnode, void *pCont, SRspRet *pR
if
(
tsdbInsertData
(
pVnode
->
tsdb
,
pCont
,
pRsp
)
<
0
)
{
code
=
terrno
;
}
else
{
if
(
pRsp
!=
NULL
)
atomic_fetch_add_
32
(
&
tsSubmitReqSucNum
,
1
);
if
(
pRsp
!=
NULL
)
atomic_fetch_add_
64
(
&
tsSubmitReqSucNum
,
1
);
}
if
(
pRsp
)
{
atomic_fetch_add_
32
(
&
tsSubmitRowNum
,
ntohl
(
pRsp
->
numOfRows
));
atomic_fetch_add_
32
(
&
tsSubmitRowSucNum
,
ntohl
(
pRsp
->
affectedRows
));
atomic_fetch_add_
64
(
&
tsSubmitRowNum
,
ntohl
(
pRsp
->
numOfRows
));
atomic_fetch_add_
64
(
&
tsSubmitRowSucNum
,
ntohl
(
pRsp
->
affectedRows
));
}
return
code
;
...
...
@@ -441,9 +441,9 @@ void vnodeWaitWriteCompleted(SVnodeObj *pVnode) {
SVnodeStatisInfo
vnodeGetStatisInfo
()
{
SVnodeStatisInfo
info
=
{
0
};
info
.
submitReqSucNum
=
atomic_exchange_
32
(
&
tsSubmitReqSucNum
,
0
);
info
.
submitRowNum
=
atomic_exchange_
32
(
&
tsSubmitRowNum
,
0
);
info
.
submitRowSucNum
=
atomic_exchange_
32
(
&
tsSubmitRowSucNum
,
0
);
info
.
submitReqSucNum
=
atomic_exchange_
64
(
&
tsSubmitReqSucNum
,
0
);
info
.
submitRowNum
=
atomic_exchange_
64
(
&
tsSubmitRowNum
,
0
);
info
.
submitRowSucNum
=
atomic_exchange_
64
(
&
tsSubmitRowSucNum
,
0
);
return
info
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录