From cd1606802fb0a0248d1046416657dff59dbbfd4b Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Wed, 8 Jan 2025 18:52:03 +0800 Subject: [PATCH] feat:add test script --- .../system-test/7-tmq/taosx-performance.json | 69 +++++++++++++++++++ tests/system-test/7-tmq/taosx-performance.py | 36 ++++++++++ 2 files changed, 105 insertions(+) create mode 100644 tests/system-test/7-tmq/taosx-performance.json create mode 100644 tests/system-test/7-tmq/taosx-performance.py diff --git a/tests/system-test/7-tmq/taosx-performance.json b/tests/system-test/7-tmq/taosx-performance.json new file mode 100644 index 0000000000..568959645f --- /dev/null +++ b/tests/system-test/7-tmq/taosx-performance.json @@ -0,0 +1,69 @@ +{ + "filetype": "insert", + "cfgdir": "/etc/taos", + "host": "127.0.0.1", + "port": 6030, + "user": "root", + "password": "taosdata", + "connection_pool_size": 20, + "thread_bind_vgroup": "yes", + "thread_count": 20, + "create_table_thread_count": 16, + "result_file": "./insert_res.txt", + "confirm_parameter_prompt": "no", + "num_of_records_per_req": 10000, + "prepared_rand": 10000, + "chinese": "no", + "escape_character": "yes", + "continue_if_fail": "no", + "databases": [ + { + "dbinfo": { + "name": "test", + "drop": "yes", + "vgroups": 32, + "precision": "ms", + "WAL_RETENTION_PERIOD": 864000 + }, + "super_tables": [ + { + "name": "meters", + "child_table_exists": "no", + "childtable_count": 10000, + "childtable_prefix": "d", + "auto_create_table": "no", + "batch_create_tbl_num": 500, + "data_source": "rand", + "insert_mode": "stmt", + "non_stop_mode": "no", + "line_protocol": "line", + "insert_rows": 10000, + "childtable_limit": 0, + "childtable_offset": 0, + "interlace_rows": 1, + "insert_interval": 0, + "partial_col_num": 0, + "timestamp_step": 10, + "start_timestamp": "2020-10-01 00:00:00.000", + "sample_format": "csv", + "sample_file": "./sample.csv", + "use_sample_ts": "no", + "tags_file": "", + "columns": [ + {"type": "FLOAT", "name": "current", "count": 1, "max": 12, "min": 8 }, + { "type": "INT", "name": "voltage", "max": 225, "min": 215 }, + { "type": "FLOAT", "name": "phase", "max": 1, "min": 0 } + ], + "tags": [ + {"type": "TINYINT", "name": "groupid", "max": 10, "min": 1}, + {"type": "BINARY", "name": "location", "len": 16, + "values": ["San Francisco", "Los Angles", "San Diego", + "San Jose", "Palo Alto", "Campbell", "Mountain View", + "Sunnyvale", "Santa Clara", "Cupertino"] + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/system-test/7-tmq/taosx-performance.py b/tests/system-test/7-tmq/taosx-performance.py new file mode 100644 index 0000000000..324028a43f --- /dev/null +++ b/tests/system-test/7-tmq/taosx-performance.py @@ -0,0 +1,36 @@ +import taos +import sys +import time +import socket +import os +import threading + +sys.path.append("../../pytest") + +from util.log import * +from util.sql import * +from util.cases import * +from util.dnodes import * +from util.common import * +from taos.tmq import * +sys.path.append("./7-tmq") +from tmqCommon import * + +tdDnodes1 = TDDnodes() +tdDnodes2 = TDDnodes() + +if __name__ == "__main__": + tdDnodes1.stopAll() + updatecfgDict1 = {'debugFlag': 135, 'serverPort': 6030} + tdDnodes1.init("./dnode1") + tdDnodes1.deploy(1,updatecfgDict1) + tdDnodes1.start(1) + + updatecfgDict2 = {'debugFlag': 135, 'serverPort': 7030} + tdDnodes2.init("./dnode2") + tdDnodes2.deploy(1,updatecfgDict2) + tdDnodes2.start(1) + + os.system("taosBenchmark -f taosx-performance.json") + + tdLog.info("Procedures for tdengine deployed in")