utime_t now = g_clock.now();
if (now - from >= 1.0) {
double el = now - from;
- dout(0) << (bytes / el / 1048576.0) << " MB/sec" << dendl;
+ dout(0) << "write " << (bytes / el / 1048576.0) << " MB/sec" << dendl;
from = now;
bytes = 0;
}
utime_t stop = g_clock.now();
double el = stop - start;
- dout(0) << "total " << (total / el / 1048576.0) << " MB/sec ("
+ dout(0) << "write total " << (total / el / 1048576.0) << " MB/sec ("
<< total << " bytes in " << el << " seconds)" << dendl;
client->close(fd);
dout(5) << "reading from " << fn << " fd " << fd << dendl;
if (fd < 0) return fd;
+ utime_t from = g_clock.now();
+ utime_t start = from;
+ __u64 bytes = 0, total = 0;
+
for (unsigned i=0; i<chunks; i++) {
if (time_to_stop()) break;
dout(2) << "reading block " << i << "/" << chunks << dendl;
break;
}
+ bytes += rdsize;
+ total += rdsize;
+
+ utime_t now = g_clock.now();
+ if (now - from >= 1.0) {
+ double el = now - from;
+ dout(0) << "read " << (bytes / el / 1048576.0) << " MB/sec" << dendl;
+ from = now;
+ bytes = 0;
+ }
+
// verify fingerprint
int bad = 0;
uint64_t *p = (uint64_t*)buf;
if (bad && !ignoreprint)
dout(0) << " + " << (bad-1) << " other bad 16-byte bits in this block" << dendl;
}
-
+
+ utime_t stop = g_clock.now();
+ double el = stop - start;
+ dout(0) << "read total " << (total / el / 1048576.0) << " MB/sec ("
+ << total << " bytes in " << el << " seconds)" << dendl;
+
client->close(fd);
delete[] buf;