]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
workloadgen: Add transaction throughput infos.
authorJoao Eduardo Luis <joao.luis@inktank.com>
Mon, 14 May 2012 16:53:21 +0000 (09:53 -0700)
committerSage Weil <sage@inktank.com>
Wed, 16 May 2012 19:55:32 +0000 (12:55 -0700)
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
src/test/filestore/workload_generator.cc
src/test/filestore/workload_generator.h

index 99d31b95e1ae73c2898be5c45b6b5bb7f8a8af60..dab0b4513fb6eeb41384a48c25d6168838d349ed 100644 (file)
@@ -50,6 +50,7 @@ WorkloadGenerator::WorkloadGenerator(vector<const char*> args)
     m_suppress_write_data(false), m_suppress_write_xattr_obj(false),
     m_suppress_write_xattr_coll(false), m_suppress_write_log(false),
     m_do_stats(false),
+    m_stats_finished_txs(0),
     m_stats_written_data(0), m_stats_duration(), m_stats_lock("WorldloadGenerator::m_stats_lock"),
     m_stats_show_secs(5)
 {
@@ -408,11 +409,14 @@ void WorkloadGenerator::run()
 
         // when cast to double, a utime_t behaves properly
         double throughput = (m_stats_written_data / ((double) m_stats_duration));
+        double tx_throughput (m_stats_finished_txs / ((double) m_stats_duration));
 
         dout(0) << __func__ << " written data: " << m_stats_written_data
             << " duration: " << m_stats_duration << dendl;
-        dout(0) << "Throughput  " << prettybyte_t(throughput) << "/s" << dendl;
+        dout(0) << "Throughput bandwidth " << prettybyte_t(throughput) << "/s"
+            << " transactions " << tx_throughput << "/s" << dendl;
 
+        m_stats_finished_txs = 0;
         m_stats_written_data = 0;
         m_stats_duration = utime_t();
 
index 05141a1ec601217c6d21ea450e8055d575df26bf..35426ff81ff39f9856696ccedb418ae56246cc6f 100644 (file)
@@ -77,6 +77,7 @@ class WorkloadGenerator : public TestFileStoreState {
 
   bool m_do_stats;
 
+  int m_stats_finished_txs;
   size_t m_stats_written_data;
   utime_t m_stats_duration;
   Mutex m_stats_lock;
@@ -167,6 +168,7 @@ public:
       stat_state->wrkldgen->m_stats_lock.Lock();
       stat_state->wrkldgen->m_stats_duration += taken;
       stat_state->wrkldgen->m_stats_written_data += stat_state->written_data;
+      stat_state->wrkldgen->m_stats_finished_txs ++;
       stat_state->wrkldgen->m_stats_lock.Unlock();
     }
   };