Skip to content

Commit

Permalink
test: remove unused module (#623)
Browse files Browse the repository at this point in the history
* feat: taosbenchmark support creating table intervals

* feat: taosbenchmark support creating table intervals

* fix: mem leak if insert row is 0

* chore: refactor code

* feat: completed

* fix: taosbenchmark/taosc_insert-table-creating-interval.py

* chore: refactor

* chore: refactor

* test: remove unused module

* fix: disorder bug

* test: 2.x taosbenchmark workflow refine

* fix: test case bin path
  • Loading branch information
sangshuduo committed Mar 16, 2023
1 parent 09ab2bd commit ea02029
Show file tree
Hide file tree
Showing 19 changed files with 1,093 additions and 20 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/2.x-taosbenchmark-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,16 @@ jobs:
sudo pkill -9 taosadapter || :
sudo pkill -9 taosd || :
for i in `find taosbenchmark -name "*.py"|grep -Ev "v3"|sort`; \
do python3 ./test.py -f $i > /dev/null \
&& echo -e "\033[32m taosbenchmark-debug-test/$i success! \033[0m" \
if find taosbenchmark -name "*.py"|grep -Ev "v3"|grep -q .;
then
for i in `find taosbenchmark -name "*.py"|grep -Ev "v3"|sort`; \
do python3 ./test.py -f $i \
&& echo -e "\033[32m taosbenchmark-debug-test/$i success! \033[0m" \
| tee -a ~/taosbenchmark-debug-success.txt \
|| echo -e "\033[31m taosbenchmark-debug-test/$i failed! \033[0m" \
| tee -a ~/taosbenchmark-debug-failed.txt ; \
|| echo -e "\033[31m taosbenchmark-debug-test/$i failed! \033[0m" \
| tee -a ~/taosbenchmark-debug-failed.txt ; \
done
fi
- name: Check Test Result
if: steps.changed-files-specific.outputs.any_changed == 'true'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/2.x-taosbenchmark-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ jobs:
sudo pkill -9 taosadapter || :
sudo pkill -9 taosd || :
if find taosbenchmark -name "*.py"|grep -q .;
if find taosbenchmark -name "*.py"|grep -Ev "v3"|grep -q .;
then
for i in `find taosbenchmark -name "*.py"|grep -Ev "v3"|sort`; \
do python3 ./test.py -f $i > /dev/null \
Expand Down
20 changes: 11 additions & 9 deletions src/benchInsert.c
Original file line number Diff line number Diff line change
Expand Up @@ -1365,18 +1365,17 @@ static void cleanupAndPrint(threadInfo *pThreadInfo, char *mode) {
}
}

