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

Tmq/lihui #656

Merged
merged 18 commits into from
May 17, 2023
Merged
Changes from all commits
Commits
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
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
Loading