Skip to content

Commit

Permalink
Merge pull request #656 from taosdata/tmq/lihui
Browse files Browse the repository at this point in the history
Tmq/lihui
  • Loading branch information
plum-lihui committed May 17, 2023
2 parents 50c685c + a3c36e5 commit dbc9ebf
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/benchInsert.c
Original file line number Diff line number Diff line change
Expand Up @@ -1447,6 +1447,7 @@ static void *syncWriteInterlace(void *sarg) {
int64_t pos = 0;
uint32_t batchPerTblTimes = g_arguments->reqPerReq / interlaceRows;
uint64_t lastPrintTime = toolsGetTimestampMs();
uint64_t lastTotalInsertRows = 0;
int64_t startTs = toolsGetTimestampUs();
int64_t endTs;
uint64_t tableSeq = pThreadInfo->start_table_from;
Expand Down Expand Up @@ -1731,9 +1732,11 @@ static void *syncWriteInterlace(void *sarg) {
if (currentPrintTime - lastPrintTime > 30 * 1000) {
infoPrint(
"thread[%d] has currently inserted rows: %" PRIu64
"\n",
pThreadInfo->threadID, pThreadInfo->totalInsertRows);
", peroid insert rate: %.3f rows/s \n",
pThreadInfo->threadID, pThreadInfo->totalInsertRows,
(double)(pThreadInfo->totalInsertRows - lastTotalInsertRows) * 1000.0/(currentPrintTime - lastPrintTime));
lastPrintTime = currentPrintTime;
lastTotalInsertRows = pThreadInfo->totalInsertRows;
}
}
free_of_interlace:
Expand Down Expand Up @@ -2152,6 +2155,7 @@ void *syncWriteProgressive(void *sarg) {
pThreadInfo->end_table_to + 1);
#endif
uint64_t lastPrintTime = toolsGetTimestampMs();
uint64_t lastTotalInsertRows = 0;
int64_t startTs = toolsGetTimestampUs();
int64_t endTs;

Expand Down Expand Up @@ -2354,9 +2358,11 @@ void *syncWriteProgressive(void *sarg) {
if (currentPrintTime - lastPrintTime > 30 * 1000) {
infoPrint(
"thread[%d] has currently inserted rows: "
"%" PRId64 "\n",
pThreadInfo->threadID, pThreadInfo->totalInsertRows);
"%" PRId64 ", peroid insert rate: %.3f rows/s \n",
pThreadInfo->threadID, pThreadInfo->totalInsertRows,
(double)(pThreadInfo->totalInsertRows - lastTotalInsertRows) * 1000.0/(currentPrintTime - lastPrintTime));
lastPrintTime = currentPrintTime;
lastTotalInsertRows = pThreadInfo->totalInsertRows;
}
if (i >= stbInfo->insertRows) {
break;
Expand Down

0 comments on commit dbc9ebf

Please sign in to comment.