Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b120f8ce
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1185
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b120f8ce
编写于
10月 09, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-1655]
上级
ef1dc646
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
24 addition
and
16 deletion
+24
-16
src/client/src/tscProfile.c
src/client/src/tscProfile.c
+1
-0
src/inc/taosdef.h
src/inc/taosdef.h
+1
-1
src/inc/taosmsg.h
src/inc/taosmsg.h
+1
-0
src/mnode/src/mnodeProfile.c
src/mnode/src/mnodeProfile.c
+21
-15
未找到文件。
src/client/src/tscProfile.c
浏览文件 @
b120f8ce
...
...
@@ -242,6 +242,7 @@ int tscBuildQueryStreamDesc(void *pMsg, STscObj *pObj) {
pQdesc
->
stime
=
htobe64
(
pSql
->
stime
);
pQdesc
->
queryId
=
htonl
(
pSql
->
queryId
);
pQdesc
->
useconds
=
htobe64
(
pSql
->
res
.
useconds
);
pQdesc
->
qHandle
=
htobe64
(
pSql
->
res
.
qhandle
);
pHeartbeat
->
numOfQueries
++
;
pQdesc
++
;
...
...
src/inc/taosdef.h
浏览文件 @
b120f8ce
...
...
@@ -282,7 +282,7 @@ void tsDataSwap(void *pLeft, void *pRight, int32_t type, int32_t size, void* buf
#define TSDB_SHELL_VNODE_BITS 24
#define TSDB_SHELL_SID_MASK 0xFF
#define TSDB_HTTP_TOKEN_LEN 20
#define TSDB_SHOW_SQL_LEN
64
#define TSDB_SHOW_SQL_LEN
512
#define TSDB_SLOW_QUERY_SQL_LEN 512
#define TSDB_MQTT_HOSTNAME_LEN 64
...
...
src/inc/taosmsg.h
浏览文件 @
b120f8ce
...
...
@@ -740,6 +740,7 @@ typedef struct {
uint32_t
queryId
;
int64_t
useconds
;
int64_t
stime
;
uint64_t
qHandle
;
}
SQueryDesc
;
typedef
struct
{
...
...
src/mnode/src/mnodeProfile.c
浏览文件 @
b120f8ce
...
...
@@ -24,15 +24,9 @@
#include "mnode.h"
#include "mnodeDef.h"
#include "mnodeInt.h"
#include "mnodeAcct.h"
#include "mnodeDnode.h"
#include "mnodeDb.h"
#include "mnodeMnode.h"
#include "mnodeProfile.h"
#include "mnodeShow.h"
#include "mnodeTable.h"
#include "mnodeUser.h"
#include "mnodeVgroup.h"
#include "mnodeWrite.h"
#define CONN_KEEP_TIME (tsShellActivityTimer * 3)
...
...
@@ -299,7 +293,7 @@ static int32_t mnodeGetQueryMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pC
pShow
->
bytes
[
cols
]
=
QUERY_ID_SIZE
+
VARSTR_HEADER_SIZE
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_BINARY
;
strcpy
(
pSchema
[
cols
].
name
,
"query
I
d"
);
strcpy
(
pSchema
[
cols
].
name
,
"query
_i
d"
);
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
cols
++
;
...
...
@@ -315,9 +309,15 @@ static int32_t mnodeGetQueryMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pC
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
cols
++
;
pShow
->
bytes
[
cols
]
=
24
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_BINARY
;
strcpy
(
pSchema
[
cols
].
name
,
"qhandle"
);
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
cols
++
;
pShow
->
bytes
[
cols
]
=
8
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_TIMESTAMP
;
strcpy
(
pSchema
[
cols
].
name
,
"created
time"
);
strcpy
(
pSchema
[
cols
].
name
,
"created
_
time"
);
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
cols
++
;
...
...
@@ -352,7 +352,7 @@ static int32_t mnodeRetrieveQueries(SShowObj *pShow, char *data, int32_t rows, v
SConnObj
*
pConnObj
=
NULL
;
int32_t
cols
=
0
;
char
*
pWrite
;
char
ipStr
[
TSDB_IPv4ADDR_LEN
+
6
]
;
char
str
[
TSDB_IPv4ADDR_LEN
+
6
]
=
{
0
}
;
while
(
numOfRows
<
rows
)
{
pShow
->
pIter
=
mnodeGetNextConn
(
pShow
->
pIter
,
&
pConnObj
);
...
...
@@ -362,9 +362,9 @@ static int32_t mnodeRetrieveQueries(SShowObj *pShow, char *data, int32_t rows, v
SQueryDesc
*
pDesc
=
pConnObj
->
pQueries
+
i
;
cols
=
0
;
snprintf
(
ipS
tr
,
QUERY_ID_SIZE
+
1
,
"%u:%u"
,
pConnObj
->
connId
,
htonl
(
pDesc
->
queryId
));
snprintf
(
s
tr
,
QUERY_ID_SIZE
+
1
,
"%u:%u"
,
pConnObj
->
connId
,
htonl
(
pDesc
->
queryId
));
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
STR_WITH_MAXSIZE_TO_VARSTR
(
pWrite
,
ipS
tr
,
pShow
->
bytes
[
cols
]);
STR_WITH_MAXSIZE_TO_VARSTR
(
pWrite
,
s
tr
,
pShow
->
bytes
[
cols
]);
cols
++
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
...
...
@@ -372,8 +372,15 @@ static int32_t mnodeRetrieveQueries(SShowObj *pShow, char *data, int32_t rows, v
cols
++
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
snprintf
(
ipStr
,
sizeof
(
ipStr
),
"%s:%u"
,
taosIpStr
(
pConnObj
->
ip
),
pConnObj
->
port
);
STR_WITH_MAXSIZE_TO_VARSTR
(
pWrite
,
ipStr
,
pShow
->
bytes
[
cols
]);
snprintf
(
str
,
tListLen
(
str
),
"%s:%u"
,
taosIpStr
(
pConnObj
->
ip
),
pConnObj
->
port
);
STR_WITH_MAXSIZE_TO_VARSTR
(
pWrite
,
str
,
pShow
->
bytes
[
cols
]);
cols
++
;
char
handleBuf
[
24
]
=
{
0
};
snprintf
(
handleBuf
,
tListLen
(
handleBuf
),
"%p"
,
(
void
*
)
htobe64
(
pDesc
->
qHandle
));
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
STR_WITH_MAXSIZE_TO_VARSTR
(
pWrite
,
handleBuf
,
pShow
->
bytes
[
cols
]);
cols
++
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
...
...
@@ -393,8 +400,7 @@ static int32_t mnodeRetrieveQueries(SShowObj *pShow, char *data, int32_t rows, v
}
pShow
->
numOfReads
+=
numOfRows
;
const
int32_t
NUM_OF_COLUMNS
=
6
;
mnodeVacuumResult
(
data
,
NUM_OF_COLUMNS
,
numOfRows
,
rows
,
pShow
);
mnodeVacuumResult
(
data
,
cols
,
numOfRows
,
rows
,
pShow
);
return
numOfRows
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录