Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7c7c452b
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看板
提交
7c7c452b
编写于
8月 22, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh: add perf debug info
上级
cd22be63
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
31 addition
and
2 deletion
+31
-2
source/client/inc/clientInt.h
source/client/inc/clientInt.h
+6
-1
source/client/inc/clientLog.h
source/client/inc/clientLog.h
+1
-0
source/client/src/clientEnv.c
source/client/src/clientEnv.c
+12
-1
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+2
-0
source/client/src/clientMain.c
source/client/src/clientMain.c
+10
-0
未找到文件。
source/client/inc/clientInt.h
浏览文件 @
7c7c452b
...
...
@@ -96,7 +96,12 @@ typedef struct {
typedef
struct
SQueryExecMetric
{
int64_t
start
;
// start timestamp, us
int64_t
parsed
;
// start to parse, us
int64_t
syntaxStart
;
// start to parse, us
int64_t
syntaxEnd
;
// end to parse, us
int64_t
ctgStart
;
// start to parse, us
int64_t
ctgEnd
;
// end to parse, us
int64_t
semanticEnd
;
int64_t
execEnd
;
int64_t
send
;
// start to send to server, us
int64_t
rsp
;
// receive response from server, us
}
SQueryExecMetric
;
...
...
source/client/inc/clientLog.h
浏览文件 @
7c7c452b
...
...
@@ -29,6 +29,7 @@ extern "C" {
#define tscDebug(...) do { if (cDebugFlag & DEBUG_DEBUG) { taosPrintLog("TSC ", DEBUG_DEBUG, cDebugFlag, __VA_ARGS__); }} while(0)
#define tscTrace(...) do { if (cDebugFlag & DEBUG_TRACE) { taosPrintLog("TSC ", DEBUG_TRACE, cDebugFlag, __VA_ARGS__); }} while(0)
#define tscDebugL(...) do { if (cDebugFlag & DEBUG_DEBUG) { taosPrintLongString("TSC ", DEBUG_DEBUG, cDebugFlag, __VA_ARGS__); }} while(0)
#define tscPerf(...) do { taosPrintLog("TSC ", 0, cDebugFlag, __VA_ARGS__); } while(0)
#ifdef __cplusplus
}
...
...
source/client/src/clientEnv.c
浏览文件 @
7c7c452b
...
...
@@ -69,14 +69,25 @@ static void deregisterRequest(SRequestObj *pRequest) {
int32_t
currentInst
=
atomic_sub_fetch_64
((
int64_t
*
)
&
pActivity
->
currentRequests
,
1
);
int32_t
num
=
atomic_sub_fetch_32
(
&
pTscObj
->
numOfReqs
,
1
);
int64_t
duration
=
taosGetTimestampUs
()
-
pRequest
->
metric
.
start
;
int64_t
nowUs
=
taosGetTimestampUs
();
int64_t
duration
=
nowUs
-
pRequest
->
metric
.
start
;
tscDebug
(
"0x%"
PRIx64
" free Request from connObj: 0x%"
PRIx64
", reqId:0x%"
PRIx64
" elapsed:%"
PRIu64
" ms, current:%d, app current:%d"
,
pRequest
->
self
,
pTscObj
->
id
,
pRequest
->
requestId
,
duration
/
1000
,
num
,
currentInst
);
if
(
QUERY_NODE_VNODE_MODIF_STMT
==
pRequest
->
stmtType
)
{
tscPerf
(
"insert duration %"
PRId64
"us: syntax:%"
PRId64
"us, ctg:%"
PRId64
"us, semantic:%"
PRId64
"us, exec:%"
PRId64
"us"
,
duration
,
pRequest
->
metric
.
syntaxEnd
-
pRequest
->
metric
.
syntaxStart
,
pRequest
->
metric
.
ctgEnd
-
pRequest
->
metric
.
ctgStart
,
pRequest
->
metric
.
semanticEnd
-
pRequest
->
metric
.
ctgEnd
,
pRequest
->
metric
.
execEnd
-
pRequest
->
metric
.
semanticEnd
);
atomic_add_fetch_64
((
int64_t
*
)
&
pActivity
->
insertElapsedTime
,
duration
);
}
else
if
(
QUERY_NODE_SELECT_STMT
==
pRequest
->
stmtType
)
{
tscPerf
(
"select duration %"
PRId64
"us: syntax:%"
PRId64
"us, ctg:%"
PRId64
"us, semantic:%"
PRId64
"us, exec:%"
PRId64
"us"
,
duration
,
pRequest
->
metric
.
syntaxEnd
-
pRequest
->
metric
.
syntaxStart
,
pRequest
->
metric
.
ctgEnd
-
pRequest
->
metric
.
ctgStart
,
pRequest
->
metric
.
semanticEnd
-
pRequest
->
metric
.
ctgEnd
,
pRequest
->
metric
.
execEnd
-
pRequest
->
metric
.
semanticEnd
);
atomic_add_fetch_64
((
int64_t
*
)
&
pActivity
->
queryElapsedTime
,
duration
);
}
...
...
source/client/src/clientImpl.c
浏览文件 @
7c7c452b
...
...
@@ -839,6 +839,8 @@ void schedulerExecCb(SExecResult* pResult, void* param, int32_t code) {
}
schedulerFreeJob
(
&
pRequest
->
body
.
queryJob
,
0
);
pRequest
->
metric
.
execEnd
=
taosGetTimestampUs
();
}
taosMemoryFree
(
pResult
);
...
...
source/client/src/clientMain.c
浏览文件 @
7c7c452b
...
...
@@ -683,6 +683,8 @@ void retrieveMetaCallback(SMetaData *pResultMeta, void *param, int32_t code) {
SQuery
*
pQuery
=
pWrapper
->
pQuery
;
SRequestObj
*
pRequest
=
pWrapper
->
pRequest
;
pRequest
->
metric
.
ctgEnd
=
taosGetTimestampUs
();
if
(
code
==
TSDB_CODE_SUCCESS
)
{
code
=
qAnalyseSqlSemantic
(
pWrapper
->
pCtx
,
&
pWrapper
->
catalogReq
,
pResultMeta
,
pQuery
);
pRequest
->
stableQuery
=
pQuery
->
stableQuery
;
...
...
@@ -691,6 +693,8 @@ void retrieveMetaCallback(SMetaData *pResultMeta, void *param, int32_t code) {
}
}
pRequest
->
metric
.
semanticEnd
=
taosGetTimestampUs
();
if
(
code
==
TSDB_CODE_SUCCESS
)
{
if
(
pQuery
->
haveResultSet
)
{
setResSchemaInfo
(
&
pRequest
->
body
.
resInfo
,
pQuery
->
pResSchema
,
pQuery
->
numOfResCols
);
...
...
@@ -782,12 +786,16 @@ void doAsyncQuery(SRequestObj *pRequest, bool updateMetaForce) {
SQuery
*
pQuery
=
NULL
;
pRequest
->
metric
.
syntaxStart
=
taosGetTimestampUs
();
SCatalogReq
catalogReq
=
{.
forceUpdate
=
updateMetaForce
,
.
qNodeRequired
=
qnodeRequired
(
pRequest
)};
code
=
qParseSqlSyntax
(
pCxt
,
&
pQuery
,
&
catalogReq
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
goto
_error
;
}
pRequest
->
metric
.
syntaxEnd
=
taosGetTimestampUs
();
if
(
!
updateMetaForce
)
{
STscObj
*
pTscObj
=
pRequest
->
pTscObj
;
SAppClusterSummary
*
pActivity
=
&
pTscObj
->
pAppInfo
->
summary
;
...
...
@@ -814,6 +822,8 @@ void doAsyncQuery(SRequestObj *pRequest, bool updateMetaForce) {
.
requestObjRefId
=
pCxt
->
requestRid
,
.
mgmtEps
=
pCxt
->
mgmtEpSet
};
pRequest
->
metric
.
ctgStart
=
taosGetTimestampUs
();
code
=
catalogAsyncGetAllMeta
(
pCxt
->
pCatalog
,
&
conn
,
&
catalogReq
,
retrieveMetaCallback
,
pWrapper
,
&
pRequest
->
body
.
queryJob
);
pCxt
=
NULL
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录