From cd6587b6db9f72ca4a04e2c262441409ed8c5c35 Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Sat, 17 Jul 2021 05:57:18 +0800 Subject: [PATCH] Hotfix/sangshuduo/td 5242 taosdemo support 4096 for master (#6886) * [TD-5242]: taosdemo support max columns align with TSDB defines. * fix records/sec format. --- src/kit/taosdemo/taosdemo.c | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/src/kit/taosdemo/taosdemo.c b/src/kit/taosdemo/taosdemo.c index 2ed050cb09..31a53ca4dd 100644 --- a/src/kit/taosdemo/taosdemo.c +++ b/src/kit/taosdemo/taosdemo.c @@ -5891,10 +5891,12 @@ static int32_t generateProgressiveDataWithoutStb( static void printStatPerThread(threadInfo *pThreadInfo) { fprintf(stderr, "====thread[%d] completed total inserted rows: %"PRIu64 ", total affected rows: %"PRIu64". %.2f records/second====\n", - pThreadInfo->threadID, - pThreadInfo->totalInsertRows, - pThreadInfo->totalAffectedRows, - (pThreadInfo->totalDelay)?(double)((pThreadInfo->totalAffectedRows / (pThreadInfo->totalDelay)/1000.0)): FLT_MAX); + pThreadInfo->threadID, + pThreadInfo->totalInsertRows, + pThreadInfo->totalAffectedRows, + (pThreadInfo->totalDelay/1000.0)? + (double)(pThreadInfo->totalAffectedRows/(pThreadInfo->totalDelay/1000.0)): + FLT_MAX); } // sync write interlace data @@ -6757,34 +6759,40 @@ static void startMultiThreadInsertData(int threads, char* db_name, int64_t end = taosGetTimestampMs(); int64_t t = end - start; + double tInMs = t/1000.0; + if (superTblInfo) { fprintf(stderr, "Spent %.2f seconds to insert rows: %"PRIu64", affected rows: %"PRIu64" with %d thread(s) into %s.%s. %.2f records/second\n\n", - t / 1000.0, superTblInfo->totalInsertRows, + tInMs, superTblInfo->totalInsertRows, superTblInfo->totalAffectedRows, threads, db_name, superTblInfo->sTblName, - (double)superTblInfo->totalInsertRows / (t / 1000.0)); + (tInMs)? + (double)(superTblInfo->totalInsertRows/tInMs):FLT_MAX); if (g_fpOfInsertResult) { fprintf(g_fpOfInsertResult, "Spent %.2f seconds to insert rows: %"PRIu64", affected rows: %"PRIu64" with %d thread(s) into %s.%s. %.2f records/second\n\n", - t / 1000.0, superTblInfo->totalInsertRows, + tInMs, superTblInfo->totalInsertRows, superTblInfo->totalAffectedRows, threads, db_name, superTblInfo->sTblName, - (double)superTblInfo->totalInsertRows / (t / 1000.0)); + (tInMs)? + (double)(superTblInfo->totalInsertRows/tInMs):FLT_MAX); } } else { fprintf(stderr, "Spent %.2f seconds to insert rows: %"PRIu64", affected rows: %"PRIu64" with %d thread(s) into %s %.2f records/second\n\n", - t / 1000.0, g_args.totalInsertRows, + tInMs, g_args.totalInsertRows, g_args.totalAffectedRows, threads, db_name, - (double)g_args.totalInsertRows / (t / 1000.0)); + (tInMs)? + (double)(g_args.totalInsertRows/tInMs):FLT_MAX); if (g_fpOfInsertResult) { fprintf(g_fpOfInsertResult, "Spent %.2f seconds to insert rows: %"PRIu64", affected rows: %"PRIu64" with %d thread(s) into %s %.2f records/second\n\n", - t * 1000.0, g_args.totalInsertRows, + tInMs, g_args.totalInsertRows, g_args.totalAffectedRows, threads, db_name, - (double)g_args.totalInsertRows / (t / 1000.0)); + (tInMs)? + (double)(g_args.totalInsertRows/tInMs):FLT_MAX); } } -- GitLab