qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kp...@apache.org
Subject svn commit: r1368541 [2/2] - in /qpid/branches/asyncstore/cpp/src: qpid/asyncStore/ qpid/asyncStore/jrnl2/ qpid/broker/ tests/ tests/storePerftools/ tests/storePerftools/asyncPerf/ tests/storePerftools/common/ tests/storePerftools/jrnlPerf/
Date Thu, 02 Aug 2012 15:31:53 GMT
Modified: qpid/branches/asyncstore/cpp/src/tests/storePerftools/common/TestParameters.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/src/tests/storePerftools/common/TestParameters.cpp?rev=1368541&r1=1368540&r2=1368541&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/src/tests/storePerftools/common/TestParameters.cpp (original)
+++ qpid/branches/asyncstore/cpp/src/tests/storePerftools/common/TestParameters.cpp Thu Aug
 2 15:31:51 2012
@@ -67,12 +67,10 @@ TestParameters::TestParameters(const Tes
         m_numDeqThreadsPerQueue(tp.m_numDeqThreadsPerQueue)
 {}
 
-TestParameters::~TestParameters()
-{}
+TestParameters::~TestParameters() {}
 
 void
-TestParameters::toStream(std::ostream& os) const
-{
+TestParameters::toStream(std::ostream& os) const {
     os << "Test Parameters:" << std::endl;
     os << "  num_msgs = " << m_numMsgs << std::endl;
     os << "  msg_size = " << m_msgSize << std::endl;
@@ -83,8 +81,7 @@ TestParameters::toStream(std::ostream& o
 
 bool
 TestParameters::parseArg(const int arg,
-                         const char* optarg)
-{
+                         const char* optarg) {
     switch(arg) {
     case 'm':
         m_numMsgs = uint32_t(std::atol(optarg));
@@ -109,8 +106,7 @@ TestParameters::parseArg(const int arg,
 
 // static
 void
-TestParameters::printArgs(std::ostream& os)
-{
+TestParameters::printArgs(std::ostream& os) {
     os << "Test parameters:" << std::endl;
     os << " -m --num_msgs:                   Number of messages to send per enqueue
thread ["
        << TestParameters::s_defaultNumMsgs << "]" << std::endl;
@@ -127,8 +123,7 @@ TestParameters::printArgs(std::ostream& 
 
 // static
 std::string
-TestParameters::shortArgs()
-{
+TestParameters::shortArgs() {
     return "m:S:q:e:d:";
 }
 

Modified: qpid/branches/asyncstore/cpp/src/tests/storePerftools/common/TestResult.h
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/src/tests/storePerftools/common/TestResult.h?rev=1368541&r1=1368540&r2=1368541&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/src/tests/storePerftools/common/TestResult.h (original)
+++ qpid/branches/asyncstore/cpp/src/tests/storePerftools/common/TestResult.h Thu Aug  2 15:31:51
2012
@@ -34,8 +34,7 @@ namespace common {
 class TestResult : public ScopedTimable, public Streamable
 {
 public:
-    TestResult();
-    virtual ~TestResult();
+    virtual ~TestResult() {}
     void toStream(std::ostream& os = std::cout) const = 0;
 };
 

Modified: qpid/branches/asyncstore/cpp/src/tests/storePerftools/common/Thread.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/src/tests/storePerftools/common/Thread.cpp?rev=1368541&r1=1368540&r2=1368541&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/src/tests/storePerftools/common/Thread.cpp (original)
+++ qpid/branches/asyncstore/cpp/src/tests/storePerftools/common/Thread.cpp Thu Aug  2 15:31:51
2012
@@ -45,21 +45,19 @@ Thread::Thread(Thread::startFn_t sf,
     PTHREAD_CHK(::pthread_create(&m_thread, NULL, sf, p), "::pthread_create", "Thread",
"Thread");
 }
 
-Thread::~Thread()
-{
+Thread::~Thread() {
     if (m_running) {
         PTHREAD_CHK(::pthread_detach(m_thread), "pthread_detach", "~Thread", "Thread");
     }
 }
 
 const std::string&
-Thread::getId() const
-{
+Thread::getId() const {
     return m_id;
 }
 
-void Thread::join()
-{
+void
+Thread::join() {
     PTHREAD_CHK(::pthread_join(m_thread, NULL), "pthread_join", "join", "Thread");
     m_running = false;
 }

Modified: qpid/branches/asyncstore/cpp/src/tests/storePerftools/common/Thread.h
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/src/tests/storePerftools/common/Thread.h?rev=1368541&r1=1368540&r2=1368541&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/src/tests/storePerftools/common/Thread.h (original)
+++ qpid/branches/asyncstore/cpp/src/tests/storePerftools/common/Thread.h Thu Aug  2 15:31:51
2012
@@ -36,7 +36,8 @@ namespace common {
 /**
  * \brief Ultra-simple pthread class.
  */
-class Thread {
+class Thread
+{
 public:
     typedef void*(*startFn_t)(void*);   ///< Thread entry point function pointer type
 

Modified: qpid/branches/asyncstore/cpp/src/tests/storePerftools/jrnlPerf/Journal.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/src/tests/storePerftools/jrnlPerf/Journal.cpp?rev=1368541&r1=1368540&r2=1368541&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/src/tests/storePerftools/jrnlPerf/Journal.cpp (original)
+++ qpid/branches/asyncstore/cpp/src/tests/storePerftools/jrnlPerf/Journal.cpp Thu Aug  2
15:31:51 2012
@@ -70,8 +70,7 @@ Journal::Journal(const uint32_t numMsgs,
         m_jrnlPtr(jrnlPtr)
 {}
 
-Journal::~Journal()
-{
+Journal::~Journal() {
     delete m_jrnlPtr;
 }
 
@@ -80,8 +79,7 @@ Journal::~Journal()
 // This method will be called by multiple threads simultaneously
 // Enqueue thread entry point
 void*
-Journal::runEnqueues()
-{
+Journal::runEnqueues() {
     bool misfireFlag = false;
     uint32_t i = 0;
     while (i < m_numMsgs) {
@@ -122,8 +120,7 @@ Journal::runEnqueues()
 // This method will be called by multiple threads simultaneously
 // Dequeue thread entry point
 void*
-Journal::runDequeues()
-{
+Journal::runDequeues() {
     uint32_t i = 0;
     X_JRNL_IO_OP_RES jrnlIoRes;
     while (i < m_numMsgs) {
@@ -170,23 +167,20 @@ Journal::runDequeues()
 
 //static
 void*
-Journal::startEnqueues(void* ptr)
-{
+Journal::startEnqueues(void* ptr) {
     return reinterpret_cast<Journal*>(ptr)->runEnqueues();
 }
 
 //static
 void*
-Journal:: startDequeues(void* ptr)
-{
+Journal:: startDequeues(void* ptr) {
     return reinterpret_cast<Journal*>(ptr)->runDequeues();
 }
 
 // *** MUST BE THREAD-SAFE ****
 // This method will be called by multiple threads simultaneously
 void
-Journal::X_AIO_WR_CALLBACK(std::vector<X_DATA_TOKEN*>& msgTokenList)
-{
+Journal::X_AIO_WR_CALLBACK(std::vector<X_DATA_TOKEN*>& msgTokenList) {
     X_DATA_TOKEN* mtokPtr;
     while (msgTokenList.size()) {
         mtokPtr = msgTokenList.back();
@@ -212,7 +206,6 @@ Journal::X_AIO_WR_CALLBACK(std::vector<X
 // *** MUST BE THREAD-SAFE ****
 // This method will be called by multiple threads simultaneously
 void
-Journal::X_AIO_RD_CALLBACK(std::vector<uint16_t>& /*buffPageCtrlBlkIndexList*/)
-{}
+Journal::X_AIO_RD_CALLBACK(std::vector<uint16_t>& /*buffPageCtrlBlkIndexList*/)
{}
 
 }}} // namespace tests::storePerftools::jrnlPerf

Modified: qpid/branches/asyncstore/cpp/src/tests/storePerftools/jrnlPerf/Journal.h
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/src/tests/storePerftools/jrnlPerf/Journal.h?rev=1368541&r1=1368540&r2=1368541&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/src/tests/storePerftools/jrnlPerf/Journal.h (original)
+++ qpid/branches/asyncstore/cpp/src/tests/storePerftools/jrnlPerf/Journal.h Thu Aug  2 15:31:51
2012
@@ -161,7 +161,6 @@ private:
     std::vector<X_DATA_TOKEN*> m_unprocCallbacks;   ///< List of unprocessed callbacks
to be dequeued
     X_SCOPED_MUTEX m_unprocCallbacksMutex;          ///< Mutex which protects the unprocessed
callback queue
 
-
 };
 
 }}} // namespace tests::storePerftools::jrnlPerf

Modified: qpid/branches/asyncstore/cpp/src/tests/storePerftools/jrnlPerf/JournalParameters.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/src/tests/storePerftools/jrnlPerf/JournalParameters.cpp?rev=1368541&r1=1368540&r2=1368541&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/src/tests/storePerftools/jrnlPerf/JournalParameters.cpp (original)
+++ qpid/branches/asyncstore/cpp/src/tests/storePerftools/jrnlPerf/JournalParameters.cpp Thu
Aug  2 15:31:51 2012
@@ -93,12 +93,10 @@ JournalParameters::JournalParameters(con
 #endif
 {}
 
-JournalParameters::~JournalParameters()
-{}
+JournalParameters::~JournalParameters() {}
 
 void
-JournalParameters::toStream(std::ostream& os) const
-{
+JournalParameters::toStream(std::ostream& os) const {
     os << "Journal Parameters:" << std::endl;
     os << "  jrnlDir = \"" << m_jrnlDir << "\"" << std::endl;
     os << "  jrnlBaseFileName = \"" << m_jrnlBaseFileName << "\"" <<
std::endl;
@@ -110,8 +108,7 @@ JournalParameters::toStream(std::ostream
 
 bool
 JournalParameters::parseArg(const int arg,
-                            const char* optarg)
-{
+                            const char* optarg) {
     switch(arg) {
     case 'j':
         m_jrnlDir.assign(optarg);
@@ -139,8 +136,7 @@ JournalParameters::parseArg(const int ar
 
 // static
 void
-JournalParameters::printArgs(std::ostream& os)
-{
+JournalParameters::printArgs(std::ostream& os) {
     os << "Journal parameters:" << std::endl;
     os << " -j --jrnl_dir:                   Store directory [\""
        << JournalParameters::s_defaultJrnlDir << "\"]" << std::endl;
@@ -158,8 +154,7 @@ JournalParameters::printArgs(std::ostrea
 
 // static
 std::string
-JournalParameters::shortArgs()
-{
+JournalParameters::shortArgs() {
     return "j:b:f:s:p:c:";
 }
 

Modified: qpid/branches/asyncstore/cpp/src/tests/storePerftools/jrnlPerf/PerfTest.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/src/tests/storePerftools/jrnlPerf/PerfTest.cpp?rev=1368541&r1=1368540&r2=1368541&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/src/tests/storePerftools/jrnlPerf/PerfTest.cpp (original)
+++ qpid/branches/asyncstore/cpp/src/tests/storePerftools/jrnlPerf/PerfTest.cpp Thu Aug  2
15:31:51 2012
@@ -66,15 +66,13 @@ PerfTest::PerfTest(const tests::storePer
         m_msgData(new char[tp.m_msgSize])
 {}
 
-PerfTest::~PerfTest()
-{
+PerfTest::~PerfTest() {
     delete[] m_msgData;
 }
 
 // private
 void
-PerfTest::prepareJournals(std::vector<Journal*>& jrnlList)
-{
+PerfTest::prepareJournals(std::vector<Journal*>& jrnlList) {
 #ifdef JOURNAL2
     if (qpid::asyncStore::jrnl2::JournalDirectory::s_exists(m_jrnlParams.m_jrnlDir)) {
         qpid::asyncStore::jrnl2::JournalDirectory::s_destroy(m_jrnlParams.m_jrnlDir);
@@ -114,8 +112,7 @@ PerfTest::prepareJournals(std::vector<Jo
 
 // private
 void
-PerfTest::destroyJournals(std::vector<Journal*>& jrnlList)
-{
+PerfTest::destroyJournals(std::vector<Journal*>& jrnlList) {
     while (jrnlList.size()) {
         delete jrnlList.back();
         jrnlList.pop_back();
@@ -123,8 +120,7 @@ PerfTest::destroyJournals(std::vector<Jo
 }
 
 void
-PerfTest::run()
-{
+PerfTest::run() {
     std::vector<Journal*> jrnlList;
     prepareJournals(jrnlList);
 
@@ -154,16 +150,14 @@ PerfTest::run()
 }
 
 void
-PerfTest::toStream(std::ostream& os) const
-{
+PerfTest::toStream(std::ostream& os) const {
     os << m_testParams << std::endl;
     os << m_jrnlParams << std::endl;
     os << m_testResult << std::endl;
 }
 
 void
-printArgs(std::ostream& os)
-{
+printArgs(std::ostream& os) {
     os << " -h --help:                       This help message" << std::endl;
     os << std::endl;
 
@@ -178,8 +172,7 @@ bool
 readArgs(int argc,
          char** argv,
          tests::storePerftools::common::TestParameters& tp,
-         JournalParameters& jp)
-{
+         JournalParameters& jp) {
     /// \todo TODO: At some point, find an easy way to aggregate these from JrnlPerfTestParameters
and JrnlParameters themselves.
     static struct option long_options[] = {
         {"help", no_argument, 0, 'h'},
@@ -231,8 +224,7 @@ readArgs(int argc,
 // -----------------------------------------------------------------
 
 int
-main(int argc, char** argv)
-{
+main(int argc, char** argv) {
     tests::storePerftools::common::TestParameters tp;
     tests::storePerftools::jrnlPerf::JournalParameters jp;
     if (tests::storePerftools::jrnlPerf::readArgs(argc, argv, tp, jp)) return 1;

Modified: qpid/branches/asyncstore/cpp/src/tests/storePerftools/jrnlPerf/TestResult.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/src/tests/storePerftools/jrnlPerf/TestResult.cpp?rev=1368541&r1=1368540&r2=1368541&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/src/tests/storePerftools/jrnlPerf/TestResult.cpp (original)
+++ qpid/branches/asyncstore/cpp/src/tests/storePerftools/jrnlPerf/TestResult.cpp Thu Aug
 2 15:31:51 2012
@@ -34,12 +34,10 @@ TestResult::TestResult(const tests::stor
         m_testParams(tp)
 {}
 
-TestResult::~TestResult()
-{}
+TestResult::~TestResult() {}
 
 void
-TestResult::toStream(std::ostream& os) const
-{
+TestResult::toStream(std::ostream& os) const {
     double msgsRate;
     os << "TEST RESULTS:" << std::endl;
     os << "         Msgs per thread: " << m_testParams.m_numMsgs << std::endl;

Added: qpid/branches/asyncstore/cpp/src/tests/storePerftools/storePerftoolsSmokeTest.sh
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/src/tests/storePerftools/storePerftoolsSmokeTest.sh?rev=1368541&view=auto
==============================================================================
--- qpid/branches/asyncstore/cpp/src/tests/storePerftools/storePerftoolsSmokeTest.sh (added)
+++ qpid/branches/asyncstore/cpp/src/tests/storePerftools/storePerftoolsSmokeTest.sh Thu Aug
 2 15:31:51 2012
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+run_test() {
+    local cmd=$1
+    echo $cmd
+    $cmd
+    if (( $? != 0 )); then
+        exit 1
+    fi    
+}
+
+NUM_MSGS=1000
+TEST_PROG="./asyncStorePerf"
+
+run_test "${TEST_PROG}"
+run_test "${TEST_PROG} --help"
+for q in 1 2; do
+    for p in 1 2; do
+        for c in 1 2; do
+            for e in 0 1 3; do
+                for d in 0 1 3; do
+                    for dur in "" "--durable"; do
+                        run_test "${TEST_PROG} --num-queues $q --num-msgs ${NUM_MSGS} --num-producers
$p --num-consumers $c --enq-txn-size $e --deq-txn-size $d ${dur}"
+                    done
+                done
+            done
+        done
+    done
+done
+
+
+NUM_MSGS=1000
+TEST_PROG="./jrnl2Perf"
+
+
+run_test "${TEST_PROG}"
+
+# This test returns 1, don't use run_test until this is fixed.
+cmd="${TEST_PROG} --help"
+echo $cmd
+$cmd
+
+for q in 1 2; do
+    for p in 1 2; do
+        for c in 1; do # BUG - this will fail for c > 1
+            run_test "./jrnl2Perf --num_queues $q --num_msgs ${NUM_MSGS} --num_enq_threads_per_queue
$p --num_deq_threads_per_queue $c"
+        done
+    done
+done
+
+#exit 0

Propchange: qpid/branches/asyncstore/cpp/src/tests/storePerftools/storePerftoolsSmokeTest.sh
------------------------------------------------------------------------------
    svn:executable = *

Modified: qpid/branches/asyncstore/cpp/src/tests/storePerftools/version.h
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/src/tests/storePerftools/version.h?rev=1368541&r1=1368540&r2=1368541&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/src/tests/storePerftools/version.h (original)
+++ qpid/branches/asyncstore/cpp/src/tests/storePerftools/version.h Thu Aug  2 15:31:51 2012
@@ -31,8 +31,8 @@ namespace tests {
 namespace storePerftools {
 
 static const int versionMajor = 0;
-static const int versionMinor = 0;
-static const int versionRevision = 1;
+static const int versionMinor = 1;
+static const int versionRevision = 0;
 
 std::string name() {
     return "Qpid async store perftools";



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message