Skip to content

Commit

Permalink
feat: update taostools 404d8da for develop (taosdata#16819)
Browse files Browse the repository at this point in the history
* feat: update taos-tools f169c0f for develop

* feat: update taos-tools a4d9b92 for develop

* feat: update taos-tools 7d5c1c0 for develop

* fix: after taosbenchmark create table without if not exits

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

* test: add more taosdump test cases

* fix: rust example cargo bstr to 0.2

* feat: update taos-tools 404d8da for develop

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

* feat: update taos-tools 3588b3d for develop

* feat: update taos-tools 9f4c01e for develop
  • Loading branch information
sangshuduo authored Sep 14, 2022
1 parent 395d08c commit de43828
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class MockDataSource implements Iterator {
private int currentTbId = -1;

// 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};
int[] voltage = {119, 116, 111, 113, 118};
float[] phase = {0.32f, 0.34f, 0.33f, 0.329f, 0.141f};
Expand Down Expand Up @@ -50,4 +50,4 @@ public String next() {

return sb.toString();
}
}
}
2 changes: 1 addition & 1 deletion docs/examples/python/highvolume_mp_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
#
# # ANCHOR: 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]
# voltage = [119, 116, 111, 113, 118]
# phase = [0.32, 0.34, 0.33, 0.329, 0.141]
Expand Down
10 changes: 5 additions & 5 deletions docs/examples/python/mockdatasource.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

class MockDataSource:
samples = [
"8.8,119,0.32,LosAngeles,0",
"10.7,116,0.34,SanDiego,1",
"9.9,111,0.33,Hollywood,2",
"8.9,113,0.329,Compton,3",
"9.4,118,0.141,San Francisco,4"
"8.8,119,0.32,California.LosAngeles,0",
"10.7,116,0.34,California.SanDiego,1",
"9.9,111,0.33,California.SanJose,2",
"8.9,113,0.329,California.Campbell,3",
"9.4,118,0.141,California.SanFrancisco,4"
]

def __init__(self, tb_name_prefix, table_count):
Expand Down
2 changes: 1 addition & 1 deletion src/kit/taos-tools
28 changes: 15 additions & 13 deletions tests/develop-test/5-taos-tools/taosbenchmark/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

class TDTestCase:
def caseDescription(self):
'''
"""
[TD-13823] taosBenchmark test cases
'''
"""
return

def init(self, conn, logSql):
Expand All @@ -34,19 +34,19 @@ def init(self, conn, logSql):
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))

if ("community" in selfPath):
projPath = selfPath[:selfPath.find("community")]
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
else:
projPath = selfPath[:selfPath.find("tests")]
projPath = selfPath[: selfPath.find("tests")]

paths = []
for root, dirs, files in os.walk(projPath):
if ((tool) in files):
if (tool) in files:
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))
break
if (len(paths) == 0):
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
Expand All @@ -55,7 +55,7 @@ def getPath(self, tool="taosBenchmark"):

def run(self):
binPath = self.getPath()
cmd = "%s -n 100 -t 100 -y" %binPath
cmd = "%s -n 100 -t 100 -y" % binPath
tdLog.info("%s" % cmd)
os.system("%s" % cmd)
tdSql.execute("use test")
Expand All @@ -77,14 +77,16 @@ def run(self):
tdSql.checkData(4, 3, "TAG")
tdSql.checkData(5, 0, "location")
tdSql.checkData(5, 1, "BINARY")
tdSql.checkData(5, 2, 16)
tdSql.checkData(5, 2, 24)
tdSql.checkData(5, 3, "TAG")

tdSql.query("select count(*) from test.meters where groupid >= 0")
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 \
location = 'Palo Alto' or location = 'Campbell' or location = 'Mountain View' or location = 'Sunnyvale' or location = 'Santa Clara' or location = 'Cupertino' ")
tdSql.query(
"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)

def stop(self):
Expand All @@ -93,4 +95,4 @@ def stop(self):


tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())

0 comments on commit de43828

Please sign in to comment.