Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f8cdaa7b
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看板
提交
f8cdaa7b
编写于
6月 29, 2020
作者:
S
Shengliang Guan
提交者:
Ping Xiao
6月 30, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2498 from taosdata/hotfix/invalidWrite
check the application message length before passing it to server
上级
dcbe4acb
607959a0
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
170 addition
and
7 deletion
+170
-7
src/connector/jdbc/src/main/java/com/taosdata/jdbc/utils/TDNode.java
...or/jdbc/src/main/java/com/taosdata/jdbc/utils/TDNode.java
+51
-0
src/rpc/src/rpcMain.c
src/rpc/src/rpcMain.c
+12
-7
tests/perftest-scripts/perftest-metadata-query.sh
tests/perftest-scripts/perftest-metadata-query.sh
+47
-0
tests/pytest/query/queryMetaData.py
tests/pytest/query/queryMetaData.py
+60
-0
未找到文件。
src/connector/jdbc/src/main/java/com/taosdata/jdbc/utils/TDNode.java
0 → 100644
浏览文件 @
f8cdaa7b
package
com.taosdata.jdbc.utils
;
public
class
TDNode
{
private
int
index
;
private
int
running
;
private
int
deployed
;
private
boolean
testCluster
;
private
int
valgrind
;
private
String
path
;
public
TDNode
(
int
index
)
{
this
.
index
=
index
;
running
=
0
;
deployed
=
0
;
testCluster
=
false
;
valgrind
=
0
;
}
public
void
setTestCluster
(
boolean
testCluster
)
{
this
.
testCluster
=
testCluster
;
}
public
void
setValgrind
(
boolean
valgrind
)
{
this
.
valgrind
=
valgrind
;
}
public
int
getDataSize
()
{
totalSize
=
0
;
if
(
deployed
==
1
)
{
}
}
def
getDataSize
(
self
):
totalSize
=
0
if
(
self
.
deployed
==
1
):
for
dirpath
,
dirnames
,
filenames
in
.
walk
(
self
.
dataDir
):
for
f
in
filenames:
fp
=
os
.
path
.
join
(
dirpath
,
f
)
if
not
os
.
path
.
islink
(
fp
):
totalSize
=
totalSize
+
os
.
path
.
getsize
(
fp
)
return
totalSize
}
\ No newline at end of file
src/rpc/src/rpcMain.c
浏览文件 @
f8cdaa7b
...
@@ -1034,15 +1034,20 @@ static void rpcProcessIncomingMsg(SRpcConn *pConn, SRpcHead *pHead) {
...
@@ -1034,15 +1034,20 @@ static void rpcProcessIncomingMsg(SRpcConn *pConn, SRpcHead *pHead) {
rpcMsg
.
ahandle
=
pConn
->
ahandle
;
rpcMsg
.
ahandle
=
pConn
->
ahandle
;
if
(
rpcIsReq
(
pHead
->
msgType
)
)
{
if
(
rpcIsReq
(
pHead
->
msgType
)
)
{
rpcMsg
.
handle
=
pConn
;
if
(
rpcMsg
.
contLen
>
0
)
{
rpcAddRef
(
pRpc
);
// add the refCount for requests
rpcMsg
.
handle
=
pConn
;
rpcAddRef
(
pRpc
);
// add the refCount for requests
// start the progress timer to monitor the response from server app
// start the progress timer to monitor the response from server app
if
(
pConn
->
connType
!=
RPC_CONN_TCPS
)
if
(
pConn
->
connType
!=
RPC_CONN_TCPS
)
pConn
->
pTimer
=
taosTmrStart
(
rpcProcessProgressTimer
,
tsProgressTimer
,
pConn
,
pRpc
->
tmrCtrl
);
pConn
->
pTimer
=
taosTmrStart
(
rpcProcessProgressTimer
,
tsProgressTimer
,
pConn
,
pRpc
->
tmrCtrl
);
// notify the server app
// notify the server app
(
*
(
pRpc
->
cfp
))(
&
rpcMsg
,
NULL
);
(
*
(
pRpc
->
cfp
))(
&
rpcMsg
,
NULL
);
}
else
{
tDebug
(
"%s, message body is empty, ignore"
,
pConn
->
info
);
rpcFreeCont
(
rpcMsg
.
pCont
);
}
}
else
{
}
else
{
// it's a response
// it's a response
SRpcReqContext
*
pContext
=
pConn
->
pContext
;
SRpcReqContext
*
pContext
=
pConn
->
pContext
;
...
...
tests/perftest-scripts/perftest-metadata-query.sh
0 → 100755
浏览文件 @
f8cdaa7b
#!/bin/bash
# Coloured Echoes
function
red_echo
{
echo
-e
"
\0
33[31m
$@
\0
33[0m"
;
}
function
green_echo
{
echo
-e
"
\0
33[32m
$@
\0
33[0m"
;
}
function
yellow_echo
{
echo
-e
"
\0
33[33m
$@
\0
33[0m"
;
}
function
white_echo
{
echo
-e
"
\0
33[1;37m
$@
\0
33[0m"
;
}
# Coloured Printfs
function
red_printf
{
printf
"
\0
33[31m
$@
\0
33[0m"
;
}
function
green_printf
{
printf
"
\0
33[32m
$@
\0
33[0m"
;
}
function
yellow_printf
{
printf
"
\0
33[33m
$@
\0
33[0m"
;
}
function
white_printf
{
printf
"
\0
33[1;37m
$@
\0
33[0m"
;
}
# Debugging Outputs
function
white_brackets
{
local
args
=
"
$@
"
;
white_printf
"["
;
printf
"
${
args
}
"
;
white_printf
"]"
;
}
function
echoInfo
{
local
args
=
"
$@
"
;
white_brackets
$(
green_printf
"INFO"
)
&&
echo
"
${
args
}
"
;
}
function
echoWarn
{
local
args
=
"
$@
"
;
echo
"
$(
white_brackets
"
$(
yellow_printf
"WARN"
)
"
&&
echo
"
${
args
}
"
;
)
"
1>&2
;
}
function
echoError
{
local
args
=
"
$@
"
;
echo
"
$(
white_brackets
"
$(
red_printf
"ERROR"
)
"
&&
echo
"
${
args
}
"
;
)
"
1>&2
;
}
function
restartTaosd
{
systemctl stop taosd
pkill
-KILL
-x
taosd
sleep
10
rm
-rf
/mnt/var/log/taos/
*
rm
-rf
/mnt/var/lib/taos/
*
taosd 2>&1
>
/dev/null &
sleep
10
}
function
runCreateTableThenInsert
{
echoInfo
"Restart Taosd"
restartTaosd
/usr/bin/time
-f
"Total: %e"
-o
totaltime.out bash
-c
"yes | taosdemo 2>&1 | tee -a taosdemo-
$1
-
$today
.log"
demoTableAndInsert
=
`
grep
"Total:"
totaltime.out|awk
'{print $2}'
`
demoRPS
=
`
grep
"records
\/
second"
taosdemo-
$1
-
$today
.log |
tail
-n1
|
awk
'{print $13}'
`
}
function
queryMetadata
{
echo
"query metadata"
cd
../pytest/query
python3 queryMetaData.py |
tee
-a
queryResult.log
}
\ No newline at end of file
tests/pytest/query/queryMetaData.py
0 → 100755
浏览文件 @
f8cdaa7b
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import
sys
import
taos
import
time
from
datetime
import
datetime
class
QueryMetaData
:
def
__init__
(
self
):
self
.
host
=
"127.0.0.1"
self
.
user
=
"root"
self
.
password
=
"taosdata"
self
.
config
=
"/etc/taos"
def
connectDB
(
self
):
self
.
conn
=
taos
.
connect
(
self
.
host
,
self
.
user
,
self
.
password
,
self
.
config
)
self
.
cursor
=
self
.
conn
.
cursor
()
def
queryData
(
self
):
print
(
"===============query tag data==============="
)
self
.
cursor
.
execute
(
"use test"
)
startTime
=
datetime
.
now
()
self
.
cursor
.
execute
(
"select areaid from meters"
)
data
=
self
.
cursor
.
fetchall
()
endTime
=
datetime
.
now
()
print
(
endTime
-
startTime
)
start
=
datetime
.
now
()
self
.
cursor
.
execute
(
"select areaid, loc from meters"
)
data2
=
self
.
cursor
.
fetchall
()
end
=
datetime
.
now
()
print
(
end
-
start
)
def
closeConn
(
self
):
self
.
cursor
.
close
()
self
.
conn
.
close
()
test
=
QueryMetaData
()
test
.
connectDB
()
test
.
queryData
()
test
.
closeConn
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录