- Timestamp:
- Jan 18, 2022 11:25:24 AM (3 years ago)
- Location:
- trunk/src/VBox/ValidationKit
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testboxscript/TestBoxHelper.cpp
r93115 r93302 146 146 uint64_t cNsInterval = nsNow - nsStat; 147 147 uint64_t cbInterval = cbWritten - cbStatWritten; 148 uint64_t cbIntervalPerSec = cbInterval ? (uint64_t)(cbInterval / (cNsInterval / (double)RT_NS_1SEC)) : 0; 148 uint64_t cbIntervalPerSec = !cbInterval ? 0 149 : (uint64_t)((double)cbInterval / ((double)cNsInterval / (double)RT_NS_1SEC)); 149 150 150 151 RTPrintf("%s: %'9RTfoff MiB out of %'9RTfoff are free after writing %'9RU64 MiB (%'5RU64 MiB/s)\n", … … 173 174 /* Issue a summary statements. */ 174 175 uint64_t cNsElapsed = RTTimeNanoTS() - nsStart; 175 uint64_t cbPerSec = cbWritten ? (uint64_t)( cbWritten / (cNsElapsed / (double)RT_NS_1SEC)) : 0;176 uint64_t cbPerSec = cbWritten ? (uint64_t)((double)cbWritten / ((double)cNsElapsed / (double)RT_NS_1SEC)) : 0; 176 177 RTPrintf("%s: Wrote %'RU64 MiB in %'RU64 s, avg %'RU64 MiB/s.\n", 177 178 pszFilename, cbWritten / _1M, cNsElapsed / RT_NS_1SEC, cbPerSec / _1M); -
trunk/src/VBox/ValidationKit/utils/cpu/cpu-alloc-all-mem.cpp
r93115 r93302 153 153 uPrintTS = uEndTS; 154 154 155 uint32_t cMBPerSec = (uint32_t)( cbTotal / ((double)cNsElapsed / RT_NS_1SEC) / _1M);155 uint32_t cMBPerSec = (uint32_t)((long double)cbTotal / ((long double)cNsElapsed / RT_NS_1SEC) / _1M); 156 156 RTTestPrintf(hTest, RTTESTLVL_ALWAYS, "%'zu bytes in %'llu ns - %'u MB/s\n", 157 157 cbTotal, cNsElapsed, cMBPerSec); … … 189 189 RTTestValue(hTest, "amount", cbTotal, RTTESTUNIT_BYTES); 190 190 RTTestValue(hTest, "time", cNsElapsed, RTTESTUNIT_NS); 191 uint32_t cMBPerSec = (uint32_t)( cbTotal / ((double)cNsElapsed / RT_NS_1SEC) / _1M);191 uint32_t cMBPerSec = (uint32_t)((long double)cbTotal / ((long double)cNsElapsed / RT_NS_1SEC) / _1M); 192 192 RTTestValue(hTest, "speed", cMBPerSec, RTTESTUNIT_MEGABYTES_PER_SEC); 193 193 RTTestSubDone(hTest); -
trunk/src/VBox/ValidationKit/utils/fs/FsPerf.cpp
r93115 r93302 4508 4508 RTTestIValueF(ns / iIteration, \ 4509 4509 RTTESTUNIT_NS_PER_OCCURRENCE, a_szOperation "/seq/%RU32 latency", cbBlock); \ 4510 RTTestIValueF((uint64_t)(( uint64_t)iIteration * cbBlock/ ((double)ns / RT_NS_1SEC)), \4510 RTTestIValueF((uint64_t)((double)(iIteration * cbBlock) / ((double)ns / RT_NS_1SEC)), \ 4511 4511 RTTESTUNIT_BYTES_PER_SEC, a_szOperation "/seq/%RU32 throughput", cbBlock); \ 4512 4512 RTTestIValueF(iIteration, \ … … 6106 6106 RTTestIValueF(ns / iIteration, \ 6107 6107 RTTESTUNIT_NS_PER_OCCURRENCE, a_szOperation " latency"); \ 6108 RTTestIValueF((uint64_t)(( uint64_t)iIteration * cbFile/ ((double)ns / RT_NS_1SEC)), \6108 RTTestIValueF((uint64_t)((double)(iIteration * cbFile) / ((double)ns / RT_NS_1SEC)), \ 6109 6109 RTTESTUNIT_BYTES_PER_SEC, a_szOperation " throughput"); \ 6110 6110 RTTestIValueF((uint64_t)iIteration * cbFile, \ -
trunk/src/VBox/ValidationKit/utils/network/NetPerf.cpp
r93115 r93302 489 489 RTTestIValue("Sends", pSendStats->cTx, RTTESTUNIT_PACKETS); 490 490 RTTestIValue("Send Interval", pSendStats->cNsElapsed, RTTESTUNIT_NS); 491 RTTestIValue("Send Throughput", (uint64_t)( cbPacket * pSendStats->cTx/ rdSecElapsed), RTTESTUNIT_BYTES_PER_SEC);492 RTTestIValue("Send Rate", (uint64_t)( pSendStats->cTx / rdSecElapsed), RTTESTUNIT_PACKETS_PER_SEC);493 RTTestIValue("Send Latency", (uint64_t)(rdSecElapsed / pSendStats->cTx * 1000000000.0), RTTESTUNIT_NS_PER_PACKET);491 RTTestIValue("Send Throughput", (uint64_t)((double)(cbPacket * pSendStats->cTx) / rdSecElapsed), RTTESTUNIT_BYTES_PER_SEC); 492 RTTestIValue("Send Rate", (uint64_t)((double)pSendStats->cTx / rdSecElapsed), RTTESTUNIT_PACKETS_PER_SEC); 493 RTTestIValue("Send Latency", (uint64_t)(rdSecElapsed / (double)pSendStats->cTx * 1000000000.0), RTTESTUNIT_NS_PER_PACKET); 494 494 } 495 495 … … 499 499 RTTestIValue("Receives", pRecvStats->cRx, RTTESTUNIT_PACKETS); 500 500 RTTestIValue("Receive Interval", pRecvStats->cNsElapsed, RTTESTUNIT_NS); 501 RTTestIValue("Receive Throughput", (uint64_t)( cbPacket * pRecvStats->cRx/ rdSecElapsed), RTTESTUNIT_BYTES_PER_SEC);502 RTTestIValue("Receive Rate", (uint64_t)( pRecvStats->cRx / rdSecElapsed), RTTESTUNIT_PACKETS_PER_SEC);503 RTTestIValue("Receive Latency", (uint64_t)(rdSecElapsed / pRecvStats->cRx * 1000000000.0), RTTESTUNIT_NS_PER_PACKET);501 RTTestIValue("Receive Throughput", (uint64_t)((double)(cbPacket * pRecvStats->cRx) / rdSecElapsed), RTTESTUNIT_BYTES_PER_SEC); 502 RTTestIValue("Receive Rate", (uint64_t)((double)pRecvStats->cRx / rdSecElapsed), RTTESTUNIT_PACKETS_PER_SEC); 503 RTTestIValue("Receive Latency", (uint64_t)(rdSecElapsed / (double)pRecvStats->cRx * 1000000000.0), RTTESTUNIT_NS_PER_PACKET); 504 504 } 505 505 } … … 755 755 RTTestIValue("Interval", pStats->cNsElapsed, RTTESTUNIT_NS); 756 756 RTTestIValue("Packet size", cbPacket, RTTESTUNIT_BYTES); 757 RTTestIValue("Average rate", (uint64_t)( pStats->cEchos / rdSecElapsed), RTTESTUNIT_PACKETS_PER_SEC);758 RTTestIValue("Average throughput", (uint64_t)( cbPacket * pStats->cEchos/ rdSecElapsed), RTTESTUNIT_BYTES_PER_SEC);759 RTTestIValue("Average latency", (uint64_t)(rdSecElapsed / pStats->cEchos * 1000000000.0), RTTESTUNIT_NS_PER_ROUND_TRIP);757 RTTestIValue("Average rate", (uint64_t)((double)pStats->cEchos / rdSecElapsed), RTTESTUNIT_PACKETS_PER_SEC); 758 RTTestIValue("Average throughput", (uint64_t)((double)(cbPacket * pStats->cEchos) / rdSecElapsed), RTTESTUNIT_BYTES_PER_SEC); 759 RTTestIValue("Average latency", (uint64_t)(rdSecElapsed / (double)pStats->cEchos * 1000000000.0), RTTESTUNIT_NS_PER_ROUND_TRIP); 760 760 RTTestISubDone(); 761 761 } -
trunk/src/VBox/ValidationKit/utils/nt/nttimesources.cpp
r93115 r93302 212 212 /* Recalc to micro seconds. */ 213 213 uint64_t u64MicroSecMs = (uint64_t)cMsTicks * 1000; 214 uint64_t u64MicroSecTsc = u64TscHz ? (long double)cTscTicks / u64TscHz * 1000000 : u64MicroSecMs; 214 uint64_t u64MicroSecTsc = u64TscHz ? (long double)cTscTicks / (long double)u64TscHz * 1000000 : u64MicroSecMs; 215 uint64_t u64MicroSecPrf = (long double)cPrfTicks.QuadPart / (long double)PrfHz.QuadPart * 1000000; 215 216 uint64_t u64MicroSecInt = cIntTicks.QuadPart / 10; /* 100ns units*/ 216 uint64_t u64MicroSecPrf = (long double)cPrfTicks.QuadPart / PrfHz.QuadPart * 1000000;217 217 218 218 /* check how much they differ using the millisecond tick count as the standard candle. */ -
trunk/src/VBox/ValidationKit/utils/storage/IoPerf.cpp
r93115 r93302 816 816 817 817 /* Get average bandwidth for the job. */ 818 RTTestIValueF((uint64_t)( pJob->cbTestSet / ((double)nsJobRuntime / RT_NS_1SEC)),818 RTTestIValueF((uint64_t)((double)pJob->cbTestSet / ((double)nsJobRuntime / RT_NS_1SEC)), 819 819 RTTESTUNIT_BYTES_PER_SEC, "%s/Job/%RU32/AvgBandwidth", pszTest, pJob->idJob); 820 820
Note:
See TracChangeset
for help on using the changeset viewer.