Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge main to 3.0 #705

Merged
merged 71 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
b25d583
test: modify groupid
plum-lihui Jul 5, 2023
82fd3c0
test: modify buffer size
plum-lihui Jul 5, 2023
76ad294
Merge pull request #686 from taosdata/test_main/lihui
plum-lihui Jul 6, 2023
a2b5a6f
fix: replace taosws.dll.lib with taosws.lib
xiaopingcs Jul 18, 2023
a2dea38
fix : add funs express
DuanKuanJun Jul 23, 2023
f0c946e
test: add insert_math.json case
DuanKuanJun Jul 23, 2023
a72ebf5
fix: add math.h library m
DuanKuanJun Jul 23, 2023
90f86c0
fix: funType = i+1
DuanKuanJun Jul 23, 2023
5096d40
fix: modify json case
DuanKuanJun Jul 23, 2023
9720b26
fix: add random number
DuanKuanJun Jul 23, 2023
86275b6
fix:build error
DuanKuanJun Jul 23, 2023
f7b99d0
fix: find key4
DuanKuanJun Jul 23, 2023
044523a
fix: case case insert_math.json
DuanKuanJun Jul 23, 2023
561daca
Merge pull request #690 from taosdata/feat/math
plum-lihui Jul 23, 2023
cfcb853
test: move fun to default config
DuanKuanJun Jul 23, 2023
3506573
test: prepare_rand set 360
DuanKuanJun Jul 23, 2023
738f519
Merge pull request #691 from taosdata/feat/math
plum-lihui Jul 23, 2023
3e0446b
test: calculate angle according with timestamp and step
DuanKuanJun Jul 24, 2023
698d9c3
Merge pull request #692 from taosdata/feat/math
gccgdb1234 Jul 24, 2023
d53f4eb
add angle step config with -A and angle_step
DuanKuanJun Jul 24, 2023
40ea9cf
test: A change to H
DuanKuanJun Jul 24, 2023
13f7d2a
test: add option angle-step
DuanKuanJun Jul 24, 2023
c2d977e
adjust insert_math.json to secnond
DuanKuanJun Jul 25, 2023
77b3244
Merge pull request #693 from taosdata/feat/math
gccgdb1234 Jul 25, 2023
4450341
feat: add progress on export data
DuanKuanJun Jul 25, 2023
6f4521f
feat: show start from 1 index
DuanKuanJun Jul 25, 2023
70e4a46
feat: add connect and close tips
DuanKuanJun Jul 25, 2023
c30c791
feat: add connect and close tips
DuanKuanJun Jul 25, 2023
3b827fa
feat: add connect and close tips
DuanKuanJun Jul 25, 2023
f302467
Merge pull request #687 from taosdata/fix_packaging_issue
gccgdb1234 Jul 26, 2023
e7d2a72
feat(taosdump): add dbname.stbname to tip
DuanKuanJun Jul 28, 2023
cf16c4d
Merge pull request #694 from taosdata/feat/TS-3689
DuanKuanJun Jul 30, 2023
34ad3ea
fix: deal dot in table name
DuanKuanJun Aug 15, 2023
e95531d
add Z --nodrop database for command
DuanKuanJun Aug 15, 2023
84a3098
test: option modify to upper letter Q
DuanKuanJun Aug 15, 2023
e783180
Merge pull request #696 from taosdata/fix/TD-25690
DuanKuanJun Aug 15, 2023
3947097
feat: add option -R --dot-replace
DuanKuanJun Aug 15, 2023
21c7077
feat: apply -R --dot-replace option to code
DuanKuanJun Aug 15, 2023
1f810f2
fix: build error
DuanKuanJun Aug 15, 2023
38fcf76
fix: build error1
DuanKuanJun Aug 15, 2023
dd8e6f6
Merge pull request #695 from taosdata/fix/TS-3719
DuanKuanJun Aug 15, 2023
48a430b
fix: struct init warning
DuanKuanJun Aug 15, 2023
06af919
fix: struct init warning (#697)
DuanKuanJun Aug 15, 2023
0c581dd
fix: memory leak and add cloud generate json file
DuanKuanJun Aug 16, 2023
a7c8131
Merge pull request #698 from taosdata/checkCI
DuanKuanJun Aug 16, 2023
9cdef4e
chore: update taos-tools version (#699)
sangshuduo Aug 17, 2023
b227fa2
Merge branch 'main' into fix/TS-3719
DuanKuanJun Aug 23, 2023
0cdfcf3
fix: dot-replace change option from R to Q
DuanKuanJun Aug 23, 2023
d506284
Merge pull request #700 from taosdata/fix/TS-3719
gccgdb1234 Aug 25, 2023
ba0b1c2
fix: --help on linux (#701)
sangshuduo Aug 30, 2023
15016ce
fix: if child table count error tips
DuanKuanJun Sep 12, 2023
c7cd35a
Merge pull request #702 from taosdata/fix/TS-3951
DuanKuanJun Sep 12, 2023
9c910fa
feat: support dbname rename during importing
DuanKuanJun Sep 13, 2023
67d3eb7
fix: build error
DuanKuanJun Sep 13, 2023
ba01746
fix: build error1
DuanKuanJun Sep 13, 2023
089086b
fix: build error2
DuanKuanJun Sep 13, 2023
09718ff
fix: add option name
DuanKuanJun Sep 13, 2023
44185a4
fix: add option name1
DuanKuanJun Sep 13, 2023
eb3b2c4
fix: left sql length
DuanKuanJun Sep 13, 2023
765e7b0
fix: rename normal table sql
DuanKuanJun Sep 13, 2023
bfb822d
fix: rename normal table sql
DuanKuanJun Sep 13, 2023
81563d9
fix: adjust new function position
DuanKuanJun Sep 13, 2023
97542a1
fix: support websocket
DuanKuanJun Sep 13, 2023
aa65243
feat: taosdump add rename database option -W case
DuanKuanJun Sep 13, 2023
d302253
fix: add old case
DuanKuanJun Sep 13, 2023
330f11a
fix: case failed for escapedb.py
DuanKuanJun Sep 13, 2023
7360894
fix: help information and -p can crash
DuanKuanJun Sep 13, 2023
97cca04
fix: help information and reset -p
DuanKuanJun Sep 13, 2023
4106fb7
fix: help information
DuanKuanJun Sep 13, 2023
4148259
fix: modify version to 2.5.4
DuanKuanJun Sep 14, 2023
df061ca
Merge pull request #703 from taosdata/feat/TS-3949
DuanKuanJun Sep 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions VERSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
taosbenchmark-3.2.2
taosdump-2.5.2
2.5.3
taosbenchmark-3.2.3
taosdump-2.5.4
2.5.4
92 changes: 92 additions & 0 deletions example/insertDemo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
"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,
"interlace_rows": 100,
"num_of_records_per_req": 20000,
"prepared_rand": 10000,
"chinese": "no",
"escape_character": "yes",
"databases": [
{
"dbinfo": {
"name": "smartmeters",
"drop": "yes",
"vgroups": 4,
"duration": 3650,
"pages": 512,
"minrows":10000,
"maxrows":20000,
"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": 100000,
"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": 100000,
"childtable_limit": 10,
"childtable_offset": 100,
"interlace_rows": 0,
"insert_interval": 0,
"partial_col_num": 0,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 900000,
"angle_step": 180000,
"start_timestamp": "2020-06-01 00:00:00.000",
"sample_format": "csv",
"sample_file": "./sample.csv",
"use_sample_ts": "no",
"tags_file": "",
"columns": [
{ "type": "FLOAT", "name": "current", "fun": "3*sin(x)+10*random(2)"},
{ "type": "INT", "name": "voltage", "fun": "40*sin(x)+200*random(10)"},
{ "type": "FLOAT", "name": "phase", "fun": "1*sin(x)+1*random(3)"}
],
"tags": [
{
"type": "TINYINT",
"name": "groupid",
"max": 10,
"min": 1
},
{
"name": "location",
"type": "BINARY",
"len": 16,
"values": ["BJ.HaiDian", "BJ.ChaoYang","BJ.FengTai",
"BJ.DongCheng", "BJ.XiCheng", "Bj.YanQing", "BJ.MenTouGou",
"BJ.HuaiRou", "BJ.PingGu", "BJ.MiYun",
"SH.HuangPu", "SH.XuHui", "SH.ChangNing", "SH.JingAn", "SH.PuTuo",
"SH.HongKou", "SH.YangPu", "SH.MinHang", "SH.BaoShan", "SH.JiaDing",
"SH.JinShan", "SH.SongJiang", "SH.QingPu", "SH.FengXian", "SH.ChongMing",
"SH.PuDong"
]
}
]
}
]
}
]
}
78 changes: 78 additions & 0 deletions example/insert_math.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"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,
"interlace_rows": 100,
"num_of_records_per_req": 100,
"prepared_rand": 3600,
"chinese": "no",
"escape_character": "yes",
"databases": [
{
"dbinfo": {
"name": "test",
"drop": "yes",
"precision": "ms"
},
"super_tables": [
{
"name": "meters",
"child_table_exists": "no",
"childtable_count": 1000,
"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": 1000,
"childtable_limit": 10,
"childtable_offset": 100,
"interlace_rows": 0,
"insert_interval": 0,
"partial_col_num": 0,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 1000,
"angle_step": 500,
"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", "fun": "3*sin(x)+10*random(2)"},
{ "type": "INT", "name": "voltage", "fun": "40*sin(x)+200*random(10)"},
{ "type": "FLOAT", "name": "phase", "fun": "1*sin(x)+1*random(3)"}
],
"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"]
}
]
}
]
}
]
}
19 changes: 19 additions & 0 deletions inc/bench.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ typedef unsigned __int32 uint32_t;
#define BENCH_INTERVAL \
"Insert interval for interlace mode in milliseconds, default is 0."
#define BENCH_STEP "Timestamp step in milliseconds, default is 1."
#define ANGLE_STEP "Angle step in milliseconds, default is 1."
#define BENCH_SUPPLEMENT \
"Supplementally insert data without create " \
"database and table, optional, default is off."
Expand Down Expand Up @@ -248,6 +249,7 @@ typedef unsigned __int32 uint32_t;
"Specify interval between keep trying insert. " \
"Valid value is a positive number. Only valid " \
"when keep trying be enabled."
#define BENCH_NODROP "Do not drop database."

