From dae6b5dc1dca3139fa5492f378f951dded08460b Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Tue, 10 Oct 2023 20:56:13 +0800 Subject: [PATCH 1/6] feat: support now write data --- src/benchInsert.c | 8 ++++++-- src/benchJsonOpt.c | 5 +++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/benchInsert.c b/src/benchInsert.c index 51fd3431..bad5e85c 100644 --- a/src/benchInsert.c +++ b/src/benchInsert.c @@ -1532,8 +1532,12 @@ static void *syncWriteInterlace(void *sarg) { int64_t disorderTs = getDisorderTs(stbInfo, &disorderRange); char time_string[BIGINT_BUFF_LEN]; - snprintf(time_string, BIGINT_BUFF_LEN, "%"PRId64"", - disorderTs?disorderTs:timestamp); + if(stbInfo->useNow) { + snprintf(time_string, BIGINT_BUFF_LEN, "now"); + } else { + snprintf(time_string, BIGINT_BUFF_LEN, "%"PRId64"", + disorderTs?disorderTs:timestamp); + } ds_add_strs(&pThreadInfo->buffer, 5, "(", time_string, diff --git a/src/benchJsonOpt.c b/src/benchJsonOpt.c index 535d960b..dfc60352 100644 --- a/src/benchJsonOpt.c +++ b/src/benchJsonOpt.c @@ -889,6 +889,11 @@ static int getStableInfo(tools_cJSON *dbinfos, int index) { superTable->interlaceRows = (uint32_t)stbInterlaceRows->valueint; } + // force set + if(superTable->useNow) { + superTable->interlaceRows = 1; + } + // disorder tools_cJSON *disorderRatio = tools_cJSON_GetObjectItem(stbInfo, "disorder_ratio"); From eb59be851570e3efb08156903c6ce8b11e5f0f91 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Wed, 11 Oct 2023 10:20:52 +0800 Subject: [PATCH 2/6] feat: add insertNow.json --- example/insertNow.json | 76 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 example/insertNow.json diff --git a/example/insertNow.json b/example/insertNow.json new file mode 100644 index 00000000..dddb9f95 --- /dev/null +++ b/example/insertNow.json @@ -0,0 +1,76 @@ +{ + "filetype": "insert", + "cfgdir": "/etc/taos", + "host": "127.0.0.1", + "port": 6030, + "user": "root", + "password": "taosdata", + "connection_pool_size": 8, + "thread_count": 4, + "create_table_thread_count": 7, + "result_file": "./insert_res.txt", + "confirm_parameter_prompt": "no", + "insert_interval": 0, + "num_of_records_per_req": 10000, + "prepared_rand": 10000, + "chinese": "no", + "escape_character": "yes", + "databases": [ + { + "dbinfo": { + "name": "test", + "drop": "yes", + "precision": "ms" + }, + "super_tables": [ + { + "name": "meters", + "child_table_exists": "no", + "childtable_count": 10000, + "childtable_prefix": "d", + "auto_create_table": "no", + "batch_create_tbl_num": 5, + "data_source": "rand", + "insert_mode": "taosc", + "non_stop_mode": "no", + "line_protocol": "line", + "insert_rows": 900000000000000, + "interlace_rows": 1, + "insert_interval": 0, + "start_timestamp": "now", + "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 + }, + { + "name": "location", + "type": "BINARY", + "len": 16, + "values": ["San Francisco", "Los Angles", "San Diego", + "San Jose", "Palo Alto", "Campbell", "Mountain View", + "Sunnyvale", "Santa Clara", "Cupertino"] + } + ] + } + ] + } + ] +} From 60b2a90701be672dce88f45ff4fc0f723a98e310 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Wed, 11 Oct 2023 10:39:23 +0800 Subject: [PATCH 3/6] feat: adjust json config --- example/insertNow.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/example/insertNow.json b/example/insertNow.json index dddb9f95..5b805551 100644 --- a/example/insertNow.json +++ b/example/insertNow.json @@ -20,7 +20,8 @@ "dbinfo": { "name": "test", "drop": "yes", - "precision": "ms" + "precision": "ms", + "wal_retention_period": "60" }, "super_tables": [ { @@ -36,7 +37,7 @@ "line_protocol": "line", "insert_rows": 900000000000000, "interlace_rows": 1, - "insert_interval": 0, + "insert_interval": 1000, "start_timestamp": "now", "sample_format": "csv", "sample_file": "./sample.csv", From a37ee989ab010266138558c1e302de92930b72a1 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Wed, 11 Oct 2023 12:49:29 +0800 Subject: [PATCH 4/6] feat: adjust json config1 --- example/insertNow.json | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/example/insertNow.json b/example/insertNow.json index 5b805551..38a7b61b 100644 --- a/example/insertNow.json +++ b/example/insertNow.json @@ -6,22 +6,30 @@ "user": "root", "password": "taosdata", "connection_pool_size": 8, - "thread_count": 4, + "thread_count": 5, "create_table_thread_count": 7, "result_file": "./insert_res.txt", "confirm_parameter_prompt": "no", "insert_interval": 0, - "num_of_records_per_req": 10000, + "num_of_records_per_req": 2000, "prepared_rand": 10000, "chinese": "no", "escape_character": "yes", "databases": [ { "dbinfo": { - "name": "test", + "name": "alive", "drop": "yes", - "precision": "ms", - "wal_retention_period": "60" + "vgroups": 4, + "duration": 3650, + "pages": 512, + "minrows":5000, + "maxrows":10000, + "stt_trigger":10, + "wal_retention_period": 10, + "wal_retention_size": 100, + "cachemodel": "'both'", + "precision": "ms" }, "super_tables": [ { @@ -37,7 +45,7 @@ "line_protocol": "line", "insert_rows": 900000000000000, "interlace_rows": 1, - "insert_interval": 1000, + "insert_interval": 10000, "start_timestamp": "now", "sample_format": "csv", "sample_file": "./sample.csv", From 3056d92b047695ac81b634ab0a3d8f705e29ec9e Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Wed, 11 Oct 2023 12:51:22 +0800 Subject: [PATCH 5/6] feat: adjust json config1 --- example/insertNow.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/insertNow.json b/example/insertNow.json index 38a7b61b..f8c69148 100644 --- a/example/insertNow.json +++ b/example/insertNow.json @@ -25,7 +25,7 @@ "pages": 512, "minrows":5000, "maxrows":10000, - "stt_trigger":10, + "stt_trigger":1, "wal_retention_period": 10, "wal_retention_size": 100, "cachemodel": "'both'", From 35dc194d6e61df7aeb0fed4a7707140569ba8e5f Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Wed, 11 Oct 2023 12:56:13 +0800 Subject: [PATCH 6/6] feat: adjust json keep duration --- example/insertNow.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/example/insertNow.json b/example/insertNow.json index f8c69148..8032654d 100644 --- a/example/insertNow.json +++ b/example/insertNow.json @@ -18,10 +18,11 @@ "databases": [ { "dbinfo": { - "name": "alive", + "name": "smart", "drop": "yes", "vgroups": 4, - "duration": 3650, + "duration": "10d", + "keep": "100d", "pages": 512, "minrows":5000, "maxrows":10000, @@ -45,7 +46,7 @@ "line_protocol": "line", "insert_rows": 900000000000000, "interlace_rows": 1, - "insert_interval": 10000, + "insert_interval": 1000, "start_timestamp": "now", "sample_format": "csv", "sample_file": "./sample.csv",