Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
11923eb9
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看板
提交
11923eb9
编写于
7月 09, 2020
作者:
S
Shuduo Sang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add test case for compressMsgSize
[TD-764]
上级
88d8f04e
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
316 addition
and
20 deletion
+316
-20
src/rpc/src/rpcMain.c
src/rpc/src/rpcMain.c
+2
-1
tests/pytest/testCompress.py
tests/pytest/testCompress.py
+136
-0
tests/pytest/testNoCompress.py
tests/pytest/testNoCompress.py
+137
-0
tests/pytest/util/dnodes.py
tests/pytest/util/dnodes.py
+41
-19
未找到文件。
src/rpc/src/rpcMain.c
浏览文件 @
11923eb9
...
...
@@ -1366,6 +1366,7 @@ static int32_t rpcCompressRpcMsg(char* pCont, int32_t contLen) {
}
int32_t
compLen
=
LZ4_compress_default
(
pCont
,
buf
,
contLen
,
contLen
+
overhead
);
tDebug
(
"compress rpc msg, before:%d, after:%d, overhead:%d"
,
contLen
,
compLen
,
overhead
);
/*
* only the compressed size is less than the value of contLen - overhead, the compression is applied
...
...
@@ -1378,7 +1379,7 @@ static int32_t rpcCompressRpcMsg(char* pCont, int32_t contLen) {
memcpy
(
pCont
+
overhead
,
buf
,
compLen
);
pHead
->
comp
=
1
;
//
tDebug("compress rpc msg, before:%d, after:%d", contLen, compLen);
tDebug
(
"compress rpc msg, before:%d, after:%d"
,
contLen
,
compLen
);
finalLen
=
compLen
+
overhead
;
}
else
{
finalLen
=
contLen
;
...
...
tests/pytest/testCompress.py
0 → 100644
浏览文件 @
11923eb9
此差异已折叠。
点击以展开。
tests/pytest/testNoCompress.py
0 → 100644
浏览文件 @
11923eb9
此差异已折叠。
点击以展开。
tests/pytest/util/dnodes.py
浏览文件 @
11923eb9
...
...
@@ -22,35 +22,59 @@ class TDSimClient:
def
__init__
(
self
):
self
.
testCluster
=
False
self
.
cfgDict
=
{
"numOfLogLines"
:
"100000000"
,
"numOfThreadsPerCore"
:
"2.0"
,
"locale"
:
"en_US.UTF-8"
,
"charset"
:
"UTF-8"
,
"asyncLog"
:
"0"
,
"anyIp"
:
"0"
,
"sdbDebugFlag"
:
"135"
,
"rpcDebugFlag"
:
"135"
,
"tmrDebugFlag"
:
"131"
,
"cDebugFlag"
:
"135"
,
"udebugFlag"
:
"135"
,
"jnidebugFlag"
:
"135"
,
"qdebugFlag"
:
"135"
,
}
def
init
(
self
,
path
):
self
.
__init__
()
self
.
path
=
path
def
getLogDir
(
self
):
self
.
logDir
=
"%s/sim/psim/log"
%
(
self
.
path
)
return
self
.
logDir
def
getCfgDir
(
self
):
self
.
cfgDir
=
"%s/sim/psim/cfg"
%
(
self
.
path
)
return
self
.
cfgDir
def
setTestCluster
(
self
,
value
):
self
.
testCluster
=
value
def
addExtraCfg
(
self
,
option
,
value
):
self
.
cfgDict
.
update
({
option
:
value
})
def
cfg
(
self
,
option
,
value
):
cmd
=
"echo '%s %s' >> %s"
%
(
option
,
value
,
self
.
cfgPath
)
if
os
.
system
(
cmd
)
!=
0
:
tdLog
.
exit
(
cmd
)
def
deploy
(
self
):
self
.
logDir
=
"%s/sim/psim/log"
%
(
self
.
path
,
)
self
.
logDir
=
"%s/sim/psim/log"
%
(
self
.
path
)
self
.
cfgDir
=
"%s/sim/psim/cfg"
%
(
self
.
path
)
self
.
cfgPath
=
"%s/sim/psim/cfg/taos.cfg"
%
(
self
.
path
)
cmd
=
"rm -rf "
+
self
.
logDir
if
os
.
system
(
cmd
)
!=
0
:
tdLog
.
exit
(
cmd
)
cmd
=
"
rm -rf "
+
self
.
cf
gDir
cmd
=
"
mkdir -p "
+
self
.
lo
gDir
if
os
.
system
(
cmd
)
!=
0
:
tdLog
.
exit
(
cmd
)
cmd
=
"
mkdir -p "
+
self
.
lo
gDir
cmd
=
"
rm -rf "
+
self
.
cf
gDir
if
os
.
system
(
cmd
)
!=
0
:
tdLog
.
exit
(
cmd
)
...
...
@@ -66,19 +90,10 @@ class TDSimClient:
self
.
cfg
(
"masterIp"
,
"192.168.0.1"
)
self
.
cfg
(
"secondIp"
,
"192.168.0.2"
)
self
.
cfg
(
"logDir"
,
self
.
logDir
)
self
.
cfg
(
"numOfLogLines"
,
"100000000"
)
self
.
cfg
(
"numOfThreadsPerCore"
,
"2.0"
)
self
.
cfg
(
"locale"
,
"en_US.UTF-8"
)
self
.
cfg
(
"charset"
,
"UTF-8"
)
self
.
cfg
(
"asyncLog"
,
"0"
)
self
.
cfg
(
"anyIp"
,
"0"
)
self
.
cfg
(
"sdbDebugFlag"
,
"135"
)
self
.
cfg
(
"rpcDebugFlag"
,
"135"
)
self
.
cfg
(
"tmrDebugFlag"
,
"131"
)
self
.
cfg
(
"cDebugFlag"
,
"135"
)
self
.
cfg
(
"udebugFlag"
,
"135"
)
self
.
cfg
(
"jnidebugFlag"
,
"135"
)
self
.
cfg
(
"qdebugFlag"
,
"135"
)
for
key
,
value
in
self
.
cfgDict
.
items
():
self
.
cfg
(
key
,
value
)
tdLog
.
debug
(
"psim is deployed and configured by %s"
%
(
self
.
cfgPath
))
...
...
@@ -378,6 +393,9 @@ class TDDnodes:
for
i
in
range
(
len
(
self
.
dnodes
)):
self
.
dnodes
[
i
].
init
(
self
.
path
)
self
.
sim
=
TDSimClient
()
self
.
sim
.
init
(
self
.
path
)
def
setTestCluster
(
self
,
value
):
self
.
testCluster
=
value
...
...
@@ -385,8 +403,6 @@ class TDDnodes:
self
.
valgrind
=
value
def
deploy
(
self
,
index
):
self
.
sim
=
TDSimClient
()
self
.
sim
.
init
(
self
.
path
)
self
.
sim
.
setTestCluster
(
self
.
testCluster
)
if
(
self
.
simDeployed
==
False
):
...
...
@@ -474,5 +490,11 @@ class TDDnodes:
def
getSimCfgPath
(
self
):
return
self
.
sim
.
getCfgDir
()
def
getSimLogPath
(
self
):
return
self
.
sim
.
getLogDir
()
def
addSimExtraCfg
(
self
,
option
,
value
):
self
.
sim
.
addExtraCfg
(
option
,
value
)
tdDnodes
=
TDDnodes
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录