Changeset 64616 in vbox for trunk/src/VBox/ValidationKit
- Timestamp:
- Nov 9, 2016 4:28:31 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testboxscript/TestBoxHelper.cpp
r64608 r64616 87 87 if (RT_SUCCESS(rc)) 88 88 { 89 RTPrintf("%s: %' RTfoff bytes out of %'RTfoff are free\n", pszFilename, cbFree, cbTotal);89 RTPrintf("%s: %'9RTfoff MiB out of %'9RTfoff are free\n", pszFilename, cbFree / _1M, cbTotal / _1M); 90 90 91 91 /* 92 92 * Start filling up the free space, down to the last 32MB. 93 93 */ 94 uint64_t const nsStart = RTTimeNanoTS(); /* for speed calcs */ 95 uint64_t nsStat = nsStart; /* for speed calcs */ 96 uint64_t cbStatWritten = 0; /* for speed calcs */ 94 97 RTFOFF const cbMinLeft = RT_MAX(cbMinLeftOpt, cbFiller * 2); 95 98 RTFOFF cbLeftToWrite = cbFree - cbMinLeft; … … 102 105 { 103 106 if (rc == VERR_DISK_FULL) 104 RTPrintf("%s: Disk full after writing %' RU64 bytes\n", pszFilename, cbWritten);107 RTPrintf("%s: Disk full after writing %'9RU64 MiB\n", pszFilename, cbWritten / _1M); 105 108 else 106 109 rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: Write error after %'RU64 bytes: %Rrc\n", … … 123 126 RTFOFF cbFreeUpdated; 124 127 if (fFileHandleApiSupported) 128 rc = RTFileQueryFsSizes(hFile, NULL, &cbFreeUpdated, NULL, NULL); 129 else 125 130 rc = RTFsQuerySizes(pszFilename, NULL, &cbFreeUpdated, NULL, NULL); 126 else127 rc = RTFileQueryFsSizes(hFile, NULL, &cbFreeUpdated, NULL, NULL);128 131 if (RT_SUCCESS(rc)) 129 132 { … … 138 141 } 139 142 if ((iLoop & (512 - 1)) == 0) 140 RTPrintf("%s: %'RTfoff bytes out of %'RTfoff are free after writing %'RU64 bytes\n", 141 pszFilename, cbFree, cbTotal, cbWritten); 143 { 144 uint64_t const nsNow = RTTimeNanoTS(); 145 uint64_t cNsInterval = nsNow - nsStat; 146 uint64_t cbInterval = cbWritten - cbStatWritten; 147 uint64_t cbIntervalPerSec = cbInterval ? (uint64_t)(cbInterval / (cNsInterval / (double)RT_NS_1SEC)) : 0; 148 149 RTPrintf("%s: %'9RTfoff MiB out of %'9RTfoff are free after writing %'9RU64 MiB (%'5RU64 MiB/s)\n", 150 pszFilename, cbFree / _1M, cbTotal / _1M, cbWritten / _1M, cbIntervalPerSec / _1M); 151 nsStat = nsNow; 152 cbStatWritten = cbWritten; 153 } 142 154 } 143 155 } … … 157 169 rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: Failed to reduce file size from %'RU64 to %'RU64 bytes: %Rrc\n", 158 170 pszFilename, cbWritten, cbReduced, rc); 171 172 /* Issue a summary statements. */ 173 uint64_t cNsElapsed = RTTimeNanoTS() - nsStart; 174 uint64_t cbPerSec = cbWritten ? (uint64_t)(cbWritten / (cNsElapsed / (double)RT_NS_1SEC)) : 0; 175 RTPrintf("%s: Wrote %'RU64 MiB in %'RU64 s, avg %'RU64 MiB/s.\n", 176 pszFilename, cbWritten / _1M, cNsElapsed / RT_NS_1SEC, cbPerSec / _1M); 159 177 } 160 178 else
Note:
See TracChangeset
for help on using the changeset viewer.