未验证 提交 77549dbb 编写于 作者: sangshuduo's avatar sangshuduo 提交者: GitHub

feat: update taostools 404d8da for2.6 (#16818)

* feat: update taos-tools f169c0f for 2.6

* feat: update taos-tools a4d9b92 for 2.6

* feat: update taos-tools 7d5c1c0 for 2.6

* fix: 5-taos-tools/taosbenchmark/taosdemoTestInsertWithJson-childTable.py

after, create table without if not exits

* fix: 5-taos-tools/taosbenchmark/taosdemoTestInsertWithJsonStmt.py

after, create table without if not exits

* feat: update taos-tools 2.2.0 (2dba49c) for 2.6

* feat: update test cases

* feat: update taos-tools 404d8da for 2.6

* test: fix location in develop-test/5-taos-tools/taosbenchmark/demo.py

* feat: update taos-tools 3588b3d for 2.6

* feat: update taos-tools 9f4c01e for 2.6
上级 db9dad4a
...@@ -16,7 +16,7 @@ class MockDataSource implements Iterator { ...@@ -16,7 +16,7 @@ class MockDataSource implements Iterator {
private int currentTbId = -1; private int currentTbId = -1;
// mock values // mock values
String[] location = {"LosAngeles", "SanDiego", "Hollywood", "Compton", "San Francisco"}; String[] location = {"California.LosAngeles", "California.SanDiego", "California.SanJose", "California.Campbell", "California.SanFrancisco"};
float[] current = {8.8f, 10.7f, 9.9f, 8.9f, 9.4f}; float[] current = {8.8f, 10.7f, 9.9f, 8.9f, 9.4f};
int[] voltage = {119, 116, 111, 113, 118}; int[] voltage = {119, 116, 111, 113, 118};
float[] phase = {0.32f, 0.34f, 0.33f, 0.329f, 0.141f}; float[] phase = {0.32f, 0.34f, 0.33f, 0.329f, 0.141f};
...@@ -50,4 +50,4 @@ class MockDataSource implements Iterator { ...@@ -50,4 +50,4 @@ class MockDataSource implements Iterator {
return sb.toString(); return sb.toString();
} }
} }
\ No newline at end of file
...@@ -42,7 +42,7 @@ def get_connection(): ...@@ -42,7 +42,7 @@ def get_connection():
# ANCHOR: MockDataSource # ANCHOR: MockDataSource
class MockDataSource: class MockDataSource:
location = ["LosAngeles", "SanDiego", "Hollywood", "Compton", "San Francisco"] location = ["California.LosAngeles", "California.SanDiego", "California.SanJose", "California.Campbell", "California.SanFrancisco"]
current = [8.8, 10.7, 9.9, 8.9, 9.4] current = [8.8, 10.7, 9.9, 8.9, 9.4]
voltage = [119, 116, 111, 113, 118] voltage = [119, 116, 111, 113, 118]
phase = [0.32, 0.34, 0.33, 0.329, 0.141] phase = [0.32, 0.34, 0.33, 0.329, 0.141]
......
...@@ -3,11 +3,11 @@ import time ...@@ -3,11 +3,11 @@ import time
class MockDataSource: class MockDataSource:
samples = [ samples = [
"8.8,119,0.32,LosAngeles,0", "8.8,119,0.32,California.LosAngeles,0",
"10.7,116,0.34,SanDiego,1", "10.7,116,0.34,California.SanDiego,1",
"9.9,111,0.33,Hollywood,2", "9.9,111,0.33,California.SanJose,2",
"8.9,113,0.329,Compton,3", "8.9,113,0.329,California.Campbell,3",
"9.4,118,0.141,San Francisco,4" "9.4,118,0.141,California.SanFrancisco,4"
] ]
def __init__(self, tb_name_prefix, table_count): def __init__(self, tb_name_prefix, table_count):
......
...@@ -132,7 +132,7 @@ Query OK, 2 row(s) in set (0.003128s) ...@@ -132,7 +132,7 @@ Query OK, 2 row(s) in set (0.003128s)
taosBenchmark taosBenchmark
``` ```
该命令将在数据库 test 下面自动创建一张超级表 meters,该超级表下有 1 万张表,表名为 "d0" 到 "d9999",每张表有 1 万条记录,每条记录有 (ts, current, voltage, phase) 四个字段,时间戳从 "2017-07-14 10:40:00 000" 到 "2017-07-14 10:40:09 999",每张表带有标签 location 和 groupId,groupId 被设置为 1 到 10, location 被设置为 "San Francisco" 或者 "Los Angeles"等城市名称。 该命令将在数据库 test 下面自动创建一张超级表 meters,该超级表下有 1 万张表,表名为 "d0" 到 "d9999",每张表有 1 万条记录,每条记录有 (ts, current, voltage, phase) 四个字段,时间戳从 "2017-07-14 10:40:00 000" 到 "2017-07-14 10:40:09 999",每张表带有标签 location 和 groupId,groupId 被设置为 1 到 10, location 被设置为 "California.SanFrancisco" 或者 "California.LosAngeles"等城市名称。
这条命令很快完成 1 亿条记录的插入。具体时间取决于硬件性能,即使在一台普通的 PC 服务器往往也仅需十几秒。 这条命令很快完成 1 亿条记录的插入。具体时间取决于硬件性能,即使在一台普通的 PC 服务器往往也仅需十几秒。
...@@ -154,10 +154,10 @@ taos> select count(*) from test.meters; ...@@ -154,10 +154,10 @@ taos> select count(*) from test.meters;
taos> select avg(current), max(voltage), min(phase) from test.meters; taos> select avg(current), max(voltage), min(phase) from test.meters;
``` ```
查询 location="San Francisco" 的记录总条数: 查询 location="California.SanFrancisco" 的记录总条数:
```sql ```sql
taos> select count(*) from test.meters where location="San Francisco"; taos> select count(*) from test.meters where location="California.SanFrancisco";
``` ```
查询 groupId=10 的所有记录的平均值、最大值、最小值等: 查询 groupId=10 的所有记录的平均值、最大值、最小值等:
......
Subproject commit 2dba49cf57cde998f768bb033619b4d8c5143127 Subproject commit 9f4c01ec83b93b2385816134071aa5e702a24079
...@@ -22,9 +22,9 @@ from util.dnodes import * ...@@ -22,9 +22,9 @@ from util.dnodes import *
class TDTestCase: class TDTestCase:
def caseDescription(self): def caseDescription(self):
''' """
[TD-13823] taosBenchmark test cases [TD-13823] taosBenchmark test cases
''' """
return return
def init(self, conn, logSql): def init(self, conn, logSql):
...@@ -34,19 +34,19 @@ class TDTestCase: ...@@ -34,19 +34,19 @@ class TDTestCase:
def getPath(self, tool="taosBenchmark"): def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__)) selfPath = os.path.dirname(os.path.realpath(__file__))
if ("community" in selfPath): if "community" in selfPath:
projPath = selfPath[:selfPath.find("community")] projPath = selfPath[: selfPath.find("community")]
else: else:
projPath = selfPath[:selfPath.find("tests")] projPath = selfPath[: selfPath.find("tests")]
paths = [] paths = []
for root, dirs, files in os.walk(projPath): for root, dirs, files in os.walk(projPath):
if ((tool) in files): if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root)) rootRealPath = os.path.dirname(os.path.realpath(root))
if ("packaging" not in rootRealPath): if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool)) paths.append(os.path.join(root, tool))
break break
if (len(paths) == 0): if len(paths) == 0:
tdLog.exit("taosBenchmark not found!") tdLog.exit("taosBenchmark not found!")
return return
else: else:
...@@ -55,7 +55,7 @@ class TDTestCase: ...@@ -55,7 +55,7 @@ class TDTestCase:
def run(self): def run(self):
binPath = self.getPath() binPath = self.getPath()
cmd = "%s -n 100 -t 100 -y" %binPath cmd = "%s -n 100 -t 100 -y" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.execute("use test") tdSql.execute("use test")
...@@ -77,14 +77,16 @@ class TDTestCase: ...@@ -77,14 +77,16 @@ class TDTestCase:
tdSql.checkData(4, 3, "TAG") tdSql.checkData(4, 3, "TAG")
tdSql.checkData(5, 0, "location") tdSql.checkData(5, 0, "location")
tdSql.checkData(5, 1, "BINARY") tdSql.checkData(5, 1, "BINARY")
tdSql.checkData(5, 2, 16) tdSql.checkData(5, 2, 24)
tdSql.checkData(5, 3, "TAG") tdSql.checkData(5, 3, "TAG")
tdSql.query("select count(*) from test.meters where groupid >= 0") tdSql.query("select count(*) from test.meters where groupid >= 0")
tdSql.checkData(0, 0, 10000) tdSql.checkData(0, 0, 10000)
tdSql.query("select count(*) from test.meters where location = 'San Francisco' or location = 'Los Angles' or location = 'San Diego' or location = 'San Jose' or \ tdSql.query(
location = 'Palo Alto' or location = 'Campbell' or location = 'Mountain View' or location = 'Sunnyvale' or location = 'Santa Clara' or location = 'Cupertino' ") "select count(*) from test.meters where location = 'California.SanFrancisco' or location = 'California.LosAngles' or location = 'California.SanDiego' or location = 'California.SanJose' or \
location = 'California.PaloAlto' or location = 'California.Campbell' or location = 'California.MountainView' or location = 'California.Sunnyvale' or location = 'California.SantaClara' or location = 'California.Cupertino' "
)
tdSql.checkData(0, 0, 10000) tdSql.checkData(0, 0, 10000)
def stop(self): def stop(self):
...@@ -93,4 +95,4 @@ class TDTestCase: ...@@ -93,4 +95,4 @@ class TDTestCase:
tdCases.addWindows(__file__, TDTestCase()) tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase()) tdCases.addLinux(__file__, TDTestCase())
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册