diff --git a/tests/system-test/7-tmq/taosx-performance.json b/tests/system-test/7-tmq/taosx-performance.json index 568959645f..cbff630cbd 100644 --- a/tests/system-test/7-tmq/taosx-performance.json +++ b/tests/system-test/7-tmq/taosx-performance.json @@ -21,7 +21,7 @@ "dbinfo": { "name": "test", "drop": "yes", - "vgroups": 32, + "vgroups": 8, "precision": "ms", "WAL_RETENTION_PERIOD": 864000 }, @@ -66,4 +66,4 @@ ] } ] -} \ 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 old mode 100644 new mode 100755 index 324028a43f..63cfc01031 --- a/tests/system-test/7-tmq/taosx-performance.py +++ b/tests/system-test/7-tmq/taosx-performance.py @@ -20,17 +20,44 @@ tdDnodes1 = TDDnodes() tdDnodes2 = TDDnodes() if __name__ == "__main__": + args = sys.argv[1:] + + insertData = False + if len(sys.argv[1:]) == 1: + insertData = True + + if not os.path.isdir("taosx-perf"): + os.system("mkdir taosx-perf") + os.system("git clone https://github.com/brendangregg/FlameGraph.git taosx-perf") + os.chdir("taosx-perf") + print(os.getcwd()) + tdDnodes1.stopAll() - updatecfgDict1 = {'debugFlag': 135, 'serverPort': 6030} + updatecfgDict1 = {'debugFlag': 131, 'serverPort': 6030} tdDnodes1.init("./dnode1") tdDnodes1.deploy(1,updatecfgDict1) tdDnodes1.start(1) - updatecfgDict2 = {'debugFlag': 135, 'serverPort': 7030} + updatecfgDict2 = {'debugFlag': 131, 'serverPort': 7030} tdDnodes2.init("./dnode2") tdDnodes2.deploy(1,updatecfgDict2) tdDnodes2.start(1) - os.system("taosBenchmark -f taosx-performance.json") + if insertData : + os.system("taosBenchmark -f ../taosx-performance.json") + + print("create test in dst") + + os.system("taos -c ./dnode2/sim/dnode1/cfg -s \"drop database if exists test\"") + os.system("taos -c ./dnode2/sim/dnode1/cfg -s \"create database test vgroups 8\"") + + print("start to run taosx") + os.system("taosx run -f \"tmq://root:taosdata@localhost:6030/test?group.id=taosx-new-`date +%s`&timeout=50s&experimental.snapshot.enable=false&auto.offset.reset=earliest&prefer=raw\" -t \"taos://root:taosdata@localhost:7030/test\" > /dev/null 2>&1 &") + time.sleep(10) + + print("start to run perf") + #os.system("perf record -a -g -F 99 -p `pidof taosx` sleep 60") + + #os.system("perf script | ./FlameGraph/stackcollapse-perf.pl| ./FlameGraph/flamegraph.pl > flame.svg") tdLog.info("Procedures for tdengine deployed in")