vbox的更動 56529 路徑 trunk/src/VBox/Storage
- 時間撮記:
- 2015-6-18 下午03:15:17 (9 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Storage/testcase/tstVDIo.cpp
r55083 r56529 668 668 } 669 669 670 /** 671 * Returns the speed in KB/s from the amount of and the time in nanoseconds it 672 * took to complete the test. 673 * 674 * @returns Speed in KB/s 675 * @param cbIo Size of the I/O test 676 * @param tsNano Time in nanoseconds it took to complete the test. 677 */ 678 static uint64_t tstVDIoGetSpeedKBs(uint64_t cbIo, uint64_t tsNano) 679 { 680 /* 681 * Blow up the value until we can do the calculation without getting 0 as 682 * a result. 683 */ 684 uint64_t cbIoTemp = cbIo; 685 uint64_t uSpeedKBs; 686 unsigned cRounds = 0; 687 while (cbIoTemp < tsNano) 688 { 689 cbIoTemp *= 1000; 690 cRounds++; 691 } 692 693 uSpeedKBs = ((cbIoTemp / tsNano) * RT_NS_1SEC) / 1024; 694 695 while (cRounds-- > 0) 696 uSpeedKBs /= 1000; 697 698 return uSpeedKBs; 699 } 700 670 701 static DECLCALLBACK(int) vdScriptHandlerIo(PVDSCRIPTARG paScriptArgs, void *pvUser) 671 702 { … … 955 986 956 987 NanoTS = RTTimeNanoTS() - NanoTS; 957 uint64_t SpeedKBs = (uint64_t)(cbIo / (NanoTS / 1000000000.0) / 1024);988 uint64_t SpeedKBs = tstVDIoGetSpeedKBs(cbIo, NanoTS); 958 989 RTTestValue(pGlob->hTest, "Throughput", SpeedKBs, RTTESTUNIT_KILOBYTES_PER_SEC); 959 990
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器