#ifdef WEBSOCKET
#define BENCH_DSN "The dsn to connect the cloud service."
Expand Down Expand Up @@ -553,6 +555,15 @@ typedef struct SChildField {
StmtData stmtData;
} ChildField;

#define PI 3.141592654
#define ATOR(x) (x*3.141592654/180)

#define FUNTYPE_NONE 0
#define FUNTYPE_SIN 1
#define FUNTYPE_COS 2

#define FUNTYPE_CNT 2

typedef struct SField {
uint8_t type;
char name[TSDB_COL_NAME_LEN + 1];
Expand All @@ -563,6 +574,13 @@ typedef struct SField {
int64_t max;
int64_t min;
tools_cJSON * values;

// fun
uint8_t funType;
float multiple;
int32_t addend;
int32_t random;

bool sma;
} Field;

Expand Down Expand Up @@ -666,6 +684,7 @@ typedef struct SSuperTable_S {
uint64_t insert_interval;
uint64_t insertRows;
uint64_t timestamp_step;
uint64_t angle_step;
int64_t startTimestamp;
int64_t specifiedColumns;
char sampleFile[MAX_FILE_NAME_LEN];
Expand Down
20 changes: 10 additions & 10 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,8 @@ IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin
FIND_LIBRARY(LIBZ_LIBRARY z)
MESSAGE(${ARGP_LIBRARY})

TARGET_LINK_LIBRARIES(taosBenchmark taos pthread toolscJson $<$<BOOL:${LIBZ_LIBRARY}>:${LIBZ_LIBRARY}> $<$<BOOL:${ARGP_LIBRARY}>:${ARGP_LIBRARY}> ${WEBSOCKET_LINK_FLAGS})
TARGET_LINK_LIBRARIES(taosdump taos avro jansson atomic pthread argp $<$<BOOL:${LIBZ_LIBRARY}>:${LIBZ_LIBRARY}> $<$<BOOL:${ARGP_LIBRARY}>:${ARGP_LIBRARY}> ${WEBSOCKET_LINK_FLAGS})
TARGET_LINK_LIBRARIES(taosBenchmark taos pthread m toolscJson $<$<BOOL:${LIBZ_LIBRARY}>:${LIBZ_LIBRARY}> $<$<BOOL:${ARGP_LIBRARY}>:${ARGP_LIBRARY}> ${WEBSOCKET_LINK_FLAGS})
TARGET_LINK_LIBRARIES(taosdump taos avro jansson atomic pthread m argp $<$<BOOL:${LIBZ_LIBRARY}>:${LIBZ_LIBRARY}> $<$<BOOL:${ARGP_LIBRARY}>:${ARGP_LIBRARY}> ${WEBSOCKET_LINK_FLAGS})
ELSEIF(${OS_ID} MATCHES "Darwin")
ADD_LIBRARY(argp STATIC IMPORTED)
IF (CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
Expand All @@ -319,11 +319,11 @@ IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin
SET_PROPERTY(TARGET argp PROPERTY IMPORTED_LOCATION "/usr/local/lib/libargp.a")
INCLUDE_DIRECTORIES(/usr/local/include/)
ENDIF ()
TARGET_LINK_LIBRARIES(taosBenchmark taos pthread toolscJson argp ${WEBSOCKET_LINK_FLAGS})
TARGET_LINK_LIBRARIES(taosBenchmark taos pthread m toolscJson argp ${WEBSOCKET_LINK_FLAGS})
ElSE ()
MESSAGE("${Yellow} DEBUG mode use shared avro library to link for debug ${ColourReset}")
TARGET_LINK_LIBRARIES(taosdump taos avro jansson atomic pthread ${WEBSOCKET_LINK_FLAGS} ${GCC_COVERAGE_LINK_FLAGS})
TARGET_LINK_LIBRARIES(taosBenchmark taos pthread toolscJson ${WEBSOCKET_LINK_FLAGS} ${GCC_COVERAGE_LINK_FLAGS})
TARGET_LINK_LIBRARIES(taosdump taos avro jansson atomic pthread m ${WEBSOCKET_LINK_FLAGS} ${GCC_COVERAGE_LINK_FLAGS})
TARGET_LINK_LIBRARIES(taosBenchmark taos pthread m toolscJson ${WEBSOCKET_LINK_FLAGS} ${GCC_COVERAGE_LINK_FLAGS})
ENDIF()

ELSE ()
Expand Down Expand Up @@ -362,7 +362,7 @@ IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin
INCLUDE_DIRECTORIES(/usr/local/include/)
ENDIF ()

TARGET_LINK_LIBRARIES(taosBenchmark taos pthread toolscJson argp ${WEBSOCKET_LINK_FLAGS})
TARGET_LINK_LIBRARIES(taosBenchmark taos pthread m toolscJson argp ${WEBSOCKET_LINK_FLAGS})
ELSE ()
EXECUTE_PROCESS (
COMMAND sh -c "awk -F= '/^ID=/{print $2}' /etc/os-release |tr -d '\n' | tr -d '\"'"
Expand Down Expand Up @@ -414,10 +414,10 @@ IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin
MESSAGE(${LIBZ_LIBRARY})

TARGET_LINK_LIBRARIES(taosdump taos avro jansson snappy stdc++ lzma atomic pthread $<$<BOOL:${LIBZ_LIBRARY}>:${LIBZ_LIBRARY}> $<$<BOOL:${ARGP_LIBRARY}>:${ARGP_LIBRARY}> ${WEBSOCKET_LINK_FLAGS} ${GCC_COVERAGE_LINK_FLAGS})
TARGET_LINK_LIBRARIES(taosBenchmark taos pthread toolscJson $<$<BOOL:${LIBZ_LIBRARY}>:${LIBZ_LIBRARY}> $<$<BOOL:${ARGP_LIBRARY}>:${ARGP_LIBRARY}> ${WEBSOCKET_LINK_FLAGS} ${GCC_COVERAGE_LINK_FLAGS})
TARGET_LINK_LIBRARIES(taosBenchmark taos pthread m toolscJson $<$<BOOL:${LIBZ_LIBRARY}>:${LIBZ_LIBRARY}> $<$<BOOL:${ARGP_LIBRARY}>:${ARGP_LIBRARY}> ${WEBSOCKET_LINK_FLAGS} ${GCC_COVERAGE_LINK_FLAGS})
ELSE()
TARGET_LINK_LIBRARIES(taosdump taos avro jansson snappy stdc++ lzma libz-static atomic pthread ${WEBSOCKET_LINK_FLAGS} ${GCC_COVERAGE_LINK_FLAGS})
TARGET_LINK_LIBRARIES(taosBenchmark taos pthread toolscJson ${WEBSOCKET_LINK_FLAGS} ${GCC_COVERAGE_LINK_FLAGS})
TARGET_LINK_LIBRARIES(taosBenchmark taos pthread m toolscJson ${WEBSOCKET_LINK_FLAGS} ${GCC_COVERAGE_LINK_FLAGS})
ENDIF()
ENDIF ()

Expand All @@ -443,9 +443,9 @@ ELSE ()

IF (${WEBSOCKET})
INCLUDE_DIRECTORIES(/usr/local/include/)
SET(WEBSOCKET_LINK_FLAGS "taosws.dll.lib")
SET(WEBSOCKET_LINK_FLAGS "taosws.lib")
IF (${CMAKE_PROJECT_NAME} STREQUAL "taos-tools")
MESSAGE("taosws.dll.lib need to be installed first")
MESSAGE("taosws.lib need to be installed first")
ELSE ()
ADD_DEPENDENCIES(taosBenchmark taosws-rs)
ADD_DEPENDENCIES(taosdump taosws-rs)
Expand Down
22 changes: 20 additions & 2 deletions src/benchCommandOpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,28 @@ static void initStable() {
tstrncpy(c3->name, "phase", TSDB_COL_NAME_LEN + 1);

c1->min = 9;
c1->max = 10;
c1->max = 10;
// fun = "3*sin(x)+10*random(2)"
c1->funType = FUNTYPE_SIN;
c1->multiple = 3;
c1->random = 2;
c1->addend = 10;

c2->min = 110;
c2->max = 119;
// fun = "40*sin(x)+200*random(10)"
c2->funType = FUNTYPE_SIN;
c2->multiple = 40;
c2->random = 10;
c2->addend = 200;

c3->min = 115;
c3->max = 125;
// fun = "1*sin(x)+1*random(3)"
c3->funType = FUNTYPE_SIN;
c3->multiple = 1;
c3->random = 3;
c3->addend = 1;

stbInfo->tags = benchArrayInit(2, sizeof(Field));
for (int i = 0; i < 2; ++i) {
Expand All @@ -166,6 +183,7 @@ static void initStable() {

stbInfo->insert_interval = 0;
stbInfo->timestamp_step = 1;
stbInfo->angle_step = 1;
stbInfo->interlaceRows = 0;
stbInfo->childTblCount = DEFAULT_CHILDTABLES;
stbInfo->childTblLimit = 0;
Expand Down Expand Up @@ -349,7 +367,7 @@ void modifyArgument() {

if (g_arguments->demo_mode && TAOSC_IFACE == g_arguments->iface) {
g_arguments->mistMode = true;
g_arguments->prepared_rand = 57;
g_arguments->prepared_rand = 360;
}
}

Expand Down
Loading
Loading