Feature/sangshuduo/td 3317 taosdemo interlace (#5922)
* [TD-3316] <fix>: add testcase for taosdemo limit and offset. check offset 0. * [TD-3316] <fix>: add testcase for taosdemo limit and offset. fix sample file import bug. * [TD-3316] <fix>: add test case for limit and offset. fix sample data issue. * [TD-3327] <fix>: fix taosdemo segfault when import data from sample data file. * [TD-3317] <feature>: make taosdemo support interlace mode. json parameter rows_per_tbl support. * [TD-3317] <feature>: support interlace mode. refactor * [TD-3317] <feature>: support interlace mode. refactor * [TD-3317] <feature>: support interlace mode insertion. refactor. * [TD-3317] <feature>: support interlace mode insertion. change json file. * [TD-3317] <feature>: support interlace mode insertion. fix multithread create table regression. * [TD-3317] <feature>: support interlace mode insertion. working but not perfect. * [TD-3317] <feature>: support interlace mode insertion. rename lowaTest with taosdemoTestWithJson * [TD-3317] <feature>: support interlace mode insertion. perfect * [TD-3317] <feature>: support interlace mode insertion. cleanup. * [TD-3317] <feature>: support interlace mode insertion. adjust algorithm of loop times. * [TD-3317] <feature>: support interlace mode insertion. fix delay time bug. * [TD-3317] <feature>: support interlace mode insertion. fix progressive timestamp bug. * [TD-3317] <feature>: support interlace mode insertion. add an option for performance print. * [TD-3317] <feature>: support interlace mode insertion. change json test case with less table for acceleration. * [TD-3317] <feature>: support interlace mode insertion. change progressive mode timestamp step and testcase. * [TD-3197] <fix>: fix taosdemo coverity scan issues. * [TD-3197] <fix>: fix taosdemo coverity scan issue. fix subscribeTest pids uninitialized. * [TD-3317] <feature>: support interlace mode insertion. add time shift for no sleep time. * [TD-3317] <feature>: support interlace insert. rework timestamp. * [TD-3317] <feature>: support interlace mode insertion. change rows_per_tbl to interlace_rows. * [TD-3317] <feature>: taosdemo suppoert interlace mode. remove trailing spaces. * [TD-3317] <feature>: taosdemo support interlace insertion. prompt if interlace > num_of_records_per_req * fill insert-into early to buffer. * fix buffer overflow issue. * change rows_per_tbl to interlace_rows to align with taosdemo. * adjust remainder rows logic. * [TD-3317]<fix>: taosdemo support interlace mode. fix global and stable interlace rows logic. * [TD-3317]<fix>: taosdemo support interlace mode. fix 'interlaceRows' is used uninitialized Co-authored-by: Shuduo Sang <sdsang@taosdata.com>
This commit is contained in:
parent
cb220d6572
commit
2aa0f15ea2
|
@ -252,7 +252,7 @@ typedef struct SSuperTable_S {
|
|||
int maxSqlLen; //
|
||||
|
||||
int insertInterval; // insert interval, will override global insert interval
|
||||
int64_t insertRows; // 0: no limit
|
||||
int64_t insertRows;
|
||||
int timeStampStep;
|
||||
char startTimestamp[MAX_TB_NAME_SIZE];
|
||||
char sampleFormat[MAX_TB_NAME_SIZE]; // csv, json
|
||||
|
@ -4868,6 +4868,8 @@ static int generateInterlaceDataBuffer(
|
|||
pstr += dataLen;
|
||||
*pRemainderBufLen -= dataLen;
|
||||
} else {
|
||||
debugPrint("%s() LN%d, generated data tail: %d, not equal batch per table: %d\n",
|
||||
__func__, __LINE__, k, batchPerTbl);
|
||||
pstr -= headLen;
|
||||
pstr[0] = '\0';
|
||||
k = 0;
|
||||
|
@ -4925,10 +4927,24 @@ static void* syncWriteInterlace(threadInfo *pThreadInfo) {
|
|||
debugPrint("[%d] %s() LN%d: ### interlace write\n",
|
||||
pThreadInfo->threadID, __func__, __LINE__);
|
||||
|
||||
int64_t insertRows;
|
||||
int interlaceRows;
|
||||
|
||||
SSuperTable* superTblInfo = pThreadInfo->superTblInfo;
|
||||
|
||||
int64_t insertRows = (superTblInfo)?superTblInfo->insertRows:g_args.num_of_DPT;
|
||||
int interlaceRows = superTblInfo?superTblInfo->interlaceRows:g_args.interlace_rows;
|
||||
if (superTblInfo) {
|
||||
insertRows = superTblInfo->insertRows;
|
||||
|
||||
if ((superTblInfo->interlaceRows == 0)
|
||||
&& (g_args.interlace_rows > 0)) {
|
||||
interlaceRows = g_args.interlace_rows;
|
||||
} else {
|
||||
interlaceRows = superTblInfo->interlaceRows;
|
||||
}
|
||||
} else {
|
||||
insertRows = g_args.num_of_DPT;
|
||||
interlaceRows = g_args.interlace_rows;
|
||||
}
|
||||
|
||||
if (interlaceRows > insertRows)
|
||||
interlaceRows = insertRows;
|
||||
|
@ -5063,15 +5079,15 @@ static void* syncWriteInterlace(threadInfo *pThreadInfo) {
|
|||
if (generatedRecPerTbl >= insertRows)
|
||||
break;
|
||||
|
||||
int remainRows = insertRows - generatedRecPerTbl;
|
||||
if ((remainRows > 0) && (batchPerTbl > remainRows))
|
||||
batchPerTbl = remainRows;
|
||||
|
||||
if (pThreadInfo->ntables * batchPerTbl < g_args.num_of_RPR)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int remainRows = insertRows - generatedRecPerTbl;
|
||||
if ((remainRows > 0) && (batchPerTbl > remainRows))
|
||||
batchPerTbl = remainRows;
|
||||
|
||||
verbosePrint("[%d] %s() LN%d generatedRecPerTbl=%d insertRows=%"PRId64"\n",
|
||||
pThreadInfo->threadID, __func__, __LINE__,
|
||||
generatedRecPerTbl, insertRows);
|
||||
|
@ -5294,7 +5310,18 @@ static void* syncWrite(void *sarg) {
|
|||
threadInfo *pThreadInfo = (threadInfo *)sarg;
|
||||
SSuperTable* superTblInfo = pThreadInfo->superTblInfo;
|
||||
|
||||
int interlaceRows = superTblInfo?superTblInfo->interlaceRows:g_args.interlace_rows;
|
||||
int interlaceRows;
|
||||
|
||||
if (superTblInfo) {
|
||||
if ((superTblInfo->interlaceRows == 0)
|
||||
&& (g_args.interlace_rows > 0)) {
|
||||
interlaceRows = g_args.interlace_rows;
|
||||
} else {
|
||||
interlaceRows = superTblInfo->interlaceRows;
|
||||
}
|
||||
} else {
|
||||
interlaceRows = g_args.interlace_rows;
|
||||
}
|
||||
|
||||
if (interlaceRows > 0) {
|
||||
// interlace mode
|
||||
|
@ -5981,7 +6008,6 @@ static void *specifiedTableQuery(void *sarg) {
|
|||
totalQueried ++;
|
||||
g_queryInfo.specifiedQueryInfo.totalQueried ++;
|
||||
|
||||
|
||||
et = taosGetTimestampMs();
|
||||
|
||||
int64_t currentPrintTime = taosGetTimestampMs();
|
||||
|
@ -5993,9 +6019,9 @@ static void *specifiedTableQuery(void *sarg) {
|
|||
pThreadInfo->threadID,
|
||||
totalQueried,
|
||||
(double)(totalQueried/((endTs-startTs)/1000.0)));
|
||||
}
|
||||
lastPrintTime = currentPrintTime;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -6079,10 +6105,10 @@ static void *superTableQuery(void *sarg) {
|
|||
pThreadInfo->threadID,
|
||||
totalQueried,
|
||||
(double)(totalQueried/((endTs-startTs)/1000.0)));
|
||||
}
|
||||
lastPrintTime = currentPrintTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
et = taosGetTimestampMs();
|
||||
printf("####thread[%"PRId64"] complete all sqls to allocate all sub-tables[%d - %d] once queries duration:%.4fs\n\n",
|
||||
taosGetSelfPthreadId(),
|
||||
|
|
Loading…
Reference in New Issue