未验证 提交 b9d2a277 编写于 作者: sangshuduo's avatar sangshuduo 提交者: GitHub

Hotfix/sangshuduo/td 5875 taosdemo ue improve for master (#7707)

* better msg for create child table.

* just add one new line.

* fix INF rps if spent 0 ms to insert.
上级 6c4fcd3f
...@@ -8397,7 +8397,7 @@ static void startMultiThreadInsertData(int threads, char* db_name, ...@@ -8397,7 +8397,7 @@ static void startMultiThreadInsertData(int threads, char* db_name,
free(stmtBuffer); free(stmtBuffer);
int64_t start = taosGetTimestampMs(); int64_t start = taosGetTimestampUs();
for (int i = 0; i < threads; i++) { for (int i = 0; i < threads; i++) {
pthread_join(pids[i], NULL); pthread_join(pids[i], NULL);
...@@ -8441,18 +8441,18 @@ static void startMultiThreadInsertData(int threads, char* db_name, ...@@ -8441,18 +8441,18 @@ static void startMultiThreadInsertData(int threads, char* db_name,
if (cntDelay == 0) cntDelay = 1; if (cntDelay == 0) cntDelay = 1;
avgDelay = (double)totalDelay / cntDelay; avgDelay = (double)totalDelay / cntDelay;
int64_t end = taosGetTimestampMs(); int64_t end = taosGetTimestampUs();
int64_t t = end - start; int64_t t = end - start;
if (0 == t) t = 1;
double tInMs = (double) t / 1000.0; double tInMs = (double) t / 1000000.0;
if (stbInfo) { if (stbInfo) {
fprintf(stderr, "Spent %.4f seconds to insert rows: %"PRIu64", affected rows: %"PRIu64" with %d thread(s) into %s.%s. %.2f records/second\n\n", fprintf(stderr, "Spent %.4f seconds to insert rows: %"PRIu64", affected rows: %"PRIu64" with %d thread(s) into %s.%s. %.2f records/second\n\n",
tInMs, stbInfo->totalInsertRows, tInMs, stbInfo->totalInsertRows,
stbInfo->totalAffectedRows, stbInfo->totalAffectedRows,
threads, db_name, stbInfo->sTblName, threads, db_name, stbInfo->sTblName,
(double) tInMs? (double)(stbInfo->totalInsertRows/tInMs));
(double)(stbInfo->totalInsertRows/tInMs):FLT_MAX);
if (g_fpOfInsertResult) { if (g_fpOfInsertResult) {
fprintf(g_fpOfInsertResult, fprintf(g_fpOfInsertResult,
...@@ -8460,24 +8460,21 @@ static void startMultiThreadInsertData(int threads, char* db_name, ...@@ -8460,24 +8460,21 @@ static void startMultiThreadInsertData(int threads, char* db_name,
tInMs, stbInfo->totalInsertRows, tInMs, stbInfo->totalInsertRows,
stbInfo->totalAffectedRows, stbInfo->totalAffectedRows,
threads, db_name, stbInfo->sTblName, threads, db_name, stbInfo->sTblName,
(tInMs)? (double)(stbInfo->totalInsertRows/tInMs));
(double)(stbInfo->totalInsertRows/tInMs):FLT_MAX);
} }
} else { } else {
fprintf(stderr, "Spent %.4f seconds to insert rows: %"PRIu64", affected rows: %"PRIu64" with %d thread(s) into %s %.2f records/second\n\n", fprintf(stderr, "Spent %.4f seconds to insert rows: %"PRIu64", affected rows: %"PRIu64" with %d thread(s) into %s %.2f records/second\n\n",
tInMs, g_args.totalInsertRows, tInMs, g_args.totalInsertRows,
g_args.totalAffectedRows, g_args.totalAffectedRows,
threads, db_name, threads, db_name,
(tInMs)? (double)(g_args.totalInsertRows/tInMs));
(double)(g_args.totalInsertRows/tInMs):FLT_MAX);
if (g_fpOfInsertResult) { if (g_fpOfInsertResult) {
fprintf(g_fpOfInsertResult, fprintf(g_fpOfInsertResult,
"Spent %.4f seconds to insert rows: %"PRIu64", affected rows: %"PRIu64" with %d thread(s) into %s %.2f records/second\n\n", "Spent %.4f seconds to insert rows: %"PRIu64", affected rows: %"PRIu64" with %d thread(s) into %s %.2f records/second\n\n",
tInMs, g_args.totalInsertRows, tInMs, g_args.totalInsertRows,
g_args.totalAffectedRows, g_args.totalAffectedRows,
threads, db_name, threads, db_name,
(tInMs)? (double)(g_args.totalInsertRows/tInMs));
(double)(g_args.totalInsertRows/tInMs):FLT_MAX);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册