Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
30ea2efd
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
30ea2efd
编写于
2月 06, 2021
作者:
sangshuduo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-2771] <feature>: python taosdemo. refine query.
上级
b1c6a7d4
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
14 addition
and
13 deletion
+14
-13
tests/examples/python/taosdemo/taosdemo.py
tests/examples/python/taosdemo/taosdemo.py
+14
-13
未找到文件。
tests/examples/python/taosdemo/taosdemo.py
浏览文件 @
30ea2efd
...
...
@@ -143,16 +143,17 @@ def query_data_process(cmd: str):
user
=
user
,
password
=
password
,
config
=
configDir
)
print
(
"conn: %s"
%
str
(
conn
.
__class__
))
v_print
(
"conn: %s"
,
str
(
conn
.
__class__
))
except
Exception
as
e
:
print
(
"Error: %s"
%
e
.
args
[
0
])
sys
.
exit
(
1
)
try
:
cursor
=
conn
.
cursor
()
print
(
"cursor:%d %s"
%
(
id
(
cursor
),
str
(
cursor
.
__class__
)
))
v_print
(
"cursor:%d %s"
,
id
(
cursor
),
str
(
cursor
.
__class__
))
except
Exception
as
e
:
print
(
"Error: %s"
%
e
.
args
[
0
])
conn
.
close
()
sys
.
exit
(
1
)
if
native
:
...
...
@@ -272,16 +273,17 @@ def insert_func(process: int, thread: int):
user
=
user
,
password
=
password
,
config
=
configDir
)
print
(
"conn: %s"
%
str
(
conn
.
__class__
))
v_print
(
"conn: %s"
,
str
(
conn
.
__class__
))
except
Exception
as
e
:
print
(
"Error: %s"
%
e
.
args
[
0
])
sys
.
exit
(
1
)
try
:
cursor
=
conn
.
cursor
()
print
(
"cursor:%d %s"
%
(
id
(
cursor
),
str
(
cursor
.
__class__
)
))
v_print
(
"cursor:%d %s"
,
id
(
cursor
),
str
(
cursor
.
__class__
))
except
Exception
as
e
:
print
(
"Error: %s"
%
e
.
args
[
0
])
conn
.
close
()
sys
.
exit
(
1
)
v_print
(
"numOfRec %d:"
,
numOfRec
)
...
...
@@ -331,10 +333,9 @@ def insert_func(process: int, thread: int):
if
measure
:
exec_end_time
=
datetime
.
datetime
.
now
()
exec_delta
=
exec_end_time
-
exec_start_time
print
(
"%s, %d"
%
(
time
.
strftime
(
'%X'
),
exec_delta
.
microseconds
))
v_print
(
"consume %d microseconds"
,
exec_delta
.
microseconds
)
v_print
(
"cmd: %s, length:%d"
,
cmd
,
len
(
cmd
))
...
...
@@ -489,7 +490,7 @@ if __name__ == "__main__":
threads
=
1
insertOnly
=
False
autosubtable
=
False
queryCmd
=
"
DEFAULT
"
queryCmd
=
"
NO
"
outOfOrder
=
0
rateOOOO
=
0
deleteMethod
=
0
...
...
@@ -541,7 +542,7 @@ if __name__ == "__main__":
'
\t
-M, --stable flag, Use super table. Default is no'
)
print
(
'
\t
-s, --stbname <stable prefix> stable_prefix, STable prefix name. Default is
\'
st
\'
'
)
print
(
'
\t
-Q, --query
<DEFAULT | NO | command> query, Execute query command. set
\'
DEFAULT
\'
means select * from each table'
)
print
(
'
\t
-Q, --query
[NO|EACHTB|command] query, Execute query command. set
\'
EACHTB
\'
means select * from each table'
)
print
(
'
\t
-T, --threads <number> num_of_threads, The number of threads. Default is 1.'
)
print
(
...
...
@@ -685,16 +686,17 @@ if __name__ == "__main__":
user
=
user
,
password
=
password
,
config
=
configDir
)
print
(
"conn: %s"
%
str
(
conn
.
__class__
))
v_print
(
"conn: %s"
,
str
(
conn
.
__class__
))
except
Exception
as
e
:
print
(
"Error: %s"
%
e
.
args
[
0
])
sys
.
exit
(
1
)
try
:
cursor
=
conn
.
cursor
()
print
(
"cursor:%d %s"
%
(
id
(
cursor
),
str
(
cursor
.
__class__
)
))
v_print
(
"cursor:%d %s"
,
id
(
cursor
),
str
(
cursor
.
__class__
))
except
Exception
as
e
:
print
(
"Error: %s"
%
e
.
args
[
0
])
conn
.
close
()
sys
.
exit
(
1
)
# drop data only if delete method be set
...
...
@@ -769,7 +771,6 @@ if __name__ == "__main__":
else
:
end
=
begin
+
quotient
pool
.
apply_async
(
insert_data_process
,
args
=
(
lock
,
i
,
begin
,
end
,))
# pool.apply_async(text, args=(lock, i, begin, end,))
pool
.
close
()
pool
.
join
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录