diff options
author | Sage Weil <sage.weil@dreamhost.com> | 2012-01-28 21:35:52 +0100 |
---|---|---|
committer | Sage Weil <sage.weil@dreamhost.com> | 2012-02-05 02:44:24 +0100 |
commit | b7c20e77723d7d657b679c69d1fdc6595ecac486 (patch) | |
tree | 57a4e3b7d21c19fd103b5f9001ed0405d9c7a0da /src/streamtest.cc | |
parent | client: init/shutdown objecter in init/shutdown (diff) | |
download | ceph-b7c20e77723d7d657b679c69d1fdc6595ecac486.tar.xz ceph-b7c20e77723d7d657b679c69d1fdc6595ecac486.zip |
streamtest: show total throughput, avg latencies
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Diffstat (limited to 'src/streamtest.cc')
-rw-r--r-- | src/streamtest.cc | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/streamtest.cc b/src/streamtest.cc index c7b4c54b047..be0863ce01a 100644 --- a/src/streamtest.cc +++ b/src/streamtest.cc @@ -40,12 +40,20 @@ void throttle() cond.Wait(lock); } } + +double total_ack = 0; +double total_commit = 0; +int total_num = 0; + void pr(off_t off) { io &i = writes[off]; - cout << off << "\t" + if (false) cout << off << "\t" << (i.ack - i.start) << "\t" << (i.commit - i.start) << std::endl; + total_num++; + total_ack += (i.ack - i.start); + total_commit += (i.commit - i.start); writes.erase(off); cond.Signal(); } @@ -140,6 +148,7 @@ int main(int argc, const char **argv) fs->apply_transaction(ft); utime_t now = ceph_clock_now(g_ceph_context); + utime_t start = now; utime_t end = now; end += seconds; off_t pos = 0; @@ -156,6 +165,8 @@ int main(int argc, const char **argv) throttle(); + now = ceph_clock_now(g_ceph_context); + // wait? /* utime_t next = start; @@ -169,6 +180,11 @@ int main(int argc, const char **argv) */ } + cout << "total num " << total_num << std::endl; + cout << "avg ack\t" << (total_ack / (double)total_num) << std::endl; + cout << "avg commit\t" << (total_commit / (double)total_num) << std::endl; + cout << "tput\t" << prettybyte_t((double)(total_num * bytes) / (double)(end-start)) << "/sec" << std::endl; + fs->umount(); } |