static int64_t getDisorderTs(SSuperTable *stbInfo) {
static int64_t getDisorderTs(SSuperTable *stbInfo, int *disorderRange) {
int64_t disorderTs = 0;
int64_t startTimestamp = stbInfo->startTimestamp;
int disorderRange = stbInfo->disorderRange;
if (stbInfo->disorderRatio > 0) {
int rand_num = taosRandom() % 100;
if (rand_num < stbInfo->disorderRatio) {
disorderRange--;
if (0 == disorderRange) {
disorderRange = stbInfo->disorderRange;
(*disorderRange)--;
if (0 == *disorderRange) {
*disorderRange = stbInfo->disorderRange;
}
disorderTs = startTimestamp - disorderRange;
disorderTs = startTimestamp - *disorderRange;
debugPrint("rand_num: %d, < disorderRatio: %d, "
"disorderTs: %"PRId64"\n",
rand_num, stbInfo->disorderRatio,
Expand Down Expand Up @@ -1404,6 +1403,7 @@ static void *syncWriteInterlace(void *sarg) {
int64_t startTs = toolsGetTimestampUs();
int64_t endTs;
uint64_t tableSeq = pThreadInfo->start_table_from;
int disorderRange = stbInfo->disorderRange;

while (insertRows > 0) {
int64_t tmp_total_insert_rows = 0;
Expand Down Expand Up @@ -1468,7 +1468,7 @@ static void *syncWriteInterlace(void *sarg) {
}

for (int64_t j = 0; j < interlaceRows; j++) {
int64_t disorderTs = getDisorderTs(stbInfo);
int64_t disorderTs = getDisorderTs(stbInfo, &disorderRange);
char time_string[BIGINT_BUFF_LEN];
snprintf(time_string, BIGINT_BUFF_LEN, "%"PRId64"",
disorderTs?disorderTs:timestamp);
Expand Down Expand Up @@ -1515,7 +1515,7 @@ static void *syncWriteInterlace(void *sarg) {
case SML_IFACE: {
int protocol = stbInfo->lineProtocol;
for (int64_t j = 0; j < interlaceRows; j++) {
int64_t disorderTs = getDisorderTs(stbInfo);
int64_t disorderTs = getDisorderTs(stbInfo, &disorderRange);
if (TSDB_SML_JSON_PROTOCOL == protocol) {
tools_cJSON *tag = tools_cJSON_Duplicate(
tools_cJSON_GetArrayItem(
Expand Down Expand Up @@ -1959,6 +1959,8 @@ static int32_t prepareProgressDataSql(
SDataBase *database = pThreadInfo->dbInfo;
SSuperTable *stbInfo = pThreadInfo->stbInfo;
char * pstr = pThreadInfo->buffer;
int disorderRange = stbInfo->disorderRange;

if (stbInfo->partialColNum == stbInfo->cols->size) {
if (stbInfo->autoTblCreating) {
*len =
Expand Down Expand Up @@ -2013,7 +2015,7 @@ static int32_t prepareProgressDataSql(
sampleDataBuf +
*pos * stbInfo->lenOfCols);
} else {
int64_t disorderTs = getDisorderTs(stbInfo);
int64_t disorderTs = getDisorderTs(stbInfo, &disorderRange);
*len += snprintf(pstr + *len,
TSDB_MAX_ALLOWED_SQL_LEN - *len,
"(%" PRId64 ",%s)",
Expand Down
2 changes: 1 addition & 1 deletion src/taosdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -2521,7 +2521,7 @@ static int getTableTagValueWS(
TableDes **ppTableDes) {
int ret = -1;
if (3 == g_majorVersionOfClient) {
// if child-table have tag, V3 using select tag_value
// if child-table have tag, V3 using select tag_value
// from information_schema.ins_tag where table to get tagValue
ret = getTableTagValueWSV2(ws_taos, dbName, table, ppTableDes);
if (ret < 0) {
Expand Down
100 changes: 100 additions & 0 deletions tests/taosbenchmark/csv/nano_samples.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
8.855,"binary_str0" ,1626870128248246976
8.75,"binary_str1" ,1626870128249060032
5.44,"binary_str2" ,1626870128249067968
8.45,"binary_str3" ,1626870128249072064
4.07,"binary_str4" ,1626870128249075904
6.97,"binary_str5" ,1626870128249078976
6.86,"binary_str6" ,1626870128249082048
1.585,"binary_str7" ,1626870128249085120
1.4,"binary_str8" ,1626870128249087936
5.135,"binary_str9" ,1626870128249092032
3.15,"binary_str10" ,1626870128249095104
1.765,"binary_str11" ,1626870128249097920
7.71,"binary_str12" ,1626870128249100992
3.91,"binary_str13" ,1626870128249104064
5.615,"binary_str14" ,1626870128249106880
9.495,"binary_str15" ,1626870128249109952
3.825,"binary_str16" ,1626870128249113024
1.94,"binary_str17" ,1626870128249117120
5.385,"binary_str18" ,1626870128249119936
7.075,"binary_str19" ,1626870128249123008
5.715,"binary_str20" ,1626870128249126080
1.83,"binary_str21" ,1626870128249128896
6.365,"binary_str22" ,1626870128249131968
6.55,"binary_str23" ,1626870128249135040
6.315,"binary_str24" ,1626870128249138112
3.82,"binary_str25" ,1626870128249140928
2.455,"binary_str26" ,1626870128249145024
7.795,"binary_str27" ,1626870128249148096
2.47,"binary_str28" ,1626870128249150912
1.37,"binary_str29" ,1626870128249155008
5.39,"binary_str30" ,1626870128249158080
5.13,"binary_str31" ,1626870128249160896
4.09,"binary_str32" ,1626870128249163968
5.855,"binary_str33" ,1626870128249167040
0.17,"binary_str34" ,1626870128249170112
1.955,"binary_str35" ,1626870128249173952
0.585,"binary_str36" ,1626870128249178048
0.33,"binary_str37" ,1626870128249181120
7.925,"binary_str38" ,1626870128249183936
9.685,"binary_str39" ,1626870128249187008
2.6,"binary_str40" ,1626870128249191104
5.705,"binary_str41" ,1626870128249193920
3.965,"binary_str42" ,1626870128249196992
4.43,"binary_str43" ,1626870128249200064
8.73,"binary_str44" ,1626870128249202880
3.105,"binary_str45" ,1626870128249205952
9.39,"binary_str46" ,1626870128249209024
2.825,"binary_str47" ,1626870128249212096
9.675,"binary_str48" ,1626870128249214912
9.99,"binary_str49" ,1626870128249217984
4.51,"binary_str50" ,1626870128249221056
4.94,"binary_str51" ,1626870128249223872
7.72,"binary_str52" ,1626870128249226944
4.135,"binary_str53" ,1626870128249231040
2.325,"binary_str54" ,1626870128249234112
4.585,"binary_str55" ,1626870128249236928
8.76,"binary_str56" ,1626870128249240000
4.715,"binary_str57" ,1626870128249243072
0.56,"binary_str58" ,1626870128249245888
5.35,"binary_str59" ,1626870128249249984
5.075,"binary_str60" ,1626870128249253056
6.665,"binary_str61" ,1626870128249256128
7.13,"binary_str62" ,1626870128249258944
2.775,"binary_str63" ,1626870128249262016
5.775,"binary_str64" ,1626870128249265088
1.62,"binary_str65" ,1626870128249267904
1.625,"binary_str66" ,1626870128249270976
8.15,"binary_str67" ,1626870128249274048
0.75,"binary_str68" ,1626870128249277120
3.265,"binary_str69" ,1626870128249280960
8.585,"binary_str70" ,1626870128249284032
1.88,"binary_str71" ,1626870128249287104
8.44,"binary_str72" ,1626870128249289920
5.12,"binary_str73" ,1626870128249295040
2.58,"binary_str74" ,1626870128249298112
9.42,"binary_str75" ,1626870128249300928
1.765,"binary_str76" ,1626870128249304000
2.66,"binary_str77" ,1626870128249308096
1.405,"binary_str78" ,1626870128249310912
5.595,"binary_str79" ,1626870128249315008
2.28,"binary_str80" ,1626870128249318080
9.24,"binary_str81" ,1626870128249320896
9.03,"binary_str82" ,1626870128249323968
6.055,"binary_str83" ,1626870128249327040
1.74,"binary_str84" ,1626870128249330112
5.77,"binary_str85" ,1626870128249332928
1.97,"binary_str86" ,1626870128249336000
0.3,"binary_str87" ,1626870128249339072
7.145,"binary_str88" ,1626870128249342912
0.88,"binary_str89" ,1626870128249345984
8.025,"binary_str90" ,1626870128249349056
4.81,"binary_str91" ,1626870128249351872
0.725,"binary_str92" ,1626870128249355968
3.85,"binary_str93" ,1626870128249359040
9.455,"binary_str94" ,1626870128249362112
2.265,"binary_str95" ,1626870128249364928
3.985,"binary_str96" ,1626870128249368000
9.375,"binary_str97" ,1626870128249371072
0.2,"binary_str98" ,1626870128249373888
6.95,"binary_str99" ,1626870128249377984
100 changes: 100 additions & 0 deletions tests/taosbenchmark/csv/nano_sampletags.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
"string0",7,8.615
"string1",4,9.895
"string2",3,2.92
"string3",3,5.62
"string4",7,1.615
"string5",6,1.45
"string6",5,7.48
"string7",7,3.01
"string8",5,4.76
"string9",10,7.09
"string10",2,8.38
"string11",7,8.65
"string12",5,5.025
"string13",10,5.765
"string14",2,4.57
"string15",2,1.03
"string16",7,6.98
"string17",10,0.23
"string18",7,5.815
"string19",1,2.37
"string20",10,8.865
"string21",3,1.235
"string22",2,8.62
"string23",9,1.045
"string24",8,4.34
"string25",1,5.455
"string26",2,4.475
"string27",1,6.95
"string28",2,3.39
"string29",3,6.79
"string30",7,9.735
"string31",1,9.79
"string32",10,9.955
"string33",1,5.095
"string34",3,3.86
"string35",9,5.105
"string36",10,4.22
"string37",1,2.78
"string38",9,6.345
"string39",1,0.975
"string40",5,6.16
"string41",4,7.735
"string42",5,6.6
"string43",8,2.845
"string44",1,0.655
"string45",3,2.995
"string46",9,3.6
"string47",8,3.47
"string48",3,7.98
"string49",6,2.225
"string50",9,5.44
"string51",4,6.335
"string52",3,2.955
"string53",1,0.565
"string54",6,5.575
"string55",6,9.905
"string56",9,6.025
"string57",8,0.94
"string58",10,0.15
"string59",8,1.555
"string60",4,2.28
"string61",2,8.29
"string62",9,6.22
"string63",6,3.35
"string64",10,6.7
"string65",3,9.345
"string66",7,9.815
"string67",1,5.365
"string68",10,3.81
"string69",1,6.405
"string70",8,2.715
"string71",3,8.58
"string72",8,6.34
"string73",2,7.49
"string74",4,8.64
"string75",3,8.995
"string76",7,3.465
"string77",1,7.64
"string78",6,3.65
"string79",6,1.4
"string80",6,5.875
"string81",2,1.22
"string82",5,7.87
"string83",9,8.41
"string84",9,8.9
"string85",9,3.89
"string86",2,5.0
"string87",2,4.495
"string88",4,2.835
"string89",3,5.895
"string90",7,8.41
"string91",5,5.125
"string92",7,9.165
"string93",5,8.315
"string94",10,7.485
"string95",7,4.635
"string96",2,6.015
"string97",8,0.595
"string98",3,8.79
"string99",4,1.72
3 changes: 3 additions & 0 deletions tests/taosbenchmark/csv/sample.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1,-1,2147483647,0,2247483647.1,-12.2,'12ac,;\[uer]','23ac,;\[uer23423]123123','true'
0,-1,2147483647,0,2247483647.1,-12.2,'12ac,;\[uer]','23ac,;\[uer23423]123123','true'
0,-1,2147483647,0,2247483647.1,-12.2,'12ac,;\[uer]','23ac,;\[uer23423]123123','false'
2 changes: 2 additions & 0 deletions tests/taosbenchmark/csv/tags.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1,-127,127,'23ac,;\[uer]3','true'
1,-127,126,'23ac,;\[uer]3','true'

0 comments on commit ea02029

Please sign in to comment.