diff --git a/src/kit/taos-tools b/src/kit/taos-tools index 9f1b028ca325f67762826be4caf58d356ad7e389..da842b77f438e5b4c496918e51f8ea02ba0f2c99 160000 --- a/src/kit/taos-tools +++ b/src/kit/taos-tools @@ -1 +1 @@ -Subproject commit 9f1b028ca325f67762826be4caf58d356ad7e389 +Subproject commit da842b77f438e5b4c496918e51f8ea02ba0f2c99 diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/auto_create_table_json.py b/tests/develop-test/5-taos-tools/taosbenchmark/auto_create_table_json.py new file mode 100644 index 0000000000000000000000000000000000000000..404f922dc7a6fa07acf3fb74c93e66f9d052c6fe --- /dev/null +++ b/tests/develop-test/5-taos-tools/taosbenchmark/auto_create_table_json.py @@ -0,0 +1,102 @@ +################################################################### +# 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 os +from util.log import * +from util.cases import * +from util.sql import * +from util.dnodes import * + + +class TDTestCase: + def caseDescription(self): + ''' + [TD-11510] taosBenchmark test cases + ''' + return + + def init(self, conn, logSql): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), logSql) + + def run(self): + cmd = "taosBenchmark -f ./5-taos-tools/taosbenchmark/json/taosc_auto_create_table.json" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.execute("reset query cache") + tdSql.query("select count(tbname) from db.stb1") + tdSql.checkData(0, 0, 8) + tdSql.query("select count(*) from db.stb1") + tdSql.checkData(0, 0, 160) + + tdSql.execute("reset query cache") + tdSql.query("select count(tbname) from db.`stb1-2`") + tdSql.checkData(0, 0, 8) + tdSql.query("select count(*) from db.`stb1-2`") + tdSql.checkData(0, 0, 160) + + cmd = "taosBenchmark -f ./5-taos-tools/taosbenchmark/json/stmt_auto_create_table.json" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.execute("reset query cache") + tdSql.query("select count(tbname) from db.stb2") + tdSql.checkData(0, 0, 8) + tdSql.query("select count(*) from db.stb2") + tdSql.checkData(0, 0, 160) + tdSql.query("show databases") + tdSql.checkData(0, 16, "us") + + tdSql.execute("reset query cache") + tdSql.query("select count(tbname) from db.`stb2-2`") + tdSql.checkData(0, 0, 8) + tdSql.query("select count(*) from db.`stb2-2`") + tdSql.checkData(0, 0, 160) + + cmd = "taosBenchmark -f ./5-taos-tools/taosbenchmark/json/rest_auto_create_table.json" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.execute("reset query cache") + tdSql.query("select count(tbname) from db.stb3") + tdSql.checkData(0, 0, 8) + tdSql.query("select count(*) from db.stb3") + tdSql.checkData(0, 0, 160) + tdSql.query("show databases") + tdSql.checkData(0, 16, "ns") + + tdSql.execute("reset query cache") + tdSql.query("select count(tbname) from db.`stb3-2`") + tdSql.checkData(0, 0, 8) + tdSql.query("select count(*) from db.`stb3-2`") + tdSql.checkData(0, 0, 160) + + cmd = "taosBenchmark -f ./5-taos-tools/taosbenchmark/json/sml_auto_create_table.json" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.execute("reset query cache") + tdSql.query("select count(tbname) from db.stb4") + tdSql.checkData(0, 0, 8) + tdSql.query("select count(*) from db.stb4") + tdSql.checkData(0, 0, 160) + + tdSql.execute("reset query cache") + tdSql.query("select count(tbname) from db.`stb4-2`") + tdSql.checkData(0, 0, 8) + tdSql.query("select count(*) from db.`stb4-2`") + tdSql.checkData(0, 0, 160) + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) \ No newline at end of file diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/commandline.py b/tests/develop-test/5-taos-tools/taosbenchmark/commandline.py new file mode 100644 index 0000000000000000000000000000000000000000..51edecdbbfba7f23c55db9b4afc32bd5720ec36c --- /dev/null +++ b/tests/develop-test/5-taos-tools/taosbenchmark/commandline.py @@ -0,0 +1,294 @@ +################################################################### +# 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 os +import subprocess +import time + +from util.log import * +from util.cases import * +from util.sql import * +from util.dnodes import * + + +class TDTestCase: + def caseDescription(self): + ''' + [TD-11510] taosBenchmark test cases + ''' + return + + def init(self, conn, logSql): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), logSql) + + def run(self): + cmd = "taosBenchmark -F 7 -n 10 -t 2 -x -y -M -C -d newtest -l 5 -A binary,nchar\(31\) -b tinyint,binary\(23\),bool,nchar -w 29 -E -m $%^*" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.execute("use newtest") + tdSql.query("select count(*) from newtest.meters") + tdSql.checkData(0, 0, 20) + tdSql.query("select distinct(c0) from newtest.meters") + tdSql.checkRows(7) + tdSql.query("describe meters") + tdSql.checkRows(8) + tdSql.checkData(0, 1, "TIMESTAMP") + tdSql.checkData(1, 1, "TINYINT") + tdSql.checkData(2, 1, "BINARY") + tdSql.checkData(2, 2, 23) + tdSql.checkData(3, 1, "BOOL") + tdSql.checkData(4, 1, "NCHAR") + tdSql.checkData(4, 2, 29) + tdSql.checkData(5, 1, "INT") + tdSql.checkData(6, 1, "BINARY") + tdSql.checkData(6, 2, 29) + tdSql.checkData(6, 3, "TAG") + tdSql.checkData(7, 1, "NCHAR") + tdSql.checkData(7, 2, 31) + tdSql.checkData(7, 3, "TAG") + tdSql.query("select tbname from meters where tbname like '$%^*%'") + tdSql.checkRows(2) + tdSql.execute("drop database if exists newtest") + + cmd = "taosBenchmark -F 7 -n 10 -t 2 -y -M -I stmt" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.query("select count(tbname) from test.meters") + tdSql.checkData(0, 0, 2) + tdSql.query("select count(*) from test.meters") + tdSql.checkData(0, 0, 20) + tdSql.query("select distinct(c0) from test.meters") + tdSql.checkRows(7) + + cmd = "taosBenchmark -n 3 -t 3 -B 2 -i 1 -G -y -T 1 2>&1 | grep sleep | wc -l" + sleepTimes = subprocess.check_output(cmd, shell=True).decode("utf-8") + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + if (int(sleepTimes) != 2): + tdLog.exit("expected sleep times 2, actual %d" % int(sleepTimes)) + + cmd = "taosBenchmark -n 3 -t 3 -B 2 -i 1 -G -y -T 1 -r 1 2>&1 | grep sleep | wc -l" + sleepTimes = subprocess.check_output(cmd, shell=True).decode("utf-8") + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + if (int(sleepTimes) != 3): + tdLog.exit("expected sleep times 3, actual %d" % int(sleepTimes)) + + cmd = "taosBenchmark -n 3 -t 3 -B 2 -i 1 -G -y -T 1 -I sml 2>&1 | grep sleep | wc -l" + sleepTimes = subprocess.check_output(cmd, shell=True).decode("utf-8") + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + if (int(sleepTimes) != 2): + tdLog.exit("expected sleep times 2, actual %d" % int(sleepTimes)) + + cmd = "taosBenchmark -n 3 -t 3 -B 2 -i 1 -G -y -T 1 -r 1 -I sml 2>&1 | grep sleep | wc -l" + sleepTimes = subprocess.check_output(cmd, shell=True).decode("utf-8") + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + if (int(sleepTimes) != 3): + tdLog.exit("expected sleep times 3, actual %d" % int(sleepTimes)) + + cmd = "taosBenchmark -n 3 -t 3 -B 2 -i 1 -G -y -T 1 -I stmt 2>&1 | grep sleep | wc -l" + sleepTimes = subprocess.check_output(cmd, shell=True).decode("utf-8") + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + if (int(sleepTimes) != 2): + tdLog.exit("expected sleep times 2, actual %d" % int(sleepTimes)) + + cmd = "taosBenchmark -n 3 -t 3 -B 2 -i 1 -G -y -T 1 -r 1 -I stmt 2>&1 | grep sleep | wc -l" + sleepTimes = subprocess.check_output(cmd, shell=True).decode("utf-8") + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + if (int(sleepTimes) != 3): + tdLog.exit("expected sleep times 3, actual %d" % int(sleepTimes)) + + cmd = "taosBenchmark -S 17 -n 3 -t 1 -y -x" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.query("select last(ts) from test.meters") + tdSql.checkData(0, 0 , "2017-07-14 10:40:00.034") + + cmd = "taosBenchmark -N -I taosc -t 11 -n 11 -y -x -E" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.execute("use test") + tdSql.query("show stables") + tdSql.checkRows(0) + tdSql.query("show tables") + tdSql.checkRows(11) + tdSql.query("select count(*) from `d10`") + tdSql.checkData(0, 0, 11) + + cmd = "taosBenchmark -N -I rest -t 11 -n 11 -y -x" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.execute("use test") + tdSql.query("show stables") + tdSql.checkRows(0) + tdSql.query("show tables") + tdSql.checkRows(11) + tdSql.query("select count(*) from d10") + tdSql.checkData(0, 0, 11) + + cmd = "taosBenchmark -N -I stmt -t 11 -n 11 -y -x" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.execute("use test") + tdSql.query("show stables") + tdSql.checkRows(0) + tdSql.query("show tables") + tdSql.checkRows(11) + tdSql.query("select count(*) from d10") + tdSql.checkData(0, 0, 11) + + cmd = "taosBenchmark -N -I sml -y" + tdLog.info("%s" % cmd) + assert(os.system("%s" % cmd) !=0 ) + + cmd = "taosBenchmark -n 1 -t 1 -y -b bool" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.execute("reset query cache") + tdSql.query("describe test.meters") + tdSql.checkData(1, 1, "BOOL") + + cmd = "taosBenchmark -n 1 -t 1 -y -b tinyint" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.execute("reset query cache") + tdSql.query("describe test.meters") + tdSql.checkData(1, 1, "TINYINT") + + cmd = "taosBenchmark -n 1 -t 1 -y -b utinyint" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.execute("reset query cache") + tdSql.query("describe test.meters") + tdSql.checkData(1, 1, "TINYINT UNSIGNED") + + cmd = "taosBenchmark -n 1 -t 1 -y -b smallint" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.execute("reset query cache") + tdSql.query("describe test.meters") + tdSql.checkData(1, 1, "SMALLINT") + + cmd = "taosBenchmark -n 1 -t 1 -y -b usmallint" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.execute("reset query cache") + tdSql.query("describe test.meters") + tdSql.checkData(1, 1, "SMALLINT UNSIGNED") + + cmd = "taosBenchmark -n 1 -t 1 -y -b int" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.execute("reset query cache") + tdSql.query("describe test.meters") + tdSql.checkData(1, 1, "INT") + + cmd = "taosBenchmark -n 1 -t 1 -y -b uint" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.execute("reset query cache") + tdSql.query("describe test.meters") + tdSql.checkData(1, 1, "INT UNSIGNED") + + cmd = "taosBenchmark -n 1 -t 1 -y -b bigint" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.execute("reset query cache") + tdSql.query("describe test.meters") + tdSql.checkData(1, 1, "BIGINT") + + cmd = "taosBenchmark -n 1 -t 1 -y -b ubigint" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.execute("reset query cache") + tdSql.query("describe test.meters") + tdSql.checkData(1, 1, "BIGINT UNSIGNED") + + cmd = "taosBenchmark -n 1 -t 1 -y -b timestamp" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.execute("reset query cache") + tdSql.query("describe test.meters") + tdSql.checkData(1, 1, "TIMESTAMP") + + cmd = "taosBenchmark -n 1 -t 1 -y -b float" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.execute("reset query cache") + tdSql.query("describe test.meters") + tdSql.checkData(1, 1, "FLOAT") + + cmd = "taosBenchmark -n 1 -t 1 -y -b double" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.execute("reset query cache") + tdSql.query("describe test.meters") + tdSql.checkData(1, 1, "DOUBLE") + + cmd = "taosBenchmark -n 1 -t 1 -y -b nchar" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.execute("reset query cache") + tdSql.query("describe test.meters") + tdSql.checkData(1, 1, "NCHAR") + + cmd = "taosBenchmark -n 1 -t 1 -y -b nchar\(7\)" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.execute("reset query cache") + tdSql.query("describe test.meters") + tdSql.checkData(1, 1, "NCHAR") + + cmd = "taosBenchmark -n 1 -t 1 -y -b binary" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.execute("reset query cache") + tdSql.query("describe test.meters") + tdSql.checkData(1, 1, "BINARY") + + cmd = "taosBenchmark -n 1 -t 1 -y -b binary\(7\)" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.execute("reset query cache") + tdSql.query("describe test.meters") + tdSql.checkData(1, 1, "BINARY") + + cmd = "taosBenchmark -n 1 -t 1 -y -A json\(7\)" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.execute("reset query cache") + tdSql.query("describe test.meters") + tdSql.checkData(4, 1, "JSON") + + cmd = "taosBenchmark -n 1 -t 1 -y -b int,x" + tdLog.info("%s" % cmd) + assert(os.system("%s" % cmd) != 0) + + cmd = "taosBenchmark -n 1 -t 1 -y -A int,json" + tdLog.info("%s" % cmd) + assert(os.system("%s" % cmd) != 0) + + + + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) \ No newline at end of file diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/csv/sample_tags.csv b/tests/develop-test/5-taos-tools/taosbenchmark/csv/sample_tags.csv new file mode 100644 index 0000000000000000000000000000000000000000..8e2afd342773582f9484b796cdc0b84736e8194e --- /dev/null +++ b/tests/develop-test/5-taos-tools/taosbenchmark/csv/sample_tags.csv @@ -0,0 +1 @@ +17 \ No newline at end of file diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/csv/sample_use_ts.csv b/tests/develop-test/5-taos-tools/taosbenchmark/csv/sample_use_ts.csv new file mode 100644 index 0000000000000000000000000000000000000000..f92eedd50d35e1666d8d74a999fd968271944a57 --- /dev/null +++ b/tests/develop-test/5-taos-tools/taosbenchmark/csv/sample_use_ts.csv @@ -0,0 +1,3 @@ +1641976781445,1 +1641976781446,2 +1641976781447,3 \ No newline at end of file diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/default_json.py b/tests/develop-test/5-taos-tools/taosbenchmark/default_json.py new file mode 100644 index 0000000000000000000000000000000000000000..fd8bde5c1066833f9c2413b434dbc7e467a27b7b --- /dev/null +++ b/tests/develop-test/5-taos-tools/taosbenchmark/default_json.py @@ -0,0 +1,47 @@ +################################################################### +# 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 os +from util.log import * +from util.cases import * +from util.sql import * +from util.dnodes import * + + +class TDTestCase: + def caseDescription(self): + ''' + [TD-11510] taosBenchmark test cases + ''' + return + + def init(self, conn, logSql): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), logSql) + + def run(self): + cmd = "taosBenchmark -f ./5-taos-tools/taosbenchmark/json/default.json" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.execute("reset query cache") + tdSql.query("select count(tbname) from db.stb") + tdSql.checkData(0, 0, 10) + tdSql.query("select count(*) from db.stb") + tdSql.checkData(0, 0, 100) + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) \ No newline at end of file diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/insert_alltypes_json.py b/tests/develop-test/5-taos-tools/taosbenchmark/insert_alltypes_json.py new file mode 100644 index 0000000000000000000000000000000000000000..0b8dd11accef03243e5b285bbd86c80ab06f4267 --- /dev/null +++ b/tests/develop-test/5-taos-tools/taosbenchmark/insert_alltypes_json.py @@ -0,0 +1,203 @@ +################################################################### +# 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 os +from util.log import * +from util.cases import * +from util.sql import * +from util.dnodes import * + + +class TDTestCase: + def caseDescription(self): + ''' + [TD-11510] taosBenchmark test cases + ''' + return + + def init(self, conn, logSql): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), logSql) + + def run(self): + cmd = "taosBenchmark -f ./5-taos-tools/taosbenchmark/json/taosc_insert_alltypes.json" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.query("select count(*) from db.stb") + tdSql.checkData(0, 0, 160) + tdSql.execute("reset query cache") + tdSql.query("describe db.stb") + tdSql.checkRows(29) + tdSql.checkData(0, 1, "TIMESTAMP") + tdSql.checkData(1, 1, "TIMESTAMP") + tdSql.checkData(2, 1, "INT") + tdSql.checkData(3, 1, "BIGINT") + tdSql.checkData(4, 1, "FLOAT") + tdSql.checkData(5, 1, "DOUBLE") + tdSql.checkData(6, 1, "SMALLINT") + tdSql.checkData(7, 1, "TINYINT") + tdSql.checkData(8, 1, "BOOL") + tdSql.checkData(9, 1, "NCHAR") + tdSql.checkData(9, 2, 29) + tdSql.checkData(10, 1, "INT UNSIGNED") + tdSql.checkData(11, 1, "BIGINT UNSIGNED") + tdSql.checkData(12, 1, "TINYINT UNSIGNED") + tdSql.checkData(13, 1, "SMALLINT UNSIGNED") + tdSql.checkData(14, 1, "BINARY") + tdSql.checkData(14, 2, 23) + tdSql.checkData(15, 1, "TIMESTAMP") + tdSql.checkData(16, 1, "INT") + tdSql.checkData(17, 1, "BIGINT") + tdSql.checkData(18, 1, "FLOAT") + tdSql.checkData(19, 1, "DOUBLE") + tdSql.checkData(20, 1, "SMALLINT") + tdSql.checkData(21, 1, "TINYINT") + tdSql.checkData(22, 1, "BOOL") + tdSql.checkData(23, 1, "NCHAR") + tdSql.checkData(23, 2, 17) + tdSql.checkData(24, 1, "INT UNSIGNED") + tdSql.checkData(25, 1, "BIGINT UNSIGNED") + tdSql.checkData(26, 1, "TINYINT UNSIGNED") + tdSql.checkData(27, 1, "SMALLINT UNSIGNED") + tdSql.checkData(28, 1, "BINARY") + tdSql.checkData(28, 2, 19) + + cmd = "taosBenchmark -f ./5-taos-tools/taosbenchmark/json/sml_insert_alltypes.json" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.query("select count(*) from db.stb") + tdSql.checkData(0, 0, 160) + tdSql.execute("reset query cache") + tdSql.query("describe db.stb") + tdSql.checkRows(27) + tdSql.checkData(0, 1, "TIMESTAMP") + tdSql.checkData(1, 1, "INT") + tdSql.checkData(2, 1, "BIGINT") + tdSql.checkData(3, 1, "FLOAT") + tdSql.checkData(4, 1, "DOUBLE") + tdSql.checkData(5, 1, "SMALLINT") + tdSql.checkData(6, 1, "TINYINT") + tdSql.checkData(7, 1, "BOOL") + tdSql.checkData(8, 1, "NCHAR") + tdSql.checkData(8, 2, 29) + tdSql.checkData(9, 1, "INT UNSIGNED") + tdSql.checkData(10, 1, "BIGINT UNSIGNED") + tdSql.checkData(11, 1, "TINYINT UNSIGNED") + tdSql.checkData(12, 1, "SMALLINT UNSIGNED") + tdSql.checkData(13, 1, "BINARY") + tdSql.checkData(13, 2, 23) + tdSql.checkData(14, 1, "NCHAR") + tdSql.checkData(15, 1, "NCHAR") + tdSql.checkData(16, 1, "NCHAR") + tdSql.checkData(17, 1, "NCHAR") + tdSql.checkData(18, 1, "NCHAR") + tdSql.checkData(19, 1, "NCHAR") + tdSql.checkData(20, 1, "NCHAR") + tdSql.checkData(21, 1, "NCHAR") + tdSql.checkData(22, 1, "NCHAR") + tdSql.checkData(23, 1, "NCHAR") + tdSql.checkData(24, 1, "NCHAR") + tdSql.checkData(25, 1, "NCHAR") + tdSql.checkData(26, 1, "NCHAR") + + cmd = "taosBenchmark -f ./5-taos-tools/taosbenchmark/json/rest_insert_alltypes.json" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.query("select count(*) from db.stb") + tdSql.checkData(0, 0, 160) + tdSql.execute("reset query cache") + tdSql.query("describe db.stb") + tdSql.checkRows(29) + tdSql.checkData(0, 1, "TIMESTAMP") + tdSql.checkData(1, 1, "TIMESTAMP") + tdSql.checkData(2, 1, "INT") + tdSql.checkData(3, 1, "BIGINT") + tdSql.checkData(4, 1, "FLOAT") + tdSql.checkData(5, 1, "DOUBLE") + tdSql.checkData(6, 1, "SMALLINT") + tdSql.checkData(7, 1, "TINYINT") + tdSql.checkData(8, 1, "BOOL") + tdSql.checkData(9, 1, "NCHAR") + tdSql.checkData(9, 2, 29) + tdSql.checkData(10, 1, "INT UNSIGNED") + tdSql.checkData(11, 1, "BIGINT UNSIGNED") + tdSql.checkData(12, 1, "TINYINT UNSIGNED") + tdSql.checkData(13, 1, "SMALLINT UNSIGNED") + tdSql.checkData(14, 1, "BINARY") + tdSql.checkData(14, 2, 23) + tdSql.checkData(15, 1, "TIMESTAMP") + tdSql.checkData(16, 1, "INT") + tdSql.checkData(17, 1, "BIGINT") + tdSql.checkData(18, 1, "FLOAT") + tdSql.checkData(19, 1, "DOUBLE") + tdSql.checkData(20, 1, "SMALLINT") + tdSql.checkData(21, 1, "TINYINT") + tdSql.checkData(22, 1, "BOOL") + tdSql.checkData(23, 1, "NCHAR") + tdSql.checkData(23, 2, 17) + tdSql.checkData(24, 1, "INT UNSIGNED") + tdSql.checkData(25, 1, "BIGINT UNSIGNED") + tdSql.checkData(26, 1, "TINYINT UNSIGNED") + tdSql.checkData(27, 1, "SMALLINT UNSIGNED") + tdSql.checkData(28, 1, "BINARY") + tdSql.checkData(28, 2, 19) + + cmd = "taosBenchmark -f ./5-taos-tools/taosbenchmark/json/stmt_insert_alltypes.json" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.query("select count(*) from db.stb") + tdSql.checkData(0, 0, 160) + tdSql.execute("reset query cache") + tdSql.query("describe db.stb") + tdSql.checkRows(29) + tdSql.checkData(0, 1, "TIMESTAMP") + tdSql.checkData(1, 1, "TIMESTAMP") + tdSql.checkData(2, 1, "INT") + tdSql.checkData(3, 1, "BIGINT") + tdSql.checkData(4, 1, "FLOAT") + tdSql.checkData(5, 1, "DOUBLE") + tdSql.checkData(6, 1, "SMALLINT") + tdSql.checkData(7, 1, "TINYINT") + tdSql.checkData(8, 1, "BOOL") + tdSql.checkData(9, 1, "NCHAR") + tdSql.checkData(9, 2, 29) + tdSql.checkData(10, 1, "INT UNSIGNED") + tdSql.checkData(11, 1, "BIGINT UNSIGNED") + tdSql.checkData(12, 1, "TINYINT UNSIGNED") + tdSql.checkData(13, 1, "SMALLINT UNSIGNED") + tdSql.checkData(14, 1, "BINARY") + tdSql.checkData(14, 2, 23) + tdSql.checkData(15, 1, "TIMESTAMP") + tdSql.checkData(16, 1, "INT") + tdSql.checkData(17, 1, "BIGINT") + tdSql.checkData(18, 1, "FLOAT") + tdSql.checkData(19, 1, "DOUBLE") + tdSql.checkData(20, 1, "SMALLINT") + tdSql.checkData(21, 1, "TINYINT") + tdSql.checkData(22, 1, "BOOL") + tdSql.checkData(23, 1, "NCHAR") + tdSql.checkData(23, 2, 17) + tdSql.checkData(24, 1, "INT UNSIGNED") + tdSql.checkData(25, 1, "BIGINT UNSIGNED") + tdSql.checkData(26, 1, "TINYINT UNSIGNED") + tdSql.checkData(27, 1, "SMALLINT UNSIGNED") + tdSql.checkData(28, 1, "BINARY") + tdSql.checkData(28, 2, 19) + + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) \ No newline at end of file diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/invalid_commandline.py b/tests/develop-test/5-taos-tools/taosbenchmark/invalid_commandline.py new file mode 100644 index 0000000000000000000000000000000000000000..99e3d1dc766b51f59927bfe75929605e774ddfa7 --- /dev/null +++ b/tests/develop-test/5-taos-tools/taosbenchmark/invalid_commandline.py @@ -0,0 +1,68 @@ +################################################################### +# 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 os +from util.log import * +from util.cases import * +from util.sql import * +from util.dnodes import * + + +class TDTestCase: + def caseDescription(self): + ''' + [TD-11510] taosBenchmark test cases + ''' + return + + def init(self, conn, logSql): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), logSql) + + def run(self): + cmd = "taosBenchmark -F abc -P abc -I abc -T abc -i abc -S abc -B abc -r abc -t abc -n abc -l abc -w abc -w 16385 -R abc -O abc -a abc -n 2 -t 2 -r 1 -y" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.query("select count(*) from test.meters") + tdSql.checkData(0, 0, 4) + + cmd = "taosBenchmark non_exist_opt" + tdLog.info("%s" % cmd) + assert (os.system("%s" % cmd) != 0) + + cmd = "taosBenchmark -f non_exist_file" + tdLog.info("%s" % cmd) + assert (os.system("%s" % cmd) != 0) + + cmd = "taosBenchmark -h non_exist_host" + tdLog.info("%s" % cmd) + assert (os.system("%s" % cmd) != 0) + + cmd = "taosBenchmark -p non_exist_pass" + tdLog.info("%s" % cmd) + assert (os.system("%s" % cmd) != 0) + + cmd = "taosBenchmark -u non_exist_user" + tdLog.info("%s" % cmd) + assert (os.system("%s" % cmd) != 0) + + cmd = "taosBenchmark -c non_exist_dir -n 1 -t 1 -o non_exist_path -y" + tdLog.info("%s" % cmd) + assert (os.system("%s" % cmd) == 0) + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) \ No newline at end of file diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/json/default.json b/tests/develop-test/5-taos-tools/taosbenchmark/json/default.json new file mode 100644 index 0000000000000000000000000000000000000000..f0ad9d516e2f3855722ea41ea88cdee5c7f06de7 --- /dev/null +++ b/tests/develop-test/5-taos-tools/taosbenchmark/json/default.json @@ -0,0 +1,27 @@ +{ + "filetype": "insert", + "cfgdir": "/etc/taos", + "host": "127.0.0.1", + "port": 6030, + "user": "root", + "password": "taosdata", + "thread_count": 4, + "thread_pool_size": 20, + "result_file": "./insert_res.txt", + "confirm_parameter_prompt": "no", + "prepared_rand": 10, + "chinese": "no", + "insert_interval": 0, + "num_of_records_per_req": 10, + "databases": [{ + "dbinfo": { + "name": "db" + }, + "super_tables": [{ + "name": "stb", + "childtable_prefix": "stb_", + "columns": [{"type": "INT"}], + "tags": [{"type": "INT"}] + }] + }] +} \ No newline at end of file diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/json/json_alltypes.json b/tests/develop-test/5-taos-tools/taosbenchmark/json/json_alltypes.json new file mode 100644 index 0000000000000000000000000000000000000000..f0c0f9649385006b6859c0247e86d9f0ed3cfb31 --- /dev/null +++ b/tests/develop-test/5-taos-tools/taosbenchmark/json/json_alltypes.json @@ -0,0 +1,262 @@ +{ + "filetype": "insert", + "cfgdir": "/etc/taos", + "host": "127.0.0.1", + "port": 6030, + "user": "root", + "password": "taosdata", + "thread_count": 4, + "thread_pool_size": 20, + "result_file": "./insert_res.txt", + "confirm_parameter_prompt": "no", + "prepared_rand": 10, + "chinese": "no", + "insert_interval": 0, + "num_of_records_per_req": 10, + "databases": [{ + "dbinfo": { + "name": "db", + "drop": "yes", + "replica": 1, + "days": 10, + "cache": 16, + "blocks": 8, + "precision": "ms", + "keep": 36500, + "minRows": 100, + "maxRows": 4096, + "comp":2, + "walLevel":1, + "cachelast":0, + "quorum":1, + "fsync":3000, + "update": 0 + }, + "super_tables": [{ + "name": "stb1", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb1_", + "escape_character": "no", + "auto_create_table": "no", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "sml", + "line_protocol": "json", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 0, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "now", + "sample_file": "", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "BOOL"}], + "tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "BINARY", "len": 19, "count":1}] + },{ + "name": "stb2", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb2_", + "escape_character": "no", + "auto_create_table": "no", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "sml", + "line_protocol": "json", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 0, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "now", + "sample_file": "", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "TINYINT"}], + "tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "BINARY", "len": 19, "count":1}] + },{ + "name": "stb3", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb3_", + "escape_character": "no", + "auto_create_table": "no", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "sml", + "line_protocol": "json", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 0, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "now", + "sample_file": "", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "SMALLINT"}], + "tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "BINARY", "len": 19, "count":1}] + },{ + "name": "stb4", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb4_", + "escape_character": "no", + "auto_create_table": "no", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "sml", + "line_protocol": "json", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 0, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "now", + "sample_file": "", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "INT"}], + "tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "BINARY", "len": 19, "count":1}] + },{ + "name": "stb5", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb5_", + "escape_character": "no", + "auto_create_table": "no", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "sml", + "line_protocol": "json", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 0, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "now", + "sample_file": "", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "BIGINT"}], + "tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "BINARY", "len": 19, "count":1}] + },{ + "name": "stb6", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb6_", + "escape_character": "no", + "auto_create_table": "no", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "sml", + "line_protocol": "json", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 0, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "now", + "sample_file": "", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "FLOAT"}], + "tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "BINARY", "len": 19, "count":1}] + },{ + "name": "stb7", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb7_", + "escape_character": "no", + "auto_create_table": "no", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "sml", + "line_protocol": "json", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 0, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "now", + "sample_file": "", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "DOUBLE"}], + "tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "BINARY", "len": 19, "count":1}] + },{ + "name": "stb8", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb8_", + "escape_character": "no", + "auto_create_table": "no", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "sml", + "line_protocol": "json", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 0, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "now", + "sample_file": "", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "BINARY", "len": 8}], + "tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "BINARY", "len": 19, "count":1}] + },{ + "name": "stb9", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb9_", + "escape_character": "no", + "auto_create_table": "no", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "sml", + "line_protocol": "json", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 0, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "now", + "sample_file": "", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "NCHAR", "len": 8}], + "tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "BINARY", "len": 19, "count":1}] + }] + }] +} diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/json/rest_auto_create_table.json b/tests/develop-test/5-taos-tools/taosbenchmark/json/rest_auto_create_table.json new file mode 100644 index 0000000000000000000000000000000000000000..e52fadc8576c76e28079eb935f1c95d0302f6b41 --- /dev/null +++ b/tests/develop-test/5-taos-tools/taosbenchmark/json/rest_auto_create_table.json @@ -0,0 +1,87 @@ +{ + "filetype": "insert", + "cfgdir": "/etc/taos", + "host": "127.0.0.1", + "port": 6030, + "user": "root", + "password": "taosdata", + "thread_count": 4, + "thread_pool_size": 20, + "result_file": "./insert_res.txt", + "confirm_parameter_prompt": "no", + "prepared_rand": 100, + "chinese": "no", + "insert_interval": 0, + "num_of_records_per_req": 10, + "databases": [{ + "dbinfo": { + "name": "db", + "drop": "yes", + "replica": 1, + "days": 10, + "cache": 16, + "blocks": 8, + "precision": "ns", + "keep": 36500, + "minRows": 100, + "maxRows": 4096, + "comp":2, + "walLevel":1, + "cachelast":0, + "quorum":1, + "fsync":3000, + "update": 0 + }, + "super_tables": [{ + "name": "stb3", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb_", + "escape_character": "yes", + "auto_create_table": "yes", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "rest", + "line_protocol": "line", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 0, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "now", + "sample_file": "./sample.csv", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 29, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 23, "count":1}], + "tags": [{"type": "TIMESTAMP"},{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}] + },{ + "name": "stb3-2", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb3-2_", + "escape_character": "yes", + "auto_create_table": "yes", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "rest", + "line_protocol": "line", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 5, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "2020-10-01 00:00:00.000", + "sample_file": "./sample.csv", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 29, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 23, "count":1}], + "tags": [{"type": "TIMESTAMP"},{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}] + }] + }] +} \ No newline at end of file diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/json/rest_insert_alltypes.json b/tests/develop-test/5-taos-tools/taosbenchmark/json/rest_insert_alltypes.json new file mode 100644 index 0000000000000000000000000000000000000000..e45ae7890af33a9ddc4b7d552adeb781aaa8a6ba --- /dev/null +++ b/tests/develop-test/5-taos-tools/taosbenchmark/json/rest_insert_alltypes.json @@ -0,0 +1,62 @@ +{ + "filetype": "insert", + "cfgdir": "/etc/taos", + "host": "127.0.0.1", + "port": 6030, + "user": "root", + "password": "taosdata", + "thread_count": 4, + "thread_pool_size": 20, + "result_file": "./insert_res.txt", + "confirm_parameter_prompt": "no", + "prepared_rand": 10, + "chinese": "no", + "insert_interval": 0, + "num_of_records_per_req": 10, + "databases": [{ + "dbinfo": { + "name": "db", + "drop": "yes", + "replica": 1, + "days": 10, + "cache": 16, + "blocks": 8, + "precision": "ns", + "keep": 36500, + "minRows": 100, + "maxRows": 4096, + "comp":2, + "walLevel":1, + "cachelast":0, + "quorum":1, + "fsync":3000, + "update": 0 + }, + "super_tables": [{ + "name": "stb", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb_", + "escape_character": "yes", + "auto_create_table": "no", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "rest", + "line_protocol": "line", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 0, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "2020-10-01 00:00:00.000", + "sample_file": "./sample.csv", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "TIMESTAMP"},{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 29, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 23, "count":1}], + "tags": [{"type": "TIMESTAMP"},{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}] + }] + }] +} diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/json/rest_query.json b/tests/develop-test/5-taos-tools/taosbenchmark/json/rest_query.json new file mode 100644 index 0000000000000000000000000000000000000000..9ef1b933d8ea019004bc373529c26f4ba5c58018 --- /dev/null +++ b/tests/develop-test/5-taos-tools/taosbenchmark/json/rest_query.json @@ -0,0 +1,27 @@ +{ + "filetype":"query", + "cfgdir": "/etc/taos", + "confirm_parameter_prompt": "no", + "databases": "db", + "query_mode": "rest", + "thread_pool_size": 20, + "response_buffer": 10000, + "specified_table_query": + { + "query_times": 1, + "sqls": + [{ + "sql": "select count(*) from db.stb", + "result": "rest_query_specified" + }] + }, + "super_table_query": { + "stblname": "stb", + "sqls": [ + { + "sql": "select count(*) from xxxx", + "result": "rest_query_super" + } + ] + } +} \ No newline at end of file diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/json/sml_auto_create_table.json b/tests/develop-test/5-taos-tools/taosbenchmark/json/sml_auto_create_table.json new file mode 100644 index 0000000000000000000000000000000000000000..9bb5c4292cf9c1fb6628517dfc044fe2065e2c2e --- /dev/null +++ b/tests/develop-test/5-taos-tools/taosbenchmark/json/sml_auto_create_table.json @@ -0,0 +1,87 @@ +{ + "filetype": "insert", + "cfgdir": "/etc/taos", + "host": "127.0.0.1", + "port": 6030, + "user": "root", + "password": "taosdata", + "thread_count": 4, + "thread_pool_size": 20, + "result_file": "./insert_res.txt", + "confirm_parameter_prompt": "no", + "prepared_rand": 100, + "chinese": "no", + "insert_interval": 0, + "num_of_records_per_req": 10, + "databases": [{ + "dbinfo": { + "name": "db", + "drop": "yes", + "replica": 1, + "days": 10, + "cache": 16, + "blocks": 8, + "precision": "ms", + "keep": 36500, + "minRows": 100, + "maxRows": 4096, + "comp":2, + "walLevel":1, + "cachelast":0, + "quorum":1, + "fsync":3000, + "update": 0 + }, + "super_tables": [{ + "name": "stb4", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb_", + "escape_character": "yes", + "auto_create_table": "yes", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "sml", + "line_protocol": "line", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 0, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "2020-10-01 00:00:00.000", + "sample_file": "./sample.csv", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 29, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 23, "count":1}], + "tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}] + },{ + "name": "stb4-2", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb4-2_", + "escape_character": "yes", + "auto_create_table": "yes", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "sml", + "line_protocol": "line", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 5, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "2020-10-01 00:00:00.000", + "sample_file": "./sample.csv", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 29, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 23, "count":1}], + "tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}] + }] + }] +} \ No newline at end of file diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/json/sml_insert_alltypes.json b/tests/develop-test/5-taos-tools/taosbenchmark/json/sml_insert_alltypes.json new file mode 100644 index 0000000000000000000000000000000000000000..45cf05d3e620f0dfed070d01150ad4961087efaf --- /dev/null +++ b/tests/develop-test/5-taos-tools/taosbenchmark/json/sml_insert_alltypes.json @@ -0,0 +1,62 @@ +{ + "filetype": "insert", + "cfgdir": "/etc/taos", + "host": "127.0.0.1", + "port": 6030, + "user": "root", + "password": "taosdata", + "thread_count": 4, + "thread_pool_size": 20, + "result_file": "./insert_res.txt", + "confirm_parameter_prompt": "no", + "prepared_rand": 10, + "chinese": "no", + "insert_interval": 0, + "num_of_records_per_req": 10, + "databases": [{ + "dbinfo": { + "name": "db", + "drop": "yes", + "replica": 1, + "days": 10, + "cache": 16, + "blocks": 8, + "precision": "ms", + "keep": 36500, + "minRows": 100, + "maxRows": 4096, + "comp":2, + "walLevel":1, + "cachelast":0, + "quorum":1, + "fsync":3000, + "update": 0 + }, + "super_tables": [{ + "name": "stb", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb_", + "escape_character": "yes", + "auto_create_table": "no", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "sml", + "line_protocol": "line", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 0, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "2020-10-01 00:00:00.000", + "sample_file": "./sample.csv", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 29, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 23, "count":1}], + "tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}] + }] + }] +} diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/json/sml_interlace.json b/tests/develop-test/5-taos-tools/taosbenchmark/json/sml_interlace.json new file mode 100644 index 0000000000000000000000000000000000000000..5b55ceb4a1fe8f57ae26f74ed78a86e6bdc9a333 --- /dev/null +++ b/tests/develop-test/5-taos-tools/taosbenchmark/json/sml_interlace.json @@ -0,0 +1,87 @@ +{ + "filetype": "insert", + "cfgdir": "/etc/taos", + "host": "127.0.0.1", + "port": 6030, + "user": "root", + "password": "taosdata", + "thread_count": 4, + "thread_pool_size": 20, + "result_file": "./insert_res.txt", + "confirm_parameter_prompt": "no", + "prepared_rand": 10, + "chinese": "no", + "insert_interval": 0, + "num_of_records_per_req": 10, + "databases": [{ + "dbinfo": { + "name": "db", + "drop": "yes", + "replica": 1, + "days": 10, + "cache": 16, + "blocks": 8, + "precision": "ms", + "keep": 36500, + "minRows": 100, + "maxRows": 4096, + "comp":2, + "walLevel":1, + "cachelast":0, + "quorum":1, + "fsync":3000, + "update": 0 + }, + "super_tables": [{ + "name": "stb1", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb1_", + "escape_character": "no", + "auto_create_table": "no", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "sml", + "line_protocol": "telnet", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 5, + "disorder_ratio": 30, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "now", + "sample_file": "", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "INT"}], + "tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}] + },{ + "name": "stb2", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb2_", + "escape_character": "no", + "auto_create_table": "no", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "sml", + "line_protocol": "json", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 5, + "disorder_ratio": 60, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "now", + "sample_file": "", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "INT"}], + "tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "BINARY", "len": 19, "count":1}] + }] + }] +} diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/json/specified_subscribe.json b/tests/develop-test/5-taos-tools/taosbenchmark/json/specified_subscribe.json new file mode 100644 index 0000000000000000000000000000000000000000..61a7961e73506d9aeda07a46f00d7b8c3317d8f0 --- /dev/null +++ b/tests/develop-test/5-taos-tools/taosbenchmark/json/specified_subscribe.json @@ -0,0 +1,24 @@ +{ + "filetype": "subscribe", + "cfgdir": "/etc/taos", + "host": "127.0.0.1", + "port": 6030, + "user": "root", + "password": "taosdata", + "databases": "db", + "confirm_parameter_prompt": "no", + "specified_table_query": { + "concurrent": 1, + "mode": "async", + "interval": 1000, + "restart": "no", + "keepProgress": "yes", + "resubAfterConsume": 10, + "endAfterConsume": 1, + "sqls": [ + { + "sql": "select * from stb;" + } + ] + } +} \ No newline at end of file diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/json/stmt_auto_create_table.json b/tests/develop-test/5-taos-tools/taosbenchmark/json/stmt_auto_create_table.json new file mode 100644 index 0000000000000000000000000000000000000000..ebe5e3f043eac127acd4069a3088e5b49a782824 --- /dev/null +++ b/tests/develop-test/5-taos-tools/taosbenchmark/json/stmt_auto_create_table.json @@ -0,0 +1,87 @@ +{ + "filetype": "insert", + "cfgdir": "/etc/taos", + "host": "127.0.0.1", + "port": 6030, + "user": "root", + "password": "taosdata", + "thread_count": 4, + "thread_pool_size": 20, + "result_file": "./insert_res.txt", + "confirm_parameter_prompt": "no", + "prepared_rand": 100, + "chinese": "no", + "insert_interval": 0, + "num_of_records_per_req": 10, + "databases": [{ + "dbinfo": { + "name": "db", + "drop": "yes", + "replica": 1, + "days": 10, + "cache": 16, + "blocks": 8, + "precision": "us", + "keep": 36500, + "minRows": 100, + "maxRows": 4096, + "comp":2, + "walLevel":1, + "cachelast":0, + "quorum":1, + "fsync":3000, + "update": 0 + }, + "super_tables": [{ + "name": "stb2", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb_", + "escape_character": "yes", + "auto_create_table": "yes", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "stmt", + "line_protocol": "line", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 0, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "now", + "sample_file": "./sample.csv", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 29, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 23, "count":1}], + "tags": [{"type": "TIMESTAMP"},{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}] + },{ + "name": "stb2-2", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb2-2_", + "escape_character": "yes", + "auto_create_table": "yes", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "stmt", + "line_protocol": "line", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 5, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "2020-10-01 00:00:00.000", + "sample_file": "./sample.csv", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 29, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 23, "count":1}], + "tags": [{"type": "TIMESTAMP"},{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}] + }] + }] +} \ No newline at end of file diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/json/stmt_insert_alltypes.json b/tests/develop-test/5-taos-tools/taosbenchmark/json/stmt_insert_alltypes.json new file mode 100644 index 0000000000000000000000000000000000000000..806142bf2a24f0e868ab768db9313c3762e62a34 --- /dev/null +++ b/tests/develop-test/5-taos-tools/taosbenchmark/json/stmt_insert_alltypes.json @@ -0,0 +1,62 @@ +{ + "filetype": "insert", + "cfgdir": "/etc/taos", + "host": "127.0.0.1", + "port": 6030, + "user": "root", + "password": "taosdata", + "thread_count": 4, + "thread_pool_size": 20, + "result_file": "./insert_res.txt", + "confirm_parameter_prompt": "no", + "prepared_rand": 10, + "chinese": "no", + "insert_interval": 0, + "num_of_records_per_req": 10, + "databases": [{ + "dbinfo": { + "name": "db", + "drop": "yes", + "replica": 1, + "days": 10, + "cache": 16, + "blocks": 8, + "precision": "ms", + "keep": 36500, + "minRows": 100, + "maxRows": 4096, + "comp":2, + "walLevel":1, + "cachelast":0, + "quorum":1, + "fsync":3000, + "update": 0 + }, + "super_tables": [{ + "name": "stb", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb_", + "escape_character": "yes", + "auto_create_table": "no", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "stmt", + "line_protocol": "line", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 0, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "2020-10-01 00:00:00.000", + "sample_file": "./sample.csv", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "TIMESTAMP"},{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 29, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 23, "count":1}], + "tags": [{"type": "TIMESTAMP"},{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}] + }] + }] +} diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/json/taosc_auto_create_table.json b/tests/develop-test/5-taos-tools/taosbenchmark/json/taosc_auto_create_table.json new file mode 100644 index 0000000000000000000000000000000000000000..fea72a34fb74c52f06e7549008333d33ce537d08 --- /dev/null +++ b/tests/develop-test/5-taos-tools/taosbenchmark/json/taosc_auto_create_table.json @@ -0,0 +1,87 @@ +{ + "filetype": "insert", + "cfgdir": "/etc/taos", + "host": "127.0.0.1", + "port": 6030, + "user": "root", + "password": "taosdata", + "thread_count": 4, + "thread_pool_size": 20, + "result_file": "./insert_res.txt", + "confirm_parameter_prompt": "no", + "prepared_rand": 100, + "chinese": "no", + "insert_interval": 0, + "num_of_records_per_req": 10, + "databases": [{ + "dbinfo": { + "name": "db", + "drop": "yes", + "replica": 1, + "days": 10, + "cache": 16, + "blocks": 8, + "precision": "ms", + "keep": 36500, + "minRows": 100, + "maxRows": 4096, + "comp":2, + "walLevel":1, + "cachelast":0, + "quorum":1, + "fsync":3000, + "update": 0 + }, + "super_tables": [{ + "name": "stb1", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb_", + "escape_character": "yes", + "auto_create_table": "yes", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "taosc", + "line_protocol": "line", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 0, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "2020-10-01 00:00:00.000", + "sample_file": "./sample.csv", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 29, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 23, "count":1}], + "tags": [{"type": "TIMESTAMP"},{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}] + },{ + "name": "stb1-2", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb1-2_", + "escape_character": "yes", + "auto_create_table": "yes", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "taosc", + "line_protocol": "line", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 5, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "2020-10-01 00:00:00.000", + "sample_file": "./sample.csv", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 29, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 23, "count":1}], + "tags": [{"type": "TIMESTAMP"},{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}] + }] + }] +} diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/json/taosc_insert_alltypes.json b/tests/develop-test/5-taos-tools/taosbenchmark/json/taosc_insert_alltypes.json new file mode 100644 index 0000000000000000000000000000000000000000..698fb599f595fbbc4a1fd130696e41059362ca50 --- /dev/null +++ b/tests/develop-test/5-taos-tools/taosbenchmark/json/taosc_insert_alltypes.json @@ -0,0 +1,62 @@ +{ + "filetype": "insert", + "cfgdir": "/etc/taos", + "host": "127.0.0.1", + "port": 6030, + "user": "root", + "password": "taosdata", + "thread_count": 4, + "thread_pool_size": 20, + "result_file": "./insert_res.txt", + "confirm_parameter_prompt": "no", + "prepared_rand": 10, + "chinese": "no", + "insert_interval": 0, + "num_of_records_per_req": 10, + "databases": [{ + "dbinfo": { + "name": "db", + "drop": "yes", + "replica": 1, + "days": 10, + "cache": 16, + "blocks": 8, + "precision": "ms", + "keep": 36500, + "minRows": 100, + "maxRows": 4096, + "comp":2, + "walLevel":1, + "cachelast":0, + "quorum":1, + "fsync":3000, + "update": 1 + }, + "super_tables": [{ + "name": "stb", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb_", + "escape_character": "yes", + "auto_create_table": "no", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "taosc", + "line_protocol": "line", + "childtable_limit": -10, + "childtable_offset": 10, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 0, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "2020-10-01 00:00:00.000", + "sample_file": "./sample.csv", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "TIMESTAMP"},{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 29, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 23, "count":1}], + "tags": [{"type": "TIMESTAMP"},{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}] + }] + }] +} diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/json/taosc_json_tag.json b/tests/develop-test/5-taos-tools/taosbenchmark/json/taosc_json_tag.json new file mode 100644 index 0000000000000000000000000000000000000000..71fed3c48cf13123890f4212baa4c074b8b6df74 --- /dev/null +++ b/tests/develop-test/5-taos-tools/taosbenchmark/json/taosc_json_tag.json @@ -0,0 +1,62 @@ +{ + "filetype": "insert", + "cfgdir": "/etc/taos", + "host": "127.0.0.1", + "port": 6030, + "user": "root", + "password": "taosdata", + "thread_count": 4, + "thread_pool_size": 20, + "result_file": "./insert_res.txt", + "confirm_parameter_prompt": "no", + "prepared_rand": 10, + "chinese": "no", + "insert_interval": 0, + "num_of_records_per_req": 10, + "databases": [{ + "dbinfo": { + "name": "db", + "drop": "yes", + "replica": 1, + "days": 10, + "cache": 16, + "blocks": 8, + "precision": "ms", + "keep": 36500, + "minRows": 100, + "maxRows": 4096, + "comp":2, + "walLevel":1, + "cachelast":0, + "quorum":1, + "fsync":3000, + "update": 1 + }, + "super_tables": [{ + "name": "stb", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb_", + "escape_character": "yes", + "auto_create_table": "no", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "taosc", + "line_protocol": "line", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 0, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "2020-10-01 00:00:00.000", + "sample_file": "./sample.csv", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "INT"}], + "tags": [{"type": "JSON", "len": 8, "count": 5}] + }] + }] +} diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/json/taosc_limit_offset.json b/tests/develop-test/5-taos-tools/taosbenchmark/json/taosc_limit_offset.json new file mode 100644 index 0000000000000000000000000000000000000000..c78317aade33cd3fea4a400511dee5b1431bc473 --- /dev/null +++ b/tests/develop-test/5-taos-tools/taosbenchmark/json/taosc_limit_offset.json @@ -0,0 +1,62 @@ +{ + "filetype": "insert", + "cfgdir": "/etc/taos", + "host": "127.0.0.1", + "port": 6030, + "user": "root", + "password": "taosdata", + "thread_count": 4, + "thread_pool_size": 20, + "result_file": "./insert_res.txt", + "confirm_parameter_prompt": "no", + "prepared_rand": 10, + "chinese": "no", + "insert_interval": 0, + "num_of_records_per_req": 10, + "databases": [{ + "dbinfo": { + "name": "db", + "drop": "no", + "replica": 1, + "days": 10, + "cache": 16, + "blocks": 8, + "precision": "ms", + "keep": 36500, + "minRows": 100, + "maxRows": 4096, + "comp":2, + "walLevel":1, + "cachelast":0, + "quorum":1, + "fsync":3000, + "update": 0 + }, + "super_tables": [{ + "name": "stb", + "child_table_exists":"yes", + "childtable_count": 8, + "childtable_prefix": "stb_", + "escape_character": "no", + "auto_create_table": "no", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "taosc", + "line_protocol": "line", + "childtable_limit": 2, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 0, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "2020-10-01 00:00:00.000", + "sample_file": "./sample.csv", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "TIMESTAMP"},{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 29, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 23, "count":1}], + "tags": [{"type": "TIMESTAMP"},{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}] + }] + }] +} diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/json/taosc_only_create_table.json b/tests/develop-test/5-taos-tools/taosbenchmark/json/taosc_only_create_table.json new file mode 100644 index 0000000000000000000000000000000000000000..46672bcc4c54082fbb2aedb73ac649976c73013f --- /dev/null +++ b/tests/develop-test/5-taos-tools/taosbenchmark/json/taosc_only_create_table.json @@ -0,0 +1,62 @@ +{ + "filetype": "insert", + "cfgdir": "/etc/taos", + "host": "127.0.0.1", + "port": 6030, + "user": "root", + "password": "taosdata", + "thread_count": 4, + "thread_pool_size": 20, + "result_file": "./insert_res.txt", + "confirm_parameter_prompt": "no", + "prepared_rand": 10, + "chinese": "no", + "insert_interval": 0, + "num_of_records_per_req": 10, + "databases": [{ + "dbinfo": { + "name": "db", + "drop": "yes", + "replica": 1, + "days": 10, + "cache": 16, + "blocks": 8, + "precision": "ms", + "keep": 36500, + "minRows": 100, + "maxRows": 4096, + "comp":2, + "walLevel":1, + "cachelast":1, + "quorum":1, + "fsync":3000, + "update": 0 + }, + "super_tables": [{ + "name": "stb", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb_", + "escape_character": "yes", + "auto_create_table": "no", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "taosc", + "line_protocol": "line", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 0, + "insert_interval": 0, + "interlace_rows": 0, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "2020-10-01 00:00:00.000", + "sample_file": "./sample.csv", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "TIMESTAMP"},{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR"}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY"}], + "tags": [{"type": "TIMESTAMP"},{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR"}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY"}] + }] + }] +} \ No newline at end of file diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/json/taosc_query.json b/tests/develop-test/5-taos-tools/taosbenchmark/json/taosc_query.json new file mode 100644 index 0000000000000000000000000000000000000000..e30a24be42aacd5f710a9bfe0aa6ce83ba9cd03a --- /dev/null +++ b/tests/develop-test/5-taos-tools/taosbenchmark/json/taosc_query.json @@ -0,0 +1,32 @@ +{ + "filetype":"query", + "cfgdir": "/etc/taos", + "host": "localhost", + "port": 6030, + "user": "root", + "password": "taosdata", + "confirm_parameter_prompt": "no", + "databases": "db", + "query_times": 1, + "specified_table_query": + { + "query_interval": 1, + "concurrent":1, + "sqls": + [{ + "sql": "select count(*) from db.stb", + "result": "taosc_query_specified" + }] + }, + "super_table_query": { + "stblname": "stb", + "query_interval": 1, + "threads": 1, + "sqls": [ + { + "sql": "select count(*) from xxxx", + "result": "taosc_query_super" + } + ] + } +} \ No newline at end of file diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/json/taosc_sample_use_ts.json b/tests/develop-test/5-taos-tools/taosbenchmark/json/taosc_sample_use_ts.json new file mode 100644 index 0000000000000000000000000000000000000000..8ac8aab93e2e948cdf9b92bd548ad8299470e57f --- /dev/null +++ b/tests/develop-test/5-taos-tools/taosbenchmark/json/taosc_sample_use_ts.json @@ -0,0 +1,62 @@ +{ + "filetype": "insert", + "cfgdir": "/etc/taos", + "host": "127.0.0.1", + "port": 6030, + "user": "root", + "password": "taosdata", + "thread_count": 4, + "thread_pool_size": 20, + "result_file": "./insert_res.txt", + "confirm_parameter_prompt": "no", + "prepared_rand": 10, + "chinese": "yes", + "insert_interval": 0, + "num_of_records_per_req": 10, + "databases": [{ + "dbinfo": { + "name": "db", + "drop": "yes", + "replica": 1, + "days": 10, + "cache": 16, + "blocks": 8, + "precision": "ms", + "keep": 36500, + "minRows": 100, + "maxRows": 4096, + "comp":2, + "walLevel":1, + "cachelast":0, + "quorum":1, + "fsync":3000, + "update": 0 + }, + "super_tables": [{ + "name": "stb", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb_", + "escape_character": "no", + "auto_create_table": "no", + "batch_create_tbl_num": 10, + "data_source": "sample", + "insert_mode": "taosc", + "line_protocol": "line", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 0, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "now", + "sample_file": "./5-taos-tools/taosbenchmark/csv/sample_use_ts.csv", + "use_sample_ts": "yes", + "tags_file": "./5-taos-tools/taosbenchmark/csv/sample_tags.csv", + "columns": [{"type": "INT"}], + "tags": [{"type": "INT"}] + }] + }] +} diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/json/telnet_alltypes.json b/tests/develop-test/5-taos-tools/taosbenchmark/json/telnet_alltypes.json new file mode 100644 index 0000000000000000000000000000000000000000..40f58d4f7ef75f0cb5c30abd45c8ec86409763da --- /dev/null +++ b/tests/develop-test/5-taos-tools/taosbenchmark/json/telnet_alltypes.json @@ -0,0 +1,362 @@ +{ + "filetype": "insert", + "cfgdir": "/etc/taos", + "host": "127.0.0.1", + "port": 6030, + "user": "root", + "password": "taosdata", + "thread_count": 4, + "thread_pool_size": 20, + "result_file": "./insert_res.txt", + "confirm_parameter_prompt": "no", + "prepared_rand": 10, + "chinese": "no", + "insert_interval": 0, + "num_of_records_per_req": 10, + "databases": [{ + "dbinfo": { + "name": "db", + "drop": "yes", + "replica": 1, + "days": 10, + "cache": 16, + "blocks": 8, + "precision": "ms", + "keep": 36500, + "minRows": 100, + "maxRows": 4096, + "comp":2, + "walLevel":1, + "cachelast":0, + "quorum":1, + "fsync":3000, + "update": 0 + }, + "super_tables": [{ + "name": "stb1", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb1_", + "escape_character": "no", + "auto_create_table": "no", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "sml", + "line_protocol": "telnet", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 0, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "now", + "sample_file": "", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "BOOL"}], + "tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}] + },{ + "name": "stb2", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb2_", + "escape_character": "no", + "auto_create_table": "no", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "sml", + "line_protocol": "telnet", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 0, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "now", + "sample_file": "", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "TINYINT"}], + "tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}] + },{ + "name": "stb3", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb3_", + "escape_character": "no", + "auto_create_table": "no", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "sml", + "line_protocol": "telnet", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 0, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "now", + "sample_file": "", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "UTINYINT"}], + "tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}] + },{ + "name": "stb4", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb4_", + "escape_character": "no", + "auto_create_table": "no", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "sml", + "line_protocol": "telnet", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 0, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "now", + "sample_file": "", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "SMALLINT"}], + "tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}] + },{ + "name": "stb5", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb5_", + "escape_character": "no", + "auto_create_table": "no", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "sml", + "line_protocol": "telnet", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 0, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "now", + "sample_file": "", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "USMALLINT"}], + "tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}] + },{ + "name": "stb6", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb6_", + "escape_character": "no", + "auto_create_table": "no", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "sml", + "line_protocol": "telnet", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 0, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "now", + "sample_file": "", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "INT"}], + "tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}] + },{ + "name": "stb7", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb7_", + "escape_character": "no", + "auto_create_table": "no", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "sml", + "line_protocol": "telnet", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 0, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "now", + "sample_file": "", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "UINT"}], + "tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}] + },{ + "name": "stb8", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb8_", + "escape_character": "no", + "auto_create_table": "no", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "sml", + "line_protocol": "telnet", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 0, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "now", + "sample_file": "", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "BIGINT"}], + "tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}] + },{ + "name": "stb9", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb9_", + "escape_character": "no", + "auto_create_table": "no", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "sml", + "line_protocol": "telnet", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 0, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "now", + "sample_file": "", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "UBIGINT"}], + "tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}] + },{ + "name": "stb10", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb10_", + "escape_character": "no", + "auto_create_table": "no", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "sml", + "line_protocol": "telnet", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 0, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "now", + "sample_file": "", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "FLOAT"}], + "tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}] + },{ + "name": "stb11", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb11_", + "escape_character": "no", + "auto_create_table": "no", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "sml", + "line_protocol": "telnet", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 0, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "now", + "sample_file": "", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "DOUBLE"}], + "tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}] + },{ + "name": "stb12", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb12_", + "escape_character": "no", + "auto_create_table": "no", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "sml", + "line_protocol": "telnet", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 0, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "now", + "sample_file": "", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "BINARY", "len": 8}], + "tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}] + },{ + "name": "stb13", + "child_table_exists":"no", + "childtable_count": 8, + "childtable_prefix": "stb13_", + "escape_character": "no", + "auto_create_table": "no", + "batch_create_tbl_num": 10, + "data_source": "rand", + "insert_mode": "sml", + "line_protocol": "telnet", + "childtable_limit": 0, + "childtable_offset": 0, + "insert_rows": 20, + "insert_interval": 0, + "interlace_rows": 0, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1, + "start_timestamp": "now", + "sample_file": "", + "use_sample_ts": "no", + "tags_file": "", + "columns": [{"type": "NCHAR", "len": 8}], + "tags": [{"type": "INT"}, {"type": "BIGINT"}, {"type": "FLOAT"}, {"type": "DOUBLE"}, {"type": "SMALLINT"}, {"type": "TINYINT"}, {"type": "BOOL"}, {"type": "NCHAR","len": 17, "count":1}, {"type": "UINT"}, {"type": "UBIGINT"}, {"type": "UTINYINT"}, {"type": "USMALLINT"}, {"type": "BINARY", "len": 19, "count":1}] + }] + }] +} diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/json_tag.py b/tests/develop-test/5-taos-tools/taosbenchmark/json_tag.py new file mode 100644 index 0000000000000000000000000000000000000000..5b71f3a065de1708a6dbdf570f77d18db80f3e26 --- /dev/null +++ b/tests/develop-test/5-taos-tools/taosbenchmark/json_tag.py @@ -0,0 +1,49 @@ +################################################################### +# 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 os +from util.log import * +from util.cases import * +from util.sql import * +from util.dnodes import * + + +class TDTestCase: + def caseDescription(self): + ''' + [TD-11510] taosBenchmark test cases + ''' + return + + def init(self, conn, logSql): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), logSql) + + def run(self): + cmd = "taosBenchmark -f ./5-taos-tools/taosbenchmark/json/taosc_json_tag.json" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.execute("reset query cache") + tdSql.query("describe db.stb") + tdSql.checkData(2, 0, "jtag") + tdSql.checkData(2, 1, "JSON") + tdSql.checkData(2, 3, "TAG") + tdSql.query("select count(jtag) from db.stb") + tdSql.checkData(0, 0, 8) + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) \ No newline at end of file diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/limit_offset_json.py b/tests/develop-test/5-taos-tools/taosbenchmark/limit_offset_json.py new file mode 100644 index 0000000000000000000000000000000000000000..20e64fa7458fecb87771bd98eec59a886e3663b3 --- /dev/null +++ b/tests/develop-test/5-taos-tools/taosbenchmark/limit_offset_json.py @@ -0,0 +1,66 @@ +################################################################### +# 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 os +from util.log import * +from util.cases import * +from util.sql import * +from util.dnodes import * + + +class TDTestCase: + def caseDescription(self): + ''' + [TD-11510] taosBenchmark test cases + ''' + return + + def init(self, conn, logSql): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), logSql) + + def run(self): + cmd = "taosBenchmark -f ./5-taos-tools/taosbenchmark/json/taosc_only_create_table.json" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.execute("reset query cache") + tdSql.query("select count(tbname) from db.stb") + tdSql.checkData(0, 0, 8) + tdSql.query("select count(*) from db.stb") + tdSql.checkRows(0) + tdSql.query("describe db.stb") + tdSql.checkData(9, 1, "NCHAR") + tdSql.checkData(14, 1, "BINARY") + tdSql.checkData(23, 1, "NCHAR") + tdSql.checkData(28, 1, "BINARY") + tdSql.checkData(9, 2, 64) + tdSql.checkData(14, 2, 64) + tdSql.checkData(23, 2, 64) + tdSql.checkData(28, 2, 64) + + + cmd = "taosBenchmark -f ./5-taos-tools/taosbenchmark/json/taosc_limit_offset.json" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.execute("reset query cache") + tdSql.query("select count(tbname) from db.stb") + tdSql.checkData(0, 0, 8) + tdSql.query("select count(*) from db.stb") + tdSql.checkData(0, 0, 40) + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) \ No newline at end of file diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/query_json.py b/tests/develop-test/5-taos-tools/taosbenchmark/query_json.py new file mode 100644 index 0000000000000000000000000000000000000000..274729fada8f759535ad72979c9d5710390cc67f --- /dev/null +++ b/tests/develop-test/5-taos-tools/taosbenchmark/query_json.py @@ -0,0 +1,100 @@ +################################################################### +# 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 ast +import os +import re +import subprocess + +from util.log import * +from util.cases import * +from util.sql import * +from util.dnodes import * + + +class TDTestCase: + def caseDescription(self): + ''' + [TD-11510] taosBenchmark test cases + ''' + return + + def init(self, conn, logSql): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), logSql) + + def run(self): + os.system("rm -f rest_query_specified-0 rest_query_super-0 taosc_query_specified-0 taosc_query_super-0") + tdSql.execute("drop database if exists db") + tdSql.execute("create database if not exists db") + tdSql.execute("use db") + tdSql.execute("create table stb (ts timestamp, c0 int) tags (t0 int)") + tdSql.execute("insert into stb_0 using stb tags (0) values (now, 0)") + tdSql.execute("insert into stb_1 using stb tags (1) values (now, 1)") + tdSql.execute("insert into stb_2 using stb tags (2) values (now, 2)") + cmd = "taosBenchmark -f ./5-taos-tools/taosbenchmark/json/taosc_query.json" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + with open("%s" % "taosc_query_specified-0", 'r+') as f1: + for line in f1.readlines(): + queryTaosc = line.strip().split()[0] + assert queryTaosc == '3' , "result is %s != expect: 3" % queryTaosc + + with open("%s" % "taosc_query_super-0", 'r+') as f1: + for line in f1.readlines(): + queryTaosc = line.strip().split()[0] + assert queryTaosc == '1', "result is %s != expect: 1" % queryTaosc + + cmd = "taosBenchmark -f ./5-taos-tools/taosbenchmark/json/rest_query.json" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + + times = 0 + with open("rest_query_super-0", 'r+') as f1: + + for line in f1.readlines(): + contents = line.strip() + if contents.find("data") != -1: + pattern = re.compile("{.*}") + contents = pattern.search(contents).group() + contentsDict = ast.literal_eval(contents) + queryResultRest = contentsDict['data'][0][0] + assert queryResultRest == 1, "result is %s != expect: 1" % queryResultRest + times += 1 + + assert times == 3, "result is %s != expect: 3" % times + + + times = 0 + with open("rest_query_specified-0", 'r+') as f1: + for line in f1.readlines(): + contents = line.strip() + if contents.find("data") != -1: + pattern = re.compile("{.*}") + contents = pattern.search(contents).group() + contentsDict = ast.literal_eval(contents) + queryResultRest = contentsDict['data'][0][0] + assert queryResultRest == 3, "result is %s != expect: 3" % queryResultRest + times += 1 + + assert times == 1, "result is %s != expect: 1" % times + + + + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) \ No newline at end of file diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/sample_csv_json.py b/tests/develop-test/5-taos-tools/taosbenchmark/sample_csv_json.py new file mode 100644 index 0000000000000000000000000000000000000000..5be777497930f14fa5d34bda3f54a8722f0e7dbc --- /dev/null +++ b/tests/develop-test/5-taos-tools/taosbenchmark/sample_csv_json.py @@ -0,0 +1,55 @@ +################################################################### +# 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 os +from util.log import * +from util.cases import * +from util.sql import * +from util.dnodes import * + + +class TDTestCase: + def caseDescription(self): + ''' + [TD-11510] taosBenchmark test cases + ''' + return + + def init(self, conn, logSql): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), logSql) + + def run(self): + cmd = "taosBenchmark -f ./5-taos-tools/taosbenchmark/json/taosc_sample_use_ts.json" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.execute("reset query cache") + tdSql.query("select count(tbname) from db.stb") + tdSql.checkData(0, 0, 8) + tdSql.query("select count(*) from db.stb") + tdSql.checkData(0, 0, 24) + tdSql.query("select * from db.stb_0") + tdSql.checkRows(3) + tdSql.checkData(0, 1, 1) + tdSql.checkData(1, 1, 2) + tdSql.checkData(2, 1, 3) + tdSql.query("select distinct(t0) from db.stb") + tdSql.checkRows(1) + tdSql.checkData(0, 0, 17) + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) \ No newline at end of file diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/sml_interlace.py b/tests/develop-test/5-taos-tools/taosbenchmark/sml_interlace.py new file mode 100644 index 0000000000000000000000000000000000000000..f704d684fbb7a3d1f9778bccfac0a95ddbc34e4b --- /dev/null +++ b/tests/develop-test/5-taos-tools/taosbenchmark/sml_interlace.py @@ -0,0 +1,51 @@ +################################################################### +# 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 os +from util.log import * +from util.cases import * +from util.sql import * +from util.dnodes import * + + +class TDTestCase: + def caseDescription(self): + ''' + [TD-11510] taosBenchmark test cases + ''' + return + + def init(self, conn, logSql): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), logSql) + + def run(self): + cmd = "taosBenchmark -f ./5-taos-tools/taosbenchmark/json/sml_interlace.json" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.execute("reset query cache") + tdSql.query("select count(tbname) from db.stb1") + tdSql.checkData(0, 0, 8) + tdSql.query("select count(tbname) from db.stb2") + tdSql.checkData(0, 0, 8) + tdSql.query("select count(*) from db.stb1") + tdSql.checkData(0, 0, 160) + tdSql.query("select count(*) from db.stb2") + tdSql.checkData(0, 0, 160) + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) \ No newline at end of file diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/sml_json_alltypes.py b/tests/develop-test/5-taos-tools/taosbenchmark/sml_json_alltypes.py new file mode 100644 index 0000000000000000000000000000000000000000..dc18bda7ecbfbc2207d5919bc663d1bd82c7ae3e --- /dev/null +++ b/tests/develop-test/5-taos-tools/taosbenchmark/sml_json_alltypes.py @@ -0,0 +1,81 @@ +################################################################### +# 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 os +from util.log import * +from util.cases import * +from util.sql import * +from util.dnodes import * + + +class TDTestCase: + def caseDescription(self): + ''' + [TD-11510] taosBenchmark test cases + ''' + return + + def init(self, conn, logSql): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), logSql) + + def run(self): + cmd = "taosBenchmark -f ./5-taos-tools/taosbenchmark/json/json_alltypes.json" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.execute("reset query cache") + tdSql.query("describe db.stb1") + tdSql.checkData(1, 1, "BOOL") + tdSql.query("describe db.stb2") + tdSql.checkData(1, 1, "TINYINT") + tdSql.query("describe db.stb3") + tdSql.checkData(1, 1, "SMALLINT") + tdSql.query("describe db.stb4") + tdSql.checkData(1, 1, "INT") + tdSql.query("describe db.stb5") + tdSql.checkData(1, 1, "BIGINT") + tdSql.query("describe db.stb6") + tdSql.checkData(1, 1, "FLOAT") + tdSql.query("describe db.stb7") + tdSql.checkData(1, 1, "DOUBLE") + tdSql.query("describe db.stb8") + tdSql.checkData(1, 1, "BINARY") + tdSql.checkData(1, 2, 8) + tdSql.query("describe db.stb9") + tdSql.checkData(1, 1, "NCHAR") + tdSql.checkData(1, 2, 8) + tdSql.query("select count(*) from db.stb1") + tdSql.checkData(0, 0, 160) + tdSql.query("select count(*) from db.stb2") + tdSql.checkData(0, 0, 160) + tdSql.query("select count(*) from db.stb3") + tdSql.checkData(0, 0, 160) + tdSql.query("select count(*) from db.stb4") + tdSql.checkData(0, 0, 160) + tdSql.query("select count(*) from db.stb5") + tdSql.checkData(0, 0, 160) + tdSql.query("select count(*) from db.stb6") + tdSql.checkData(0, 0, 160) + tdSql.query("select count(*) from db.stb7") + tdSql.checkData(0, 0, 160) + tdSql.query("select count(*) from db.stb8") + tdSql.checkData(0, 0, 160) + tdSql.query("select count(*) from db.stb9") + tdSql.checkData(0, 0, 160) + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) \ No newline at end of file diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/sml_telnet_alltypes.py b/tests/develop-test/5-taos-tools/taosbenchmark/sml_telnet_alltypes.py new file mode 100644 index 0000000000000000000000000000000000000000..9285de99848acdd1674f6242d0865189d2e17920 --- /dev/null +++ b/tests/develop-test/5-taos-tools/taosbenchmark/sml_telnet_alltypes.py @@ -0,0 +1,97 @@ +################################################################### +# 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 os +from util.log import * +from util.cases import * +from util.sql import * +from util.dnodes import * + + +class TDTestCase: + def caseDescription(self): + ''' + [TD-11510] taosBenchmark test cases + ''' + return + + def init(self, conn, logSql): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), logSql) + + def run(self): + cmd = "taosBenchmark -f ./5-taos-tools/taosbenchmark/json/telnet_alltypes.json" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.execute("reset query cache") + tdSql.query("describe db.stb1") + tdSql.checkData(1, 1, "BOOL") + tdSql.query("describe db.stb2") + tdSql.checkData(1, 1, "TINYINT") + tdSql.query("describe db.stb3") + tdSql.checkData(1, 1, "TINYINT UNSIGNED") + tdSql.query("describe db.stb4") + tdSql.checkData(1, 1, "SMALLINT") + tdSql.query("describe db.stb5") + tdSql.checkData(1, 1, "SMALLINT UNSIGNED") + tdSql.query("describe db.stb6") + tdSql.checkData(1, 1, "INT") + tdSql.query("describe db.stb7") + tdSql.checkData(1, 1, "INT UNSIGNED") + tdSql.query("describe db.stb8") + tdSql.checkData(1, 1, "BIGINT") + tdSql.query("describe db.stb9") + tdSql.checkData(1, 1, "BIGINT UNSIGNED") + tdSql.query("describe db.stb10") + tdSql.checkData(1, 1, "FLOAT") + tdSql.query("describe db.stb11") + tdSql.checkData(1, 1, "DOUBLE") + tdSql.query("describe db.stb12") + tdSql.checkData(1, 1, "BINARY") + tdSql.checkData(1, 2, 8) + tdSql.query("describe db.stb13") + tdSql.checkData(1, 1, "NCHAR") + tdSql.checkData(1, 2, 8) + tdSql.query("select count(*) from db.stb1") + tdSql.checkData(0, 0, 160) + tdSql.query("select count(*) from db.stb2") + tdSql.checkData(0, 0, 160) + tdSql.query("select count(*) from db.stb3") + tdSql.checkData(0, 0, 160) + tdSql.query("select count(*) from db.stb4") + tdSql.checkData(0, 0, 160) + tdSql.query("select count(*) from db.stb5") + tdSql.checkData(0, 0, 160) + tdSql.query("select count(*) from db.stb6") + tdSql.checkData(0, 0, 160) + tdSql.query("select count(*) from db.stb7") + tdSql.checkData(0, 0, 160) + tdSql.query("select count(*) from db.stb8") + tdSql.checkData(0, 0, 160) + tdSql.query("select count(*) from db.stb9") + tdSql.checkData(0, 0, 160) + tdSql.query("select count(*) from db.stb10") + tdSql.checkData(0, 0, 160) + tdSql.query("select count(*) from db.stb11") + tdSql.checkData(0, 0, 160) + tdSql.query("select count(*) from db.stb12") + tdSql.checkData(0, 0, 160) + tdSql.query("select count(*) from db.stb13") + tdSql.checkData(0, 0, 160) + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) \ No newline at end of file diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/subscripe_json.py b/tests/develop-test/5-taos-tools/taosbenchmark/subscripe_json.py new file mode 100644 index 0000000000000000000000000000000000000000..726b4188e0824530cb78330f07a822e93e8ecc51 --- /dev/null +++ b/tests/develop-test/5-taos-tools/taosbenchmark/subscripe_json.py @@ -0,0 +1,50 @@ +################################################################### +# 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 os +from util.log import * +from util.cases import * +from util.sql import * +from util.dnodes import * + + +class TDTestCase: + def caseDescription(self): + ''' + [TD-11510] taosBenchmark test cases + ''' + return + + def init(self, conn, logSql): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), logSql) + + def run(self): + tdSql.execute("drop database if exists db") + tdSql.execute("create database if not exists db") + tdSql.execute("use db") + tdSql.execute("create table stb (ts timestamp, c0 int) tags (t0 int)") + tdSql.execute("insert into stb_0 using stb tags (0) values (now, 0)") + tdSql.execute("insert into stb_1 using stb tags (1) values (now, 1)") + tdSql.execute("insert into stb_2 using stb tags (2) values (now, 2)") + cmd = "taosBenchmark -f ./5-taos-tools/taosbenchmark/json/specified_subscribe.json -g" + tdLog.info("%s" % cmd) + os.system("%s" % cmd) + tdSql.execute("reset query cache") + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) \ No newline at end of file diff --git a/tests/develop-test/fulltest-tools.sh b/tests/develop-test/fulltest-tools.sh index 32df73c920fd27ec5f614cdda04718718bd5180f..ca02f1605c9ceb2443105561a897d8279109fede 100755 --- a/tests/develop-test/fulltest-tools.sh +++ b/tests/develop-test/fulltest-tools.sh @@ -10,3 +10,16 @@ python3 ./test.py -f 5-taos-tools/taosdump/taosdumpTestTypeUnsignedBigInt.py python3 ./test.py -f 5-taos-tools/taosdump/taosdumpTestTypeUnsignedInt.py python3 ./test.py -f 5-taos-tools/taosdump/taosdumpTestTypeUnsignedSmallInt.py python3 ./test.py -f 5-taos-tools/taosdump/taosdumpTestTypeUnsignedTinyInt.py +python3 ./test.py -f 5-taos-tools/taosbenchmark/limit_offset_json.py +python3 ./test.py -f 5-taos-tools/taosbenchmark/sml_json_alltypes.py +python3 ./test.py -f 5-taos-tools/taosbenchmark/auto_create_table_json.py +python3 ./test.py -f 5-taos-tools/taosbenchmark/commandline.py +python3 ./test.py -f 5-taos-tools/taosbenchmark/json_tag.py +python3 ./test.py -f 5-taos-tools/taosbenchmark/insert_alltypes_json.py +python3 ./test.py -f 5-taos-tools/taosbenchmark/query_json.py +python3 ./test.py -f 5-taos-tools/taosbenchmark/sml_interlace.py +python3 ./test.py -f 5-taos-tools/taosbenchmark/sml_telnet_alltypes.py +python3 ./test.py -f 5-taos-tools/taosbenchmark/subscripe_json.py +python3 ./test.py -f 5-taos-tools/taosbenchmark/default_json.py +python3 ./test.py -f 5-taos-tools/taosbenchmark/invalid_commandline.py +python3 ./test.py -f 5-taos-tools/taosbenchmark/sample_csv_json.py \ No newline at end of file diff --git a/tests/pytest/fulltest-tools.sh b/tests/pytest/fulltest-tools.sh index 7614effbe9c5fd6ad82955193f11dbda19984bff..55b6a4cb2be91c54c04aa31bb636f5596b720411 100755 --- a/tests/pytest/fulltest-tools.sh +++ b/tests/pytest/fulltest-tools.sh @@ -4,36 +4,36 @@ ulimit -c unlimited # tools python3 test.py -f tools/taosdumpTest.py python3 test.py -f tools/taosdumpTest2.py -python3 test.py -f tools/taosdemoTest.py -python3 test.py -f tools/taosdemoTestWithoutMetric.py -python3 test.py -f tools/taosdemoTestWithJson.py +#python3 test.py -f tools/taosdemoTest.py +#python3 test.py -f tools/taosdemoTestWithoutMetric.py +#python3 test.py -f tools/taosdemoTestWithJson.py #======================p1-end=============== #======================p2-start=============== -python3 test.py -f tools/taosdemoTestLimitOffset.py -python3 test.py -f tools/taosdemoTestTblAlt.py -python3 test.py -f tools/taosdemoTestSampleData.py -python3 test.py -f tools/taosdemoTestInterlace.py -python3 test.py -f tools/taosdemoTestQuery.py -python3 ./test.py -f tools/taosdemoTestdatatype.py +#python3 test.py -f tools/taosdemoTestLimitOffset.py +#python3 test.py -f tools/taosdemoTestTblAlt.py +#python3 test.py -f tools/taosdemoTestSampleData.py +#python3 test.py -f tools/taosdemoTestInterlace.py +#python3 test.py -f tools/taosdemoTestQuery.py +#python3 ./test.py -f tools/taosdemoTestdatatype.py #======================p2-end=============== #======================p3-start=============== # nano support -python3 test.py -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanoInsert.py -python3 test.py -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanoQuery.py -python3 test.py -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanosubscribe.py -python3 test.py -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestInsertTime_step.py +#python3 test.py -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanoInsert.py +#python3 test.py -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanoQuery.py +#python3 test.py -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanosubscribe.py +#python3 test.py -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestInsertTime_step.py python3 test.py -f tools/taosdumpTestNanoSupport.py -python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertWithJson.py +#python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertWithJson.py #======================p3-end=============== #======================p4-start=============== -python3 test.py -f tools/taosdemoAllTest/taosdemoTestQueryWithJson.py -python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertAllType.py -python3 test.py -f tools/taosdemoAllTest/TD-4985/query-limit-offset.py -python3 test.py -f tools/taosdemoAllTest/TD-5213/insert4096columns_not_use_taosdemo.py -python3 test.py -f tools/taosdemoAllTest/TD-5213/insertSigcolumnsNum4096.py -python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertWithJsonStmt.py -python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertWithJsonSml.py -python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertShell.py +#python3 test.py -f tools/taosdemoAllTest/taosdemoTestQueryWithJson.py +#python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertAllType.py +#python3 test.py -f tools/taosdemoAllTest/TD-4985/query-limit-offset.py +#python3 test.py -f tools/taosdemoAllTest/TD-5213/insert4096columns_not_use_taosdemo.py +#python3 test.py -f tools/taosdemoAllTest/TD-5213/insertSigcolumnsNum4096.py +#python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertWithJsonStmt.py +#python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertWithJsonSml.py +#python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertShell.py #======================p4-end=============== #======================p5-start=============== #======================p5-end=============== diff --git a/tests/pytest/tools/taosdemoAllTest/sml/insert-sml-telnet-alltype.json b/tests/pytest/tools/taosdemoAllTest/sml/insert-sml-telnet-alltype.json index a786e93696e8b13b39d45a9c4c8ef1aae829fef8..c9fa0f6fb0ddc777159b5d13f324c65b23cabd0d 100644 --- a/tests/pytest/tools/taosdemoAllTest/sml/insert-sml-telnet-alltype.json +++ b/tests/pytest/tools/taosdemoAllTest/sml/insert-sml-telnet-alltype.json @@ -107,7 +107,7 @@ "sample_format": "csv", "sample_file": "./sample.csv", "tags_file": "", - "columns": [{"type": "TINYINT", "count":6}], + "columns": [{"type": "TINYINT"}], "tags": [{"type": "TINYINT", "count":6}] }, { @@ -263,7 +263,7 @@ "sample_format": "csv", "sample_file": "./sample.csv", "tags_file": "", - "columns": [{"type": "NCHAR","len": 16, "count":6}], + "columns": [{"type": "NCHAR","len": 16}], "tags": [{"type": "NCHAR", "count":6}] }, { @@ -289,7 +289,7 @@ "sample_format": "csv", "sample_file": "./sample.csv", "tags_file": "", - "columns": [{"type": "BINARY", "len": 16, "count":6}], + "columns": [{"type": "BINARY", "len": 16}], "tags": [{"type": "BINARY", "count":6}] }, {