From: Sage Weil Date: Tue, 8 Jul 2008 18:07:18 +0000 (-0700) Subject: client: show read throughput in csyn read_file X-Git-Tag: v0.3~17 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fdb1212c5d813b585a894e9e8c9e45a69f0f828a;p=ceph.git client: show read throughput in csyn read_file --- diff --git a/src/client/SyntheticClient.cc b/src/client/SyntheticClient.cc index 9e1f76d3ae39..0d654700ee25 100644 --- a/src/client/SyntheticClient.cc +++ b/src/client/SyntheticClient.cc @@ -1824,7 +1824,7 @@ int SyntheticClient::write_file(string& fn, int size, int wrsize) // size is i 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; } @@ -1834,7 +1834,7 @@ int SyntheticClient::write_file(string& fn, int size, int wrsize) // size is i 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); @@ -1901,6 +1901,10 @@ int SyntheticClient::read_file(string& fn, int size, int rdsize, bool ignoreprin 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= 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; @@ -1933,7 +1948,12 @@ int SyntheticClient::read_file(string& fn, int size, int rdsize, bool ignoreprin 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;