diff --git a/example/insertNow.json b/example/insertNow.json new file mode 100644 index 00000000..8032654d --- /dev/null +++ b/example/insertNow.json @@ -0,0 +1,86 @@ +{ + "filetype": "insert", + "cfgdir": "/etc/taos", + "host": "127.0.0.1", + "port": 6030, + "user": "root", + "password": "taosdata", + "connection_pool_size": 8, + "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": 2000, + "prepared_rand": 10000, + "chinese": "no", + "escape_character": "yes", + "databases": [ + { + "dbinfo": { + "name": "smart", + "drop": "yes", + "vgroups": 4, + "duration": "10d", + "keep": "100d", + "pages": 512, + "minrows":5000, + "maxrows":10000, + "stt_trigger":1, + "wal_retention_period": 10, + "wal_retention_size": 100, + "cachemodel": "'both'", + "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": 1000, + "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"] + } + ] + } + ] + } + ] +} 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");