VirtualBox

Changeset 64616 in vbox for trunk/src/VBox/ValidationKit


Ignore:
Timestamp:
Nov 9, 2016 4:28:31 PM (8 years ago)
Author:
vboxsync
Message:

wipefreespace: quick update of the status output.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testboxscript/TestBoxHelper.cpp

    r64608 r64616  
    8787        if (RT_SUCCESS(rc))
    8888        {
    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);
    9090
    9191            /*
    9292             * Start filling up the free space, down to the last 32MB.
    9393             */
     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 */
    9497            RTFOFF const    cbMinLeft     = RT_MAX(cbMinLeftOpt, cbFiller * 2);
    9598            RTFOFF          cbLeftToWrite = cbFree - cbMinLeft;
     
    102105                {
    103106                    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);
    105108                    else
    106109                        rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: Write error after %'RU64 bytes: %Rrc\n",
     
    123126                    RTFOFF cbFreeUpdated;
    124127                    if (fFileHandleApiSupported)
     128                        rc = RTFileQueryFsSizes(hFile, NULL, &cbFreeUpdated, NULL, NULL);
     129                    else
    125130                        rc = RTFsQuerySizes(pszFilename, NULL, &cbFreeUpdated, NULL, NULL);
    126                     else
    127                         rc = RTFileQueryFsSizes(hFile, NULL, &cbFreeUpdated, NULL, NULL);
    128131                    if (RT_SUCCESS(rc))
    129132                    {
     
    138141                    }
    139142                    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                    }
    142154                }
    143155            }
     
    157169                rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: Failed to reduce file size from %'RU64 to %'RU64 bytes: %Rrc\n",
    158170                                        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);
    159177        }
    160178        else
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette