Changeset 43507 in vbox for trunk/src/VBox/Main/testcase/tstCollector.cpp
- Timestamp:
- Oct 2, 2012 1:22:31 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 81089
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/testcase/tstCollector.cpp
r43445 r43507 145 145 { 146 146 pm::CollectorHints hints; 147 uint64_t hostRxStart, hostTxStart , speedStart;148 uint64_t hostRxStop, hostTxStop, speed Stop;147 uint64_t hostRxStart, hostTxStart; 148 uint64_t hostRxStop, hostTxStop, speed = 125000000; /* Assume 1Gbit/s */ 149 149 150 150 RTPrintf("\ntstCollector: TESTING - Network load, sleeping for 5 sec...\n"); … … 156 156 return 1; 157 157 } 158 rc = collector->getRawHostNetworkLoad("eth0", &hostRxStart, &hostTxStart , &speedStart);158 rc = collector->getRawHostNetworkLoad("eth0", &hostRxStart, &hostTxStart); 159 159 if (RT_FAILURE(rc)) 160 160 { … … 171 171 return 1; 172 172 } 173 rc = collector->getRawHostNetworkLoad("eth0", &hostRxStop, &hostTxStop , &speedStop);173 rc = collector->getRawHostNetworkLoad("eth0", &hostRxStop, &hostTxStop); 174 174 if (RT_FAILURE(rc)) 175 175 { … … 177 177 return 1; 178 178 } 179 if (speedStart != speedStop)180 RTPrintf("tstCollector: getRawHostNetworkLoad() returned different bandwidth (%llu != %llu)\n", speedStart, speedStop);181 179 RTPrintf("tstCollector: host network speed = %llu bytes/sec (%llu mbit/sec)\n", 182 speed Stop, speedStop/(1000000/8));180 speed, speed/(1000000/8)); 183 181 RTPrintf("tstCollector: host network rx = %llu bytes/sec (%llu mbit/sec, %d %%*100)\n", 184 182 (hostRxStop - hostRxStart)/5, (hostRxStop - hostRxStart)/(5000000/8), 185 (hostRxStop - hostRxStart) * 10000 / (speed Stop* 5));183 (hostRxStop - hostRxStart) * 10000 / (speed * 5)); 186 184 RTPrintf("tstCollector: host network tx = %llu bytes/sec (%llu mbit/sec, %d %%*100)\n", 187 185 (hostTxStop - hostTxStart)/5, (hostTxStop - hostTxStart)/(5000000/8), 188 (hostTxStop - hostTxStart) * 10000 / (speed Stop* 5));186 (hostTxStop - hostTxStart) * 10000 / (speed * 5)); 189 187 190 188 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.