Author: kpvdr
Date: 2010-12-03 16:03:35 -0500 (Fri, 03 Dec 2010)
New Revision: 4423
Added:
store/trunk/cpp/lib/jrnl2/JournalParameters.cpp
store/trunk/cpp/lib/jrnl2/JournalParameters.hpp
store/trunk/cpp/perf/ScopedPerformanceTimer.cpp
store/trunk/cpp/perf/ScopedPerformanceTimer.hpp
Removed:
store/trunk/cpp/lib/jrnl2/store_params.cpp
store/trunk/cpp/lib/jrnl2/store_params.hpp
store/trunk/cpp/perf/PerformanceTimer.cpp
store/trunk/cpp/perf/PerformanceTimer.hpp
Modified:
store/trunk/cpp/lib/jrnl2/
store/trunk/cpp/lib/jrnl2/Makefile.am
store/trunk/cpp/lib/jrnl2/dtok.hpp
store/trunk/cpp/lib/jrnl2/jexception.hpp
store/trunk/cpp/lib/jrnl2/jrnl.cpp
store/trunk/cpp/lib/jrnl2/jrnl.hpp
store/trunk/cpp/m4/
store/trunk/cpp/perf/JournalInstance.cpp
store/trunk/cpp/perf/JournalInstance.hpp
store/trunk/cpp/perf/JournalParameters.cpp
store/trunk/cpp/perf/JournalParameters.hpp
store/trunk/cpp/perf/Makefile.am
store/trunk/cpp/perf/StorePerformanceTest.cpp
store/trunk/cpp/perf/StorePerformanceTest.hpp
store/trunk/cpp/perf/TestParameters.cpp
store/trunk/cpp/perf/TestParameters.hpp
store/trunk/cpp/perf/m
Log:
Further updates to perf and jrnl2 dirs
Property changes on: store/trunk/cpp/lib/jrnl2
___________________________________________________________________
Name: svn:ignore
+ Makefile
Makefile.in
.deps
Copied: store/trunk/cpp/lib/jrnl2/JournalParameters.cpp (from rev 4420,
store/trunk/cpp/lib/jrnl2/store_params.cpp)
===================================================================
--- store/trunk/cpp/lib/jrnl2/JournalParameters.cpp (rev 0)
+++ store/trunk/cpp/lib/jrnl2/JournalParameters.cpp 2010-12-03 21:03:35 UTC (rev 4423)
@@ -0,0 +1,109 @@
+/**
+ * \file JournalParameters.cpp
+ *
+ * Qpid asynchronous store plugin library
+ *
+ * This file contains performance test code for the journal.
+ *
+ * \author Kim van der Riet
+ *
+ * Copyright (c) 2010 Red Hat, Inc.
+ *
+ * This file is part of the Qpid async store library msgstore.so.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ *
+ * The GNU Lesser General Public License is available in the file COPYING.
+ */
+
+#include "JournalParameters.hpp"
+
+#include <sstream>
+
+namespace mrg
+{
+namespace journal2
+{
+
+// static declarations
+std::string JournalParameters::_s_defaultJrnlDir = "/tmp/store";
+std::string JournalParameters::_s_defaultJrnlBaseFileName = "JournalData";
+u_int16_t JournalParameters::_s_defaultNumJrnlFiles = 8;
+u_int32_t JournalParameters::_s_defaultJrnlFileSize_sblks = 3072;
+bool JournalParameters::_s_defaultAutoExpand = false;
+u_int16_t JournalParameters::_s_defaultAutoExpandMaxJrnlFiles = 0;
+u_int16_t JournalParameters::_s_defaultWriteBuffNumPgs = 32;
+u_int32_t JournalParameters::_s_defaultWriteBuffPgSize_sblks = 128;
+
+JournalParameters::JournalParameters() :
+ _jrnlDir(_s_defaultJrnlDir),
+ _jrnlBaseFileName(_s_defaultJrnlBaseFileName),
+ _numJrnlFiles(_s_defaultNumJrnlFiles),
+ _jrnlFileSize_sblks(_s_defaultJrnlFileSize_sblks),
+ _autoExpand(_s_defaultAutoExpand),
+
_autoExpandMaxJrnlFiles(_s_defaultAutoExpandMaxJrnlFiles),
+ _writeBuffNumPgs(_s_defaultWriteBuffNumPgs),
+
_writeBuffPgSize_sblks(_s_defaultWriteBuffPgSize_sblks)
+{}
+
+JournalParameters::JournalParameters(const std::string& jrnlDir,
+ const std::string& jrnlBaseFileName,
+ const u_int16_t numJrnlFiles,
+ const bool autoExpand,
+ const u_int16_t autoExpandMaxJrnlFiles,
+ const u_int32_t jrnlFileSize_sblks,
+ const u_int16_t writeBuffNumPgs,
+ const u_int32_t writeBuffPgSize_sblks) :
+ _jrnlDir(jrnlDir),
+ _jrnlBaseFileName(jrnlBaseFileName),
+ _numJrnlFiles(numJrnlFiles),
+ _jrnlFileSize_sblks(jrnlFileSize_sblks),
+ _autoExpand(autoExpand),
+ _autoExpandMaxJrnlFiles(autoExpandMaxJrnlFiles),
+ _writeBuffNumPgs(writeBuffNumPgs),
+ _writeBuffPgSize_sblks(writeBuffPgSize_sblks)
+{}
+
+JournalParameters::JournalParameters(const JournalParameters& sp) :
+ _jrnlDir(sp._jrnlDir),
+ _jrnlBaseFileName(sp._jrnlBaseFileName),
+ _numJrnlFiles(sp._numJrnlFiles),
+ _jrnlFileSize_sblks(sp._jrnlFileSize_sblks),
+ _autoExpand(sp._autoExpand),
+
_autoExpandMaxJrnlFiles(sp._autoExpandMaxJrnlFiles),
+ _writeBuffNumPgs(sp._writeBuffNumPgs),
+ _writeBuffPgSize_sblks(sp._writeBuffPgSize_sblks)
+
+{}
+
+std::string
+JournalParameters::to_string()
+{
+ std::ostringstream oss;
+ oss << "Store Parameters:" << std::endl;
+ oss << " jrnlDir = \"" << _jrnlDir <<
"\"" << std::endl;
+ oss << " jrnlBaseFileName = \"" << _jrnlBaseFileName
<< "\"" << std::endl;
+ oss << " numJrnlFiles = " << _numJrnlFiles <<
std::endl;
+ oss << " jrnlFileSize_sblks = " << _jrnlFileSize_sblks
<< std::endl;
+ oss << " autoExpand = " << _autoExpand << std::endl;
+ oss << " autoExpandMaxJrnlFiles = " << _autoExpandMaxJrnlFiles
<< std::endl;
+ oss << " writeBuffNumPgs = " << _writeBuffNumPgs <<
std::endl;
+ oss << " writeBuffPgSize_sblks = " << _writeBuffPgSize_sblks
<< std::endl;
+ return oss.str();
+}
+
+} // namespace journal2
+} // namespace mrg
Copied: store/trunk/cpp/lib/jrnl2/JournalParameters.hpp (from rev 4420,
store/trunk/cpp/lib/jrnl2/store_params.hpp)
===================================================================
--- store/trunk/cpp/lib/jrnl2/JournalParameters.hpp (rev 0)
+++ store/trunk/cpp/lib/jrnl2/JournalParameters.hpp 2010-12-03 21:03:35 UTC (rev 4423)
@@ -0,0 +1,79 @@
+/**
+ * \file JournalParameters.hpp
+ *
+ * Qpid asynchronous store plugin library
+ *
+ * This file contains performance test code for the journal.
+ *
+ * \author Kim van der Riet
+ *
+ * Copyright (c) 2010 Red Hat, Inc.
+ *
+ * This file is part of the Qpid async store library msgstore.so.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ *
+ * The GNU Lesser General Public License is available in the file COPYING.
+ */
+
+#ifndef mrg_journal2_JournalParameters_hpp
+#define mrg_journal2_JournalParameters_hpp
+
+#include <string>
+#include <sys/types.h>
+
+namespace mrg
+{
+namespace journal2
+{
+
+ struct JournalParameters
+ {
+ // static default store params
+ static std::string _s_defaultJrnlDir;
+ static std::string _s_defaultJrnlBaseFileName;
+ static u_int16_t _s_defaultNumJrnlFiles;
+ static u_int32_t _s_defaultJrnlFileSize_sblks;
+ static bool _s_defaultAutoExpand;
+ static u_int16_t _s_defaultAutoExpandMaxJrnlFiles;
+ static u_int16_t _s_defaultWriteBuffNumPgs;
+ static u_int32_t _s_defaultWriteBuffPgSize_sblks;
+
+ std::string _jrnlDir;
+ std::string _jrnlBaseFileName;
+ u_int16_t _numJrnlFiles;
+ u_int32_t _jrnlFileSize_sblks;
+ bool _autoExpand;
+ u_int16_t _autoExpandMaxJrnlFiles;
+ u_int16_t _writeBuffNumPgs;
+ u_int32_t _writeBuffPgSize_sblks;
+ JournalParameters();
+ JournalParameters(const std::string& jrnlDir,
+ const std::string& jrnlBaseFileName,
+ const u_int16_t numJrnlFiles,
+ const bool autoExpand,
+ const u_int16_t autoExpandMaxJrnlFiles,
+ const u_int32_t jrnlFileSize_sblks,
+ const u_int16_t writeBuffNumPgs,
+ const u_int32_t writeBuffPgSize_sblks);
+ JournalParameters(const JournalParameters& sp);
+ std::string to_string();
+ };
+
+} // namespace journal2
+} // namespace mrg
+
+#endif // mrg_journal2_JournalParameters_hpp
Modified: store/trunk/cpp/lib/jrnl2/Makefile.am
===================================================================
--- store/trunk/cpp/lib/jrnl2/Makefile.am 2010-12-03 19:48:36 UTC (rev 4422)
+++ store/trunk/cpp/lib/jrnl2/Makefile.am 2010-12-03 21:03:35 UTC (rev 4423)
@@ -33,7 +33,7 @@
jrnl_state.cpp \
slock.cpp \
smutex.cpp \
- store_params.cpp \
+ JournalParameters.cpp \
aio_callback.hpp \
dtok.hpp \
dtok_state.hpp \
@@ -44,6 +44,6 @@
jrnl_state.hpp \
slock.hpp \
smutex.hpp \
- store_params.hpp \
+ JournalParameters.hpp \
txn_ctxt.hpp
Modified: store/trunk/cpp/lib/jrnl2/dtok.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl2/dtok.hpp 2010-12-03 19:48:36 UTC (rev 4422)
+++ store/trunk/cpp/lib/jrnl2/dtok.hpp 2010-12-03 21:03:35 UTC (rev 4423)
@@ -75,10 +75,10 @@
inline bool is_external() const { return _external; }
inline std::string& get_external_location() { return _external_location; }
void set_rid(const rec_id rid);
- inline rec_id rid() const { return _rid; }
+ inline rec_id get_rid() const { return _rid; }
inline bool is_external_rid() { return _external_rid; }
void set_drid(const rec_id drid);
- inline rec_id drid() const { return _drid; }
+ inline rec_id get_drid() const { return _drid; }
// debug aids
std::string status_str();
Modified: store/trunk/cpp/lib/jrnl2/jexception.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl2/jexception.hpp 2010-12-03 19:48:36 UTC (rev 4422)
+++ store/trunk/cpp/lib/jrnl2/jexception.hpp 2010-12-03 21:03:35 UTC (rev 4423)
@@ -103,10 +103,10 @@
virtual ~jexception() throw ();
virtual const char* what() const throw (); // override std::exception::what()
- inline u_int32_t err_code() const throw () { return _err_code; }
- inline const std::string additional_info() const throw () { return
_additional_info; }
- inline const std::string throwing_class() const throw () { return
_throwing_class; }
- inline const std::string throwing_fn() const throw () { return _throwing_fn; }
+ inline u_int32_t get_err_code() const throw () { return _err_code; }
+ inline const std::string get_additional_info() const throw () { return
_additional_info; }
+ inline const std::string get_throwing_class() const throw () { return
_throwing_class; }
+ inline const std::string get_throwing_fn() const throw () { return _throwing_fn;
}
friend std::ostream& operator<<(std::ostream& os, const
jexception& je);
friend std::ostream& operator<<(std::ostream& os, const jexception*
jePtr);
Modified: store/trunk/cpp/lib/jrnl2/jrnl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl2/jrnl.cpp 2010-12-03 19:48:36 UTC (rev 4422)
+++ store/trunk/cpp/lib/jrnl2/jrnl.cpp 2010-12-03 21:03:35 UTC (rev 4423)
@@ -65,7 +65,7 @@
{}
void
-jrnl::initialize(const store_params* sp, aio_callback* const cbp)
+jrnl::initialize(const JournalParameters* sp, aio_callback* const cbp)
{
_store_params_ptr = sp;
_cbp = cbp;
@@ -92,7 +92,7 @@
jrnl::dequeue(dtok* const dtokp)
{
dtokp->get_dtok_state().set_dequeue();
- dtokp->set_drid(dtokp->rid());
+ dtokp->set_drid(dtokp->get_rid());
// --- temp code ---
bool flush_flag;
{
Modified: store/trunk/cpp/lib/jrnl2/jrnl.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl2/jrnl.hpp 2010-12-03 19:48:36 UTC (rev 4422)
+++ store/trunk/cpp/lib/jrnl2/jrnl.hpp 2010-12-03 21:03:35 UTC (rev 4423)
@@ -39,7 +39,7 @@
#include "aio_callback.hpp"
#include "dtok.hpp"
#include "jrnl_state.hpp"
-#include "store_params.hpp"
+#include "JournalParameters.hpp"
// --- temp code ---
#include "slock.hpp"
@@ -65,7 +65,7 @@
std::string _jdir;
std::string _base_filename;
jrnl_state _jrnl_state;
- const store_params* _store_params_ptr;
+ const JournalParameters* _store_params_ptr;
aio_callback* _cbp;
// --- temp code ---
@@ -82,14 +82,14 @@
jrnl(const std::string& jid, const std::string& jdir, const
std::string& base_filename);
// get functions
- inline std::string id() { return _jid; }
- inline std::string dir() { return _jdir; }
- inline std::string base_filename() { return _base_filename; }
+ inline std::string get_id() { return _jid; }
+ inline std::string get_dir() { return _jdir; }
+ inline std::string get_base_filename() { return _base_filename; }
inline const jrnl_state& get_jrnl_state() { return _jrnl_state; }
- inline const store_params* get_store_params() const { return _store_params_ptr;
}
+ inline const JournalParameters* get_store_params() const { return
_store_params_ptr; }
// msg ops
- void initialize(const store_params* sp, aio_callback* const cbp);
+ void initialize(const JournalParameters* sp, aio_callback* const cbp);
iores enqueue(const void* const msg_ptr, const std::size_t msg_size, dtok* const
dtokp);
iores dequeue(dtok* const dtokp);
iores commit();
Deleted: store/trunk/cpp/lib/jrnl2/store_params.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl2/store_params.cpp 2010-12-03 19:48:36 UTC (rev 4422)
+++ store/trunk/cpp/lib/jrnl2/store_params.cpp 2010-12-03 21:03:35 UTC (rev 4423)
@@ -1,115 +0,0 @@
-/**
- * \file store_params.cpp
- *
- * Qpid asynchronous store plugin library
- *
- * This file contains async journal code (v.2).
- *
- * \author Kim van der Riet
- *
- * Copyright (c) 2010 Red Hat, Inc.
- *
- * This file is part of the Qpid async store library msgstore.so.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
- * USA
- *
- * The GNU Lesser General Public License is available in the file COPYING.
- */
-
-#include "store_params.hpp"
-
-#include <sstream>
-
-namespace mrg
-{
-namespace journal2
-{
-
-// static declarations
-std::string store_params::_default_jid = "default_store";
-std::string store_params::_default_jrnl_dir = "/tmp/store";
-std::string store_params::_default_jrnl_base_filename = "JournalData";
-u_int16_t store_params::_default_num_jfiles = 8;
-u_int32_t store_params::_default_jfsize_sblks = 3072;
-bool store_params::_default_auto_expand = false;
-u_int16_t store_params::_default_ae_max_jfiles = 0;
-u_int16_t store_params::_default_wcache_num_pages = 32;
-u_int32_t store_params::_default_wcache_pgsize_sblks = 128;
-
-store_params::store_params() :
- _jrnl_id(_default_jid),
- _jrnl_dir(_default_jrnl_dir),
- _jrnl_base_filename(_default_jrnl_base_filename),
- _num_jfiles(_default_num_jfiles),
- _jfsize_sblks(_default_jfsize_sblks),
- _auto_expand(_default_auto_expand),
- _ae_max_jfiles(_default_ae_max_jfiles),
- _wcache_num_pages(_default_wcache_num_pages),
- _wcache_pgsize_sblks(_default_wcache_pgsize_sblks)
-{}
-
-store_params::store_params(const std::string& jrnl_id,
- const std::string& jrnl_dir,
- const std::string& jrnl_base_filename,
- const u_int16_t num_jfiles,
- const u_int32_t jfsize_sblks,
- const bool auto_expand,
- const u_int16_t ae_max_jfiles,
- const u_int16_t wcache_num_pages,
- const u_int32_t wcache_pgsize_sblks) :
- _jrnl_id(jrnl_id),
- _jrnl_dir(jrnl_dir),
- _jrnl_base_filename(jrnl_base_filename),
- _num_jfiles(num_jfiles),
- _jfsize_sblks(jfsize_sblks),
- _auto_expand(auto_expand),
- _ae_max_jfiles(ae_max_jfiles),
- _wcache_num_pages(wcache_num_pages),
- _wcache_pgsize_sblks(wcache_pgsize_sblks)
-{}
-
-store_params::store_params(const store_params& sp) :
- _jrnl_id(sp._jrnl_id),
- _jrnl_dir(sp._jrnl_dir),
- _jrnl_base_filename(sp._jrnl_base_filename),
- _num_jfiles(sp._num_jfiles),
- _jfsize_sblks(sp._jfsize_sblks),
- _auto_expand(sp._auto_expand),
- _ae_max_jfiles(sp._ae_max_jfiles),
- _wcache_num_pages(sp._wcache_num_pages),
- _wcache_pgsize_sblks(sp._wcache_pgsize_sblks)
-{}
-
-
-std::string
-store_params::to_string()
-{
- std::ostringstream oss;
- oss << "Store Parameters:" << std::endl;
- oss << " jrnl_id = \"" << _jrnl_id <<
"\"" << std::endl;
- oss << " jrnl_dir = \"" << _jrnl_dir <<
"\"" << std::endl;
- oss << " jrnl_base_filename = \"" << _jrnl_base_filename
<< "\"" << std::endl;
- oss << " num_jfiles = " << _num_jfiles << std::endl;
- oss << " jfsize_sblks = " << _jfsize_sblks <<
std::endl;
- oss << " auto_expand = " << _auto_expand << std::endl;
- oss << " ae_max_jfiles = " << _ae_max_jfiles <<
std::endl;
- oss << " wcache_num_pages = " << _wcache_num_pages <<
std::endl;
- oss << " wcache_pgsize_sblks = " << _wcache_pgsize_sblks
<< std::endl;
- return oss.str();
-}
-
-} // namespace journal2
-} // namespace mrg
Deleted: store/trunk/cpp/lib/jrnl2/store_params.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl2/store_params.hpp 2010-12-03 19:48:36 UTC (rev 4422)
+++ store/trunk/cpp/lib/jrnl2/store_params.hpp 2010-12-03 21:03:35 UTC (rev 4423)
@@ -1,82 +0,0 @@
-/**
- * \file store_params.hpp
- *
- * Qpid asynchronous store plugin library
- *
- * This file contains async journal code (v.2).
- *
- * \author Kim van der Riet
- *
- * Copyright (c) 2010 Red Hat, Inc.
- *
- * This file is part of the Qpid async store library msgstore.so.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
- * USA
- *
- * The GNU Lesser General Public License is available in the file COPYING.
- */
-
-#ifndef mrg_journal2_store_params_hpp
-#define mrg_journal2_store_params_hpp
-
-#include <sys/types.h> // u_int16_t, u_int32_t
-#include <string>
-
-namespace mrg
-{
-namespace journal2
-{
-
- struct store_params
- {
- // static default store params
- static std::string _default_jid;
- static std::string _default_jrnl_dir;
- static std::string _default_jrnl_base_filename;
- static u_int16_t _default_num_jfiles;
- static u_int32_t _default_jfsize_sblks;
- static bool _default_auto_expand;
- static u_int16_t _default_ae_max_jfiles;
- static u_int16_t _default_wcache_num_pages;
- static u_int32_t _default_wcache_pgsize_sblks;
-
- std::string _jrnl_id;
- std::string _jrnl_dir;
- std::string _jrnl_base_filename;
- u_int16_t _num_jfiles;
- u_int32_t _jfsize_sblks;
- bool _auto_expand;
- u_int16_t _ae_max_jfiles;
- u_int16_t _wcache_num_pages;
- u_int32_t _wcache_pgsize_sblks;
- store_params();
- store_params(const std::string& jid,
- const std::string& jrnl_dir,
- const std::string& jrnl_base_filename,
- const u_int16_t num_jfiles,
- const u_int32_t jfsize_sblks,
- const bool auto_expand,
- const u_int16_t ae_max_jfiles,
- const u_int16_t wcache_num_pages,
- const u_int32_t wcache_pgsize_sblks);
- store_params(const store_params& sp);
- std::string to_string();
- };
-
-} // namespace journal2
-} // namespace mrg
-
-#endif // mrg_journal2_store_params_hpp
Property changes on: store/trunk/cpp/m4
___________________________________________________________________
Name: svn:ignore
+ libtool.m4
lt*.m4
Modified: store/trunk/cpp/perf/JournalInstance.cpp
===================================================================
--- store/trunk/cpp/perf/JournalInstance.cpp 2010-12-03 19:48:36 UTC (rev 4422)
+++ store/trunk/cpp/perf/JournalInstance.cpp 2010-12-03 21:03:35 UTC (rev 4423)
@@ -132,7 +132,6 @@
mrg::journal::data_tok* dtokp = 0;
#endif
while (!dtokp) {
- std::size_t s;
bool get_events_flag;
{
std::unique_lock<std::mutex> l(_ucl_mutex);
@@ -245,7 +244,7 @@
// *** MUST BE THREAD-SAFE ****
// This method will be called by multiple threads simultaneously
void
-JournalInstance::rd_aio_cb(std::vector<u_int16_t>& pil)
+JournalInstance::rd_aio_cb(std::vector<uint16_t>& /*pil*/)
{}
} // namespace test
Modified: store/trunk/cpp/perf/JournalInstance.hpp
===================================================================
--- store/trunk/cpp/perf/JournalInstance.hpp 2010-12-03 19:48:36 UTC (rev 4422)
+++ store/trunk/cpp/perf/JournalInstance.hpp 2010-12-03 21:03:35 UTC (rev 4423)
@@ -86,7 +86,7 @@
#else
virtual void wr_aio_cb(std::vector<mrg::journal::data_tok*>& dtokl);
#endif
- virtual void rd_aio_cb(std::vector<u_int16_t>& pil);
+ virtual void rd_aio_cb(std::vector<uint16_t>& pil);
};
} // namespace test
Modified: store/trunk/cpp/perf/JournalParameters.cpp
===================================================================
--- store/trunk/cpp/perf/JournalParameters.cpp 2010-12-03 19:48:36 UTC (rev 4422)
+++ store/trunk/cpp/perf/JournalParameters.cpp 2010-12-03 21:03:35 UTC (rev 4423)
@@ -39,58 +39,53 @@
{
// static declarations
-std::string JournalParameters::_default_jid = "default_store";
-std::string JournalParameters::_default_jrnl_dir = "/tmp/store";
-std::string JournalParameters::_default_jrnl_base_filename = "JournalData";
-uint16_t JournalParameters::_default_num_jfiles = 8;
-uint32_t JournalParameters::_default_jfsize_sblks = 3072;
-bool JournalParameters::_default_auto_expand = false;
-uint16_t JournalParameters::_default_ae_max_jfiles = 0;
-uint16_t JournalParameters::_default_wcache_num_pages = 32;
-uint32_t JournalParameters::_default_wcache_pgsize_sblks = 128;
+std::string JournalParameters::_s_defaultJrnlDir = "/tmp/store";
+std::string JournalParameters::_s_defaultJrnlBaseFileName = "JournalData";
+uint16_t JournalParameters::_s_defaultNumJrnlFiles = 8;
+uint32_t JournalParameters::_s_defaultJrnlFileSize_sblks = 3072;
+bool JournalParameters::_s_defaultAutoExpand = false;
+uint16_t JournalParameters::_s_defaultAutoExpandMaxJrnlFiles = 0;
+uint16_t JournalParameters::_s_defaultWriteBuffNumPgs = 32;
+uint32_t JournalParameters::_s_defaultWriteBuffPgSize_sblks = 128;
JournalParameters::JournalParameters() :
- _jrnl_id(_default_jid),
- _jrnl_dir(_default_jrnl_dir),
- _jrnl_base_filename(_default_jrnl_base_filename),
- _num_jfiles(_default_num_jfiles),
- _jfsize_sblks(_default_jfsize_sblks),
- _auto_expand(_default_auto_expand),
- _ae_max_jfiles(_default_ae_max_jfiles),
- _wcache_num_pages(_default_wcache_num_pages),
- _wcache_pgsize_sblks(_default_wcache_pgsize_sblks)
+ _jrnlDir(_s_defaultJrnlDir),
+ _jrnlBaseFileName(_s_defaultJrnlBaseFileName),
+ _numJrnlFiles(_s_defaultNumJrnlFiles),
+ _jrnlFileSize_sblks(_s_defaultJrnlFileSize_sblks),
+ _autoExpand(_s_defaultAutoExpand),
+
_autoExpandMaxJrnlFiles(_s_defaultAutoExpandMaxJrnlFiles),
+ _writeBuffNumPgs(_s_defaultWriteBuffNumPgs),
+
_writeBuffPgSize_sblks(_s_defaultWriteBuffPgSize_sblks)
{}
-JournalParameters::JournalParameters(const std::string& jrnl_id,
- const std::string& jrnl_dir,
- const std::string& jrnl_base_filename,
- const u_int16_t num_jfiles,
- const bool auto_expand,
- const u_int16_t ae_max_jfiles,
- const u_int32_t jfsize_sblks,
- const u_int16_t wcache_num_pages,
- const u_int32_t wcache_pgsize_sblks) :
- _jrnl_id(jrnl_id),
- _jrnl_dir(jrnl_dir),
- _jrnl_base_filename(jrnl_base_filename),
- _num_jfiles(num_jfiles),
- _auto_expand(auto_expand),
- _ae_max_jfiles(ae_max_jfiles),
- _jfsize_sblks(jfsize_sblks),
- _wcache_num_pages(wcache_num_pages),
- _wcache_pgsize_sblks(wcache_pgsize_sblks)
+JournalParameters::JournalParameters(const std::string& jrnlDir,
+ const std::string& jrnlBaseFileName,
+ const uint16_t numJrnlFiles,
+ const bool autoExpand,
+ const uint16_t autoExpandMaxJrnlFiles,
+ const uint32_t jrnlFileSize_sblks,
+ const uint16_t writeBuffNumPgs,
+ const uint32_t writeBuffPgSize_sblks) :
+ _jrnlDir(jrnlDir),
+ _jrnlBaseFileName(jrnlBaseFileName),
+ _numJrnlFiles(numJrnlFiles),
+ _jrnlFileSize_sblks(jrnlFileSize_sblks),
+ _autoExpand(autoExpand),
+ _autoExpandMaxJrnlFiles(autoExpandMaxJrnlFiles),
+ _writeBuffNumPgs(writeBuffNumPgs),
+ _writeBuffPgSize_sblks(writeBuffPgSize_sblks)
{}
JournalParameters::JournalParameters(const JournalParameters& sp) :
- _jrnl_id(sp._jrnl_id),
- _jrnl_dir(sp._jrnl_dir),
- _jrnl_base_filename(sp._jrnl_base_filename),
- _num_jfiles(sp._num_jfiles),
- _auto_expand(sp._auto_expand),
- _ae_max_jfiles(sp._ae_max_jfiles),
- _jfsize_sblks(sp._jfsize_sblks),
- _wcache_num_pages(sp._wcache_num_pages),
- _wcache_pgsize_sblks(sp._wcache_pgsize_sblks)
+ _jrnlDir(sp._jrnlDir),
+ _jrnlBaseFileName(sp._jrnlBaseFileName),
+ _numJrnlFiles(sp._numJrnlFiles),
+ _jrnlFileSize_sblks(sp._jrnlFileSize_sblks),
+ _autoExpand(sp._autoExpand),
+
_autoExpandMaxJrnlFiles(sp._autoExpandMaxJrnlFiles),
+ _writeBuffNumPgs(sp._writeBuffNumPgs),
+ _writeBuffPgSize_sblks(sp._writeBuffPgSize_sblks)
{}
@@ -99,15 +94,14 @@
{
std::ostringstream oss;
oss << "Store Parameters:" << std::endl;
- oss << " jrnl_id = \"" << _jrnl_id <<
"\"" << std::endl;
- oss << " jrnl_dir = \"" << _jrnl_dir <<
"\"" << std::endl;
- oss << " jrnl_base_filename = \"" << _jrnl_base_filename
<< "\"" << std::endl;
- oss << " num_jfiles = " << _num_jfiles << std::endl;
- oss << " jfsize_sblks = " << _jfsize_sblks <<
std::endl;
- oss << " auto_expand = " << _auto_expand << std::endl;
- oss << " ae_max_jfiles = " << _ae_max_jfiles <<
std::endl;
- oss << " wcache_num_pages = " << _wcache_num_pages <<
std::endl;
- oss << " wcache_pgsize_sblks = " << _wcache_pgsize_sblks
<< std::endl;
+ oss << " jrnlDir = \"" << _jrnlDir <<
"\"" << std::endl;
+ oss << " jrnlBaseFileName = \"" << _jrnlBaseFileName
<< "\"" << std::endl;
+ oss << " numJrnlFiles = " << _numJrnlFiles <<
std::endl;
+ oss << " jrnlFileSize_sblks = " << _jrnlFileSize_sblks
<< std::endl;
+ oss << " autoExpand = " << _autoExpand << std::endl;
+ oss << " autoExpandMaxJrnlFiles = " << _autoExpandMaxJrnlFiles
<< std::endl;
+ oss << " writeBuffNumPgs = " << _writeBuffNumPgs <<
std::endl;
+ oss << " writeBuffPgSize_sblks = " << _writeBuffPgSize_sblks
<< std::endl;
return oss.str();
}
Modified: store/trunk/cpp/perf/JournalParameters.hpp
===================================================================
--- store/trunk/cpp/perf/JournalParameters.hpp 2010-12-03 19:48:36 UTC (rev 4422)
+++ store/trunk/cpp/perf/JournalParameters.hpp 2010-12-03 21:03:35 UTC (rev 4423)
@@ -40,39 +40,69 @@
namespace test
{
+ /**
+ * \brief Stuct for aggregating the common journal parameters
+ *
+ * This struct is used to aggregate and keep together all the common journal
parameters. These affect the journal
+ * geometry and buffers. The test parameters are aggregated in class TestParameters.
+ */
struct JournalParameters
{
// static default store params
- static std::string _default_jid;
- static std::string _default_jrnl_dir;
- static std::string _default_jrnl_base_filename;
- static u_int16_t _default_num_jfiles;
- static u_int32_t _default_jfsize_sblks;
- static bool _default_auto_expand;
- static u_int16_t _default_ae_max_jfiles;
- static u_int16_t _default_wcache_num_pages;
- static u_int32_t _default_wcache_pgsize_sblks;
+ static std::string _s_defaultJrnlDir; ///< Default journal
directory
+ static std::string _s_defaultJrnlBaseFileName; ///< Default journal base
file name
+ static uint16_t _s_defaultNumJrnlFiles; ///< Default number of
journal data files
+ static uint32_t _s_defaultJrnlFileSize_sblks; ///< Default journal data
file size in softblocks
+ static bool _s_defaultAutoExpand; ///< Default auto-expand
flag (allows auto-expansion of journal data files)
+ static uint16_t _s_defaultAutoExpandMaxJrnlFiles; ///< Default auto-expand
file number limit (0 = no limit)
+ static uint16_t _s_defaultWriteBuffNumPgs; ///< Default number of
write buffer pages
+ static uint32_t _s_defaultWriteBuffPgSize_sblks; ///< Default size of each
write buffer page in softblocks
- std::string _jrnl_id;
- std::string _jrnl_dir;
- std::string _jrnl_base_filename;
- uint16_t _num_jfiles;
- uint32_t _jfsize_sblks;
- bool _auto_expand;
- uint16_t _ae_max_jfiles;
- uint16_t _wcache_num_pages;
- uint32_t _wcache_pgsize_sblks;
+ std::string _jrnlDir; ///< Journal directory
+ std::string _jrnlBaseFileName; ///< Journal base file
name
+ uint16_t _numJrnlFiles; ///< Number of journal
data files
+ uint32_t _jrnlFileSize_sblks; ///< Journal data file
size in softblocks
+ bool _autoExpand; ///< Auto-expand flag
(allows auto-expansion of journal data files)
+ uint16_t _autoExpandMaxJrnlFiles; ///< Auto-expand file
number limit (0 = no limit)
+ uint16_t _writeBuffNumPgs; ///< Number of write
buffer pages
+ uint32_t _writeBuffPgSize_sblks; ///< Size of each write
buffer page in softblocks
+
+ /**
+ * \brief Default constructor
+ *
+ * Default constructor. Uses the default values for all parameters.
+ */
JournalParameters();
- JournalParameters(const std::string& jid,
- const std::string& jrnl_dir,
- const std::string& jrnl_base_filename,
- const uint16_t num_jfiles,
- const bool auto_expand,
- const uint16_t ae_max_jfiles,
- const uint32_t jfsize_sblks,
- const uint16_t wcache_num_pages,
- const uint32_t wcache_pgsize_sblks);
+
+ /**
+ * \brief Constructor
+ *
+ * Convenience constructor.
+ */
+ JournalParameters(const std::string& jrnlDir,
+ const std::string& jrnlBaseFileName,
+ const uint16_t numJrnlFiles,
+ const bool autoExpand,
+ const uint16_t autoExpandMaxJrnlFiles,
+ const uint32_t jrnlFileSize_sblks,
+ const uint16_t writeBuffNumPgs,
+ const uint32_t writeBuffPgSize_sblks);
+
+ /**
+ * \brief Copy constructor
+ *
+ * Copy constructor.
+ */
JournalParameters(const JournalParameters& sp);
+
+ /**
+ * \brief Creates a string representation of the journal parameters
+ *
+ * Convenience feature which creates a multi-line string representation of all
the parameters, one parameter per
+ * line.
+ *
+ * \return multi-line string representation of all the parameters, one parameter
per line.
+ */
std::string to_string();
};
Modified: store/trunk/cpp/perf/Makefile.am
===================================================================
--- store/trunk/cpp/perf/Makefile.am 2010-12-03 19:48:36 UTC (rev 4422)
+++ store/trunk/cpp/perf/Makefile.am 2010-12-03 21:03:35 UTC (rev 4423)
@@ -30,12 +30,12 @@
perf_SOURCES = \
JournalInstance.cpp \
JournalParameters.cpp \
- PerformanceTimer.cpp \
+ ScopedPerformanceTimer.cpp \
StorePerformanceTest.cpp \
TestParameters.cpp \
JournalInstance.hpp \
JournalParameters.hpp \
- PerformanceTimer.hpp \
+ ScopedPerformanceTimer.hpp \
StorePerformanceTest.hpp \
TestParameters.hpp
perf_CXXFLAGS = -std=c++0x -lpthread
Deleted: store/trunk/cpp/perf/PerformanceTimer.cpp
===================================================================
--- store/trunk/cpp/perf/PerformanceTimer.cpp 2010-12-03 19:48:36 UTC (rev 4422)
+++ store/trunk/cpp/perf/PerformanceTimer.cpp 2010-12-03 21:03:35 UTC (rev 4423)
@@ -1,80 +0,0 @@
-/**
- * \file PerformanceTimer.cpp
- *
- * Qpid asynchronous store plugin library
- *
- * This file contains performance test code for the journal.
- *
- * \author Kim van der Riet
- *
- * Copyright (c) 2010 Red Hat, Inc.
- *
- * This file is part of the Qpid async store library msgstore.so.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
- * USA
- *
- * The GNU Lesser General Public License is available in the file COPYING.
- */
-
-#include "PerformanceTimer.hpp"
-
-#include <iostream>
-
-namespace mrg
-{
-namespace test
-{
- PerformanceTimer::PerformanceTimer(const uint32_t num_msgs,
- const uint32_t msg_size,
- const uint16_t num_queues,
- const uint16_t num_threads_per_queue) :
- _num_msgs(num_msgs),
- _msg_size(msg_size),
- _num_queues(num_queues),
- _num_threads_per_queue(num_threads_per_queue)
- {
- ::timespec ts;
- ::clock_gettime(CLOCK_REALTIME, &ts);
- _start_time = get_double_time(ts);
- }
-
- PerformanceTimer::~PerformanceTimer()
- {
- ::timespec ts;
- ::clock_gettime(CLOCK_REALTIME, &ts);
- double time_taken = get_double_time(ts) - _start_time;
- std::cout << "TEST RESULTS:" << std::endl;
- std::cout << " Msgs per thread: " << _num_msgs <<
std::endl;
- std::cout << " Msg size: " << _msg_size <<
std::endl;
- std::cout << " No. queues: " << _num_queues
<< std::endl;
- std::cout << " No. threads/queue: " <<
_num_threads_per_queue << std::endl;
- std::cout << " Time taken: " << time_taken <<
" sec" << std::endl;
- u_int32_t msgs = _num_msgs * _num_queues * _num_threads_per_queue;
- std::cout << " Total no. msgs: " << msgs <<
std::endl;
- double msgs_per_sec = msgs / time_taken;
- std::cout << " Msg throughput: " << (msgs_per_sec /
1e3) << " kMsgs/sec" << std::endl;
- std::cout << " " << (msgs_per_sec *
_msg_size / 1e6) << " MB/sec" << std::endl;
- }
-
- // static
- double PerformanceTimer::get_double_time(const ::timespec& ts)
- {
- return ts.tv_sec + (double(ts.tv_nsec) / 1e9);
- }
-
-
-} // namespace test
-} // namespace mrg
Deleted: store/trunk/cpp/perf/PerformanceTimer.hpp
===================================================================
--- store/trunk/cpp/perf/PerformanceTimer.hpp 2010-12-03 19:48:36 UTC (rev 4422)
+++ store/trunk/cpp/perf/PerformanceTimer.hpp 2010-12-03 21:03:35 UTC (rev 4423)
@@ -1,63 +0,0 @@
-/**
- * \file PerformanceTimer.hpp
- *
- * Qpid asynchronous store plugin library
- *
- * This file contains performance test code for the journal.
- *
- * \author Kim van der Riet
- *
- * Copyright (c) 2010 Red Hat, Inc.
- *
- * This file is part of the Qpid async store library msgstore.so.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
- * USA
- *
- * The GNU Lesser General Public License is available in the file COPYING.
- */
-
-#ifndef mrg_test_PerformanceTimer_hpp
-#define mrg_test_PerformanceTimer_hpp
-
-#include <cstdint>
-#include <ctime>
-
-namespace mrg
-{
-namespace test
-{
-
- class PerformanceTimer
- {
- protected:
- uint32_t _num_msgs;
- uint32_t _msg_size;
- uint16_t _num_queues;
- uint16_t _num_threads_per_queue;
- double _start_time;
- static double get_double_time(const timespec& tx);
- public:
- PerformanceTimer(const uint32_t num_msgs,
- const uint32_t msg_size,
- const uint16_t num_queues,
- const uint16_t num_threads_per_queue);
- ~PerformanceTimer();
- };
-
-} // namespace test
-} // namespace mrg
-
-#endif // mrg_test_PerformanceTimer_hpp
Copied: store/trunk/cpp/perf/ScopedPerformanceTimer.cpp (from rev 4420,
store/trunk/cpp/perf/PerformanceTimer.cpp)
===================================================================
--- store/trunk/cpp/perf/ScopedPerformanceTimer.cpp (rev 0)
+++ store/trunk/cpp/perf/ScopedPerformanceTimer.cpp 2010-12-03 21:03:35 UTC (rev 4423)
@@ -0,0 +1,72 @@
+/**
+ * \file ScopedPerformanceTimer.cpp
+ *
+ * Qpid asynchronous store plugin library
+ *
+ * This file contains performance test code for the journal.
+ *
+ * \author Kim van der Riet
+ *
+ * Copyright (c) 2010 Red Hat, Inc.
+ *
+ * This file is part of the Qpid async store library msgstore.so.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ *
+ * The GNU Lesser General Public License is available in the file COPYING.
+ */
+
+#include "ScopedPerformanceTimer.hpp"
+
+namespace mrg
+{
+namespace test
+{
+ ScopedPerformanceTimer::ScopedPerformanceTimer(const TestParameters& tp,
+ std::ostream& os) :
+ _testParams(tp),
+ _outStream(os)
+ {
+ ::clock_gettime(CLOCK_REALTIME, &_startTime);
+ }
+
+ ScopedPerformanceTimer::~ScopedPerformanceTimer()
+ {
+ ::timespec stopTime;
+ ::clock_gettime(CLOCK_REALTIME, &stopTime);
+ double timeTaken = _s_getDoubleTime(stopTime) - _s_getDoubleTime(_startTime);
+ _outStream << "TEST RESULTS:" << std::endl;
+ _outStream << " Msgs per thread: " <<
_testParams._numMsgs << std::endl;
+ _outStream << " Msg size: " <<
_testParams._msgSize << std::endl;
+ _outStream << " No. queues: " <<
_testParams._numQueues << std::endl;
+ _outStream << " No. threads/queue: " <<
_testParams._numThreadPairsPerQueue << std::endl;
+ _outStream << " Time taken: " << timeTaken <<
" sec" << std::endl;
+ uint32_t msgs = _testParams._numMsgs * _testParams._numQueues *
_testParams._numThreadPairsPerQueue;
+ _outStream << " Total no. msgs: " << msgs <<
std::endl;
+ double msgsRate = double(msgs) / timeTaken;
+ _outStream << " Msg throughput: " << (msgsRate / 1e3)
<< " kMsgs/sec" << std::endl;
+ _outStream << " " << (msgsRate *
_testParams._msgSize / 1e6) << " MB/sec" << std::endl;
+ }
+
+ // static
+ double ScopedPerformanceTimer::_s_getDoubleTime(const ::timespec& ts)
+ {
+ return ts.tv_sec + (double(ts.tv_nsec) / 1e9);
+ }
+
+
+} // namespace test
+} // namespace mrg
Copied: store/trunk/cpp/perf/ScopedPerformanceTimer.hpp (from rev 4420,
store/trunk/cpp/perf/PerformanceTimer.hpp)
===================================================================
--- store/trunk/cpp/perf/ScopedPerformanceTimer.hpp (rev 0)
+++ store/trunk/cpp/perf/ScopedPerformanceTimer.hpp 2010-12-03 21:03:35 UTC (rev 4423)
@@ -0,0 +1,106 @@
+/**
+ * \file ScopedPerformanceTimer.hpp
+ *
+ * Qpid asynchronous store plugin library
+ *
+ * This file contains performance test code for the journal.
+ *
+ * \author Kim van der Riet
+ *
+ * Copyright (c) 2010 Red Hat, Inc.
+ *
+ * This file is part of the Qpid async store library msgstore.so.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ *
+ * The GNU Lesser General Public License is available in the file COPYING.
+ */
+
+#ifndef mrg_test_ScopedPerformanceTimer_hpp
+#define mrg_test_ScopedPerformanceTimer_hpp
+
+#include <cstdint>
+#include <ctime>
+#include <iostream>
+
+#include "TestParameters.hpp"
+
+namespace mrg
+{
+namespace test
+{
+
+ /**
+ * \brief Scoped timer class that starts timing on construction and finishes on
destruction.
+ *
+ * This simple scoped timer class will record the start time on construction. On
destruction (going out of scope),
+ * it will record the stop time, and will then print out the elapsed time and some
simple performance numbers.
+ * The performance calculations are made from the data in the supplied TestParameters
struct.
+ *
+ * Output is in the following format:
+ * <pre>
+ * TEST RESULTS:
+ * Msgs per thread: 10000
+ * Msg size: 2048
+ * No. queues: 2
+ * No. threads/queue: 2
+ * Time taken: 1.6626 sec
+ * Total no. msgs: 40000
+ * Msg throughput: 24.0587 kMsgs/sec
+ * 49.2723 MB/sec
+ * </pre>
+ */
+ class ScopedPerformanceTimer
+ {
+ protected:
+ TestParameters _testParams; ///< Test parameters used for performance
calculations
+ std::ostream& _outStream; ///< Output stream for the performance data
sent at destruction
+ ::timespec _startTime; ///< Start time, set on construction
+
+ /**
+ * \brief Convert ::timespec to seconds
+ *
+ * Static function to convert a ::timespec struct into a double representation in
seconds.
+ *
+ * \param ts ::timespec struct containing the time to be converted.
+ * \return A double which represents the time in parameter ts in seconds.
+ */
+ static double _s_getDoubleTime(const ::timespec& ts);
+ public:
+ /**
+ * \brief Constructor
+ *
+ * Constructor. Will start the time interval measurement.
+ *
+ * \param tp Test parameter details used to calculate the performance results.
+ * \param os Output stream to which the results will be sent on destruction.
+ */
+ ScopedPerformanceTimer(const TestParameters& tp,
+ std::ostream& os = std::cout);
+
+ /**
+ * \brief Destructor
+ *
+ * Destructor. Will stop the time interval measurement and send the performance
results to the out stream
+ * object _outStream.
+ */
+ ~ScopedPerformanceTimer();
+ };
+
+} // namespace test
+} // namespace mrg
+
+#endif // mrg_test_ScopedPerformanceTimer_hpp
Modified: store/trunk/cpp/perf/StorePerformanceTest.cpp
===================================================================
--- store/trunk/cpp/perf/StorePerformanceTest.cpp 2010-12-03 19:48:36 UTC (rev 4422)
+++ store/trunk/cpp/perf/StorePerformanceTest.cpp 2010-12-03 21:03:35 UTC (rev 4423)
@@ -43,7 +43,7 @@
#include <getopt.h>
#include <unistd.h>
-#include "PerformanceTimer.hpp"
+#include "ScopedPerformanceTimer.hpp"
#ifdef JOURNAL2
#include "jrnl2/jdir.hpp"
@@ -57,13 +57,13 @@
{
#ifdef JOURNAL2
-StorePerformanceTest::StorePerformanceTest(const TestParameters& tp, const
mrg::journal2::store_params& sp) :
+StorePerformanceTest::StorePerformanceTest(const TestParameters& tp, const
mrg::journal2::JournalParameters& jp) :
#else
-StorePerformanceTest::StorePerformanceTest(const TestParameters& tp, const
JournalParameters& sp) :
+StorePerformanceTest::StorePerformanceTest(const TestParameters& tp, const
JournalParameters& jp) :
#endif
_test_params(tp),
- _store_params(sp),
- _msg_data(new char[tp._msg_size])
+ _store_params(jp),
+ _msg_data(new char[tp._msgSize])
{}
StorePerformanceTest::~StorePerformanceTest()
@@ -80,33 +80,37 @@
StorePerformanceTest::_prepare_journals()
{
#ifdef JOURNAL2
- if (mrg::journal2::jdir::exists(_store_params._jrnl_dir))
mrg::journal2::jdir::delete_dir(_store_params._jrnl_dir);
- mrg::journal2::jdir::create_dir(_store_params._jrnl_dir);
+ if (mrg::journal2::jdir::exists(_store_params._jrnlDir)) {
+ mrg::journal2::jdir::delete_dir(_store_params._jrnlDir);
+ }
+ mrg::journal2::jdir::create_dir(_store_params._jrnlDir);
mrg::journal2::jrnl* jp;
#else
- if (mrg::journal::jdir::exists(_store_params._jrnl_dir))
mrg::journal::jdir::delete_dir(_store_params._jrnl_dir);
- mrg::journal::jdir::create_dir(_store_params._jrnl_dir);
+ if (mrg::journal::jdir::exists(_store_params._jrnlDir)) {
+ mrg::journal::jdir::delete_dir(_store_params._jrnlDir);
+ }
+ mrg::journal::jdir::create_dir(_store_params._jrnlDir);
mrg::journal::jcntl* jp;
#endif
JournalInstance* ptp;
- for (uint16_t j = 0; j < _test_params._num_queues; j++)
+ for (uint16_t j = 0; j < _test_params._numQueues; j++)
{
std::ostringstream jname;
jname << "jrnl_" << std::setw(4) <<
std::setfill('0') << j;
std::ostringstream jdir;
- jdir << _store_params._jrnl_dir << "/" <<
jname.str();
+ jdir << _store_params._jrnlDir << "/" <<
jname.str();
#ifdef JOURNAL2
- jp = new mrg::journal2::jrnl(jname.str(), jdir.str(),
_store_params._jrnl_base_filename);
+ jp = new mrg::journal2::jrnl(jname.str(), jdir.str(),
_store_params._jrnlBaseFileName);
#else
- jp = new mrg::journal::jcntl(jname.str(), jdir.str(),
_store_params._jrnl_base_filename);
+ jp = new mrg::journal::jcntl(jname.str(), jdir.str(),
_store_params._jrnlBaseFileName);
#endif
- ptp = new JournalInstance(_test_params._num_msgs, _test_params._msg_size,
_msg_data, jp);
+ ptp = new JournalInstance(_test_params._numMsgs, _test_params._msgSize,
_msg_data, jp);
#ifdef JOURNAL2
jp->initialize(&_store_params, ptp);
#else
- jp->initialize(_store_params._num_jfiles, _store_params._auto_expand,
_store_params._ae_max_jfiles,
- _store_params._jfsize_sblks, _store_params._wcache_num_pages,
- _store_params._wcache_pgsize_sblks, ptp);
+ jp->initialize(_store_params._numJrnlFiles, _store_params._autoExpand,
_store_params._autoExpandMaxJrnlFiles,
+ _store_params._jrnlFileSize_sblks,
_store_params._writeBuffNumPgs,
+ _store_params._writeBuffPgSize_sblks, ptp);
#endif
_tests.push_back(ptp);
@@ -121,13 +125,12 @@
_prepare_journals();
{
// --- Start of timed section ---
- mrg::test::PerformanceTimer t(_test_params._num_msgs, _test_params._msg_size,
_test_params._num_queues,
- _test_params._num_thread_pairs_per_queue);
+ ScopedPerformanceTimer pt(_test_params);
- for (uint16_t q=0; q<_test_params._num_queues; q++)
+ for (uint16_t q=0; q<_test_params._numQueues; q++)
{
// Launch threads in pairs
- for (uint16_t t=0; t<_test_params._num_thread_pairs_per_queue * 2; t++)
+ for (uint16_t t=0; t<_test_params._numThreadPairsPerQueue * 2; t++)
{
tp = new std::thread(std::ref(*_tests[q]));
threads.push_back(tp);
@@ -152,59 +155,59 @@
std::cout << std::endl;
std::cout << "Test params:" << std::endl;
std::cout << " -M --num_msgs: Number of messages to send
["
- << TestParameters::_default_num_msgs << "]" <<
std::endl;
+ << TestParameters::_s_defaultNumMsgs << "]" <<
std::endl;
std::cout << " -S --msg_size: Size of each message to be
sent ["
- << TestParameters::_default_msg_size << "]" <<
std::endl;
+ << TestParameters::_s_defaultMsgSize << "]" <<
std::endl;
std::cout << " -Q --num_queues: Number of simultaneous
queues ["
- << TestParameters::_default_num_queues << "]"
<< std::endl;
+ << TestParameters::_s_defaultNumQueues << "]"
<< std::endl;
std::cout << " -T --num_thread_pairs_per_queue: Number of thread pairs per
queue ["
- << TestParameters::_default_num_thread_pairs_per_queue <<
"]" << std::endl;
+ << TestParameters::_s_defaultNumThreadPairsPerQueue <<
"]" << std::endl;
std::cout << " -E --enq_txn_blk_size: Enqueue transaction block
size (0=non-txn) ["
- << TestParameters::_default_enq_txn_blk_size << "]"
<< std::endl;
+ << TestParameters::_s_defaultEnqTxnBlkSize << "]"
<< std::endl;
std::cout << " -D --deq_txn_blk_size: Dequeue transaction block
size (0=non-txn) ["
- << TestParameters::_default_deq_txn_blk_size << "]"
<< std::endl;
+ << TestParameters::_s_defaultDeqTxnBlkSize << "]"
<< std::endl;
std::cout << std::endl;
std::cout << "Store params:" << std::endl;
#ifdef JOURNAL2
std::cout << " -d --jrnl_dir: Store directory
[\""
- << mrg::journal2::store_params::_default_jrnl_dir <<
"\"]" << std::endl;
+ << mrg::journal2::JournalParameters::_s_defaultJrnlDir <<
"\"]" << std::endl;
std::cout << " -b --jrnl_base_filename: Base name for journal
files [\""
- << mrg::journal2::store_params::_default_jrnl_base_filename <<
"\"]" << std::endl;
+ << mrg::journal2::JournalParameters::_s_defaultJrnlBaseFileName
<< "\"]" << std::endl;
std::cout << " -f --num_jfiles: Number of journal files
["
- << mrg::journal2::store_params::_default_num_jfiles <<
"]" << std::endl;
+ << mrg::journal2::JournalParameters::_s_defaultNumJrnlFiles <<
"]" << std::endl;
std::cout << " -s --jfsize_sblks: Size of each journal file
in sblks (512 byte blocks) ["
- << mrg::journal2::store_params::_default_jfsize_sblks <<
"]" << std::endl;
+ << mrg::journal2::JournalParameters::_s_defaultJrnlFileSize_sblks
<< "]" << std::endl;
std::cout << " -a --auto_expand: Auto-expand the journal
["
- <<
(mrg::journal2::store_params::_default_auto_expand?"T":"F") <<
"]" << std::endl;
+ <<
(mrg::journal2::JournalParameters::_s_defaultAutoExpand?"T":"F")
<< "]" << std::endl;
std::cout << " -e --ae_max_jfiles: Upper limit on number of
auto-expanded journal files ["
- << mrg::journal2::store_params::_default_ae_max_jfiles <<
"]" << std::endl;
+ << mrg::journal2::JournalParameters::_s_defaultAutoExpandMaxJrnlFiles
<< "]" << std::endl;
std::cout << " -p --wcache_num_pages: Number of write buffer
pages ["
- << mrg::journal2::store_params::_default_wcache_num_pages <<
"]" << std::endl;
+ << mrg::journal2::JournalParameters::_s_defaultWriteBuffNumPgs
<< "]" << std::endl;
std::cout << " -c --wcache_pgsize_sblks: Size of each write buffer
page in sblks (512 byte blocks) ["
- << mrg::journal2::store_params::_default_wcache_pgsize_sblks <<
"]" << std::endl;
+ << mrg::journal2::JournalParameters::_s_defaultWriteBuffPgSize_sblks
<< "]" << std::endl;
#else
std::cout << " -d --jrnl_dir: Store directory
[\""
- << JournalParameters::_default_jrnl_dir << "\"]"
<< std::endl;
+ << JournalParameters::_s_defaultJrnlDir << "\"]"
<< std::endl;
std::cout << " -b --jrnl_base_filename: Base name for journal
files [\""
- << JournalParameters::_default_jrnl_base_filename <<
"\"]" << std::endl;
+ << JournalParameters::_s_defaultJrnlBaseFileName <<
"\"]" << std::endl;
std::cout << " -f --num_jfiles: Number of journal files
["
- << JournalParameters::_default_num_jfiles << "]"
<< std::endl;
+ << JournalParameters::_s_defaultNumJrnlFiles << "]"
<< std::endl;
std::cout << " -s --jfsize_sblks: Size of each journal file
in sblks (512 byte blocks) ["
- << JournalParameters::_default_jfsize_sblks << "]"
<< std::endl;
+ << JournalParameters::_s_defaultJrnlFileSize_sblks <<
"]" << std::endl;
std::cout << " -a --auto_expand: Auto-expand the journal
["
- <<
(JournalParameters::_default_auto_expand?"T":"F") <<
"]" << std::endl;
+ <<
(JournalParameters::_s_defaultAutoExpand?"T":"F") <<
"]" << std::endl;
std::cout << " -e --ae_max_jfiles: Upper limit on number of
auto-expanded journal files ["
- << JournalParameters::_default_ae_max_jfiles << "]"
<< std::endl;
+ << JournalParameters::_s_defaultAutoExpandMaxJrnlFiles <<
"]" << std::endl;
std::cout << " -p --wcache_num_pages: Number of write buffer
pages ["
- << JournalParameters::_default_wcache_num_pages <<
"]" << std::endl;
+ << JournalParameters::_s_defaultWriteBuffNumPgs <<
"]" << std::endl;
std::cout << " -c --wcache_pgsize_sblks: Size of each write buffer
page in sblks (512 byte blocks) ["
- << JournalParameters::_default_wcache_pgsize_sblks <<
"]" << std::endl;
+ << JournalParameters::_s_defaultWriteBuffPgSize_sblks <<
"]" << std::endl;
#endif
}
bool
#ifdef JOURNAL2
-read_args(int argc, char** argv, mrg::test::TestParameters& tp,
mrg::journal2::store_params& sp)
+read_args(int argc, char** argv, mrg::test::TestParameters& tp,
mrg::journal2::JournalParameters& sp)
#else
read_args(int argc, char** argv, mrg::test::TestParameters& tp,
mrg::test::JournalParameters& sp)
#endif
@@ -241,42 +244,42 @@
{
// Test params
case 'm':
- tp._num_msgs = uint32_t(std::atol(optarg));
+ tp._numMsgs = uint32_t(std::atol(optarg));
break;
case 'S':
- tp._msg_size = uint32_t(std::atol(optarg));
+ tp._msgSize = uint32_t(std::atol(optarg));
break;
case 'q':
- tp._num_queues = uint16_t(std::atoi(optarg));
+ tp._numQueues = uint16_t(std::atoi(optarg));
break;
case 't':
- tp._num_thread_pairs_per_queue = uint16_t(std::atoi(optarg));
+ tp._numThreadPairsPerQueue = uint16_t(std::atoi(optarg));
break;
// Store params
case 'd':
- sp._jrnl_dir.assign(optarg);
+ sp._jrnlDir.assign(optarg);
break;
case 'b':
- sp._jrnl_base_filename.assign(optarg);
+ sp._jrnlBaseFileName.assign(optarg);
break;
case 'f':
- sp._num_jfiles = uint16_t(std::atoi(optarg));
+ sp._numJrnlFiles = uint16_t(std::atoi(optarg));
break;
case 's':
- sp._jfsize_sblks = uint32_t(std::atol(optarg));
+ sp._jrnlFileSize_sblks = uint32_t(std::atol(optarg));
break;
case 'a':
- sp._auto_expand = true;
+ sp._autoExpand = true;
break;
case 'e':
- sp._ae_max_jfiles = uint16_t(std::atoi(optarg));
+ sp._autoExpandMaxJrnlFiles = uint16_t(std::atoi(optarg));
break;
case 'p':
- sp._wcache_num_pages = uint16_t(std::atoi(optarg));
+ sp._writeBuffNumPgs = uint16_t(std::atoi(optarg));
break;
case 'c':
- sp._wcache_pgsize_sblks = uint32_t(std::atol(optarg));
+ sp._writeBuffPgSize_sblks = uint32_t(std::atol(optarg));
break;
// Other
@@ -299,14 +302,14 @@
{
mrg::test::TestParameters tp;
#ifdef JOURNAL2
- mrg::journal2::store_params sp;
+ mrg::journal2::JournalParameters jp;
#else
- mrg::test::JournalParameters sp;
+ mrg::test::JournalParameters jp;
#endif
- if (mrg::test::read_args(argc, argv, tp, sp)) return 1;
+ if (mrg::test::read_args(argc, argv, tp, jp)) return 1;
std::cout << tp.to_string() << std::endl;
- std::cout << sp.to_string() << std::endl;
- mrg::test::StorePerformanceTest p(tp, sp);
+ std::cout << jp.to_string() << std::endl;
+ mrg::test::StorePerformanceTest p(tp, jp);
p.run();
return 0;
Modified: store/trunk/cpp/perf/StorePerformanceTest.hpp
===================================================================
--- store/trunk/cpp/perf/StorePerformanceTest.hpp 2010-12-03 19:48:36 UTC (rev 4422)
+++ store/trunk/cpp/perf/StorePerformanceTest.hpp 2010-12-03 21:03:35 UTC (rev 4423)
@@ -38,7 +38,7 @@
#include "TestParameters.hpp"
#ifdef JOURNAL2
-#include "jrnl2/store_params.hpp"
+#include "jrnl2/JournalParameters.hpp"
#else
#include "JournalParameters.hpp"
#endif
@@ -54,7 +54,7 @@
{
const TestParameters& _test_params;
#ifdef JOURNAL2
- const mrg::journal2::store_params& _store_params;
+ const mrg::journal2::JournalParameters& _store_params;
#else
const JournalParameters& _store_params;
#endif
@@ -63,7 +63,7 @@
void _prepare_journals();
public:
#ifdef JOURNAL2
- StorePerformanceTest(const TestParameters& tp, const
mrg::journal2::store_params& sp);
+ StorePerformanceTest(const TestParameters& tp, const
mrg::journal2::JournalParameters& sp);
#else
StorePerformanceTest(const TestParameters& tp, const JournalParameters&
sp);
#endif
@@ -73,7 +73,7 @@
void print_args();
#ifdef JOURNAL2
- bool read_args(int argc, char** argv, mrg::test::TestParameters& tp,
mrg::journal2::store_params& sp);
+ bool read_args(int argc, char** argv, mrg::test::TestParameters& tp,
mrg::journal2::JournalParameters& sp);
#else
bool read_args(int argc, char** argv, mrg::test::TestParameters& tp,
mrg::test::JournalParameters& sp);
#endif
Modified: store/trunk/cpp/perf/TestParameters.cpp
===================================================================
--- store/trunk/cpp/perf/TestParameters.cpp 2010-12-03 19:48:36 UTC (rev 4422)
+++ store/trunk/cpp/perf/TestParameters.cpp 2010-12-03 21:03:35 UTC (rev 4423)
@@ -39,43 +39,43 @@
{
// static declarations
-uint32_t TestParameters::_default_num_msgs = 100;
-uint32_t TestParameters::_default_msg_size = 10;
-uint16_t TestParameters::_default_num_queues = 1;
-uint16_t TestParameters::_default_num_thread_pairs_per_queue = 1;
-uint16_t TestParameters::_default_enq_txn_blk_size = 0;
-uint16_t TestParameters::_default_deq_txn_blk_size = 0;
+uint32_t TestParameters::_s_defaultNumMsgs = 100;
+uint32_t TestParameters::_s_defaultMsgSize = 10;
+uint16_t TestParameters::_s_defaultNumQueues = 1;
+uint16_t TestParameters::_s_defaultNumThreadPairsPerQueue = 1;
+uint16_t TestParameters::_s_defaultEnqTxnBlkSize = 0;
+uint16_t TestParameters::_s_defaultDeqTxnBlkSize = 0;
TestParameters::TestParameters():
- _num_msgs(_default_num_msgs),
- _msg_size(_default_msg_size),
- _num_queues(_default_num_queues),
-
_num_thread_pairs_per_queue(_default_num_thread_pairs_per_queue),
- _enq_txn_blk_size(_default_enq_txn_blk_size),
- _deq_txn_blk_size(_default_deq_txn_blk_size)
+ _numMsgs(_s_defaultNumMsgs),
+ _msgSize(_s_defaultMsgSize),
+ _numQueues(_s_defaultNumQueues),
+
_numThreadPairsPerQueue(_s_defaultNumThreadPairsPerQueue),
+ _enqTxnBlockSize(_s_defaultEnqTxnBlkSize),
+ _deqTxnBlockSize(_s_defaultDeqTxnBlkSize)
{}
-TestParameters::TestParameters(const u_int32_t num_msgs,
- const u_int32_t msg_size,
- const u_int16_t num_queues,
- const u_int16_t num_thread_pairs_per_queue,
- const u_int16_t enq_txn_blk_size,
- const u_int16_t deq_txn_blk_size) :
- _num_msgs(num_msgs),
- _msg_size(msg_size),
- _num_queues(num_queues),
- _num_thread_pairs_per_queue(num_thread_pairs_per_queue),
- _enq_txn_blk_size(enq_txn_blk_size),
- _deq_txn_blk_size(deq_txn_blk_size)
+TestParameters::TestParameters(const uint32_t numMsgs,
+ const uint32_t msgSize,
+ const uint16_t numQueues,
+ const uint16_t numThreadPairsPerQueue,
+ const uint16_t enqTxnBlockSize,
+ const uint16_t deqTxnBlockSize) :
+ _numMsgs(numMsgs),
+ _msgSize(msgSize),
+ _numQueues(numQueues),
+ _numThreadPairsPerQueue(numThreadPairsPerQueue),
+ _enqTxnBlockSize(enqTxnBlockSize),
+ _deqTxnBlockSize(deqTxnBlockSize)
{}
TestParameters::TestParameters(const TestParameters& tp):
- _num_msgs(tp._num_msgs),
- _msg_size(tp._msg_size),
- _num_queues(tp._num_queues),
-
_num_thread_pairs_per_queue(tp._num_thread_pairs_per_queue),
- _enq_txn_blk_size(tp._enq_txn_blk_size),
- _deq_txn_blk_size(tp._deq_txn_blk_size)
+ _numMsgs(tp._numMsgs),
+ _msgSize(tp._msgSize),
+ _numQueues(tp._numQueues),
+ _numThreadPairsPerQueue(tp._numThreadPairsPerQueue),
+ _enqTxnBlockSize(tp._enqTxnBlockSize),
+ _deqTxnBlockSize(tp._deqTxnBlockSize)
{}
std::string
@@ -83,12 +83,12 @@
{
std::ostringstream oss;
oss << "Test Parameters:" << std::endl;
- oss << " num_msgs = " << _num_msgs << std::endl;
- oss << " msg_size = " << _msg_size << std::endl;
- oss << " num_queues = " << _num_queues << std::endl;
- oss << " num_thread_pairs_per_queue = " <<
_num_thread_pairs_per_queue << std::endl;
- oss << " enq_txn_blk_size = " << _enq_txn_blk_size <<
std::endl;
- oss << " deq_txn_blk_size = " << _deq_txn_blk_size <<
std::endl;
+ oss << " num_msgs = " << _numMsgs << std::endl;
+ oss << " msg_size = " << _msgSize << std::endl;
+ oss << " num_queues = " << _numQueues << std::endl;
+ oss << " num_thread_pairs_per_queue = " <<
_numThreadPairsPerQueue << std::endl;
+ oss << " enq_txn_blk_size = " << _enqTxnBlockSize <<
std::endl;
+ oss << " deq_txn_blk_size = " << _deqTxnBlockSize <<
std::endl;
return oss.str();
}
Modified: store/trunk/cpp/perf/TestParameters.hpp
===================================================================
--- store/trunk/cpp/perf/TestParameters.hpp 2010-12-03 19:48:36 UTC (rev 4422)
+++ store/trunk/cpp/perf/TestParameters.hpp 2010-12-03 21:03:35 UTC (rev 4423)
@@ -40,29 +40,62 @@
namespace test
{
+ /**
+ * \brief Struct for aggregating the test parameters
+ *
+ * This struct is used to aggregate and keep together all the test parameters. These
affect the test itself, the
+ * journal geometry is aggregated in class JournalParameters.
+ */
struct TestParameters
{
- static uint32_t _default_num_msgs;
- static uint32_t _default_msg_size;
- static uint16_t _default_num_queues;
- static uint16_t _default_num_thread_pairs_per_queue;
- static uint16_t _default_enq_txn_blk_size;
- static uint16_t _default_deq_txn_blk_size;
+ static uint32_t _s_defaultNumMsgs; ///< Default number of
messages to be sent
+ static uint32_t _s_defaultMsgSize; ///< Default message size
+ static uint16_t _s_defaultNumQueues; ///< Default number of
queues
+ static uint16_t _s_defaultNumThreadPairsPerQueue; ///< Default number of
thread pairs (enq and deq) per queue
+ static uint16_t _s_defaultEnqTxnBlkSize; ///< Default transaction
block size for enqueues
+ static uint16_t _s_defaultDeqTxnBlkSize; ///< Default transaction
block size for dequeues
- uint32_t _num_msgs;
- uint32_t _msg_size;
- uint16_t _num_queues;
- uint16_t _num_thread_pairs_per_queue;
- uint16_t _enq_txn_blk_size;
- uint16_t _deq_txn_blk_size;
+ uint32_t _numMsgs; ///< Number of messages to
be sent
+ uint32_t _msgSize; ///< Message size
+ uint16_t _numQueues; ///< Number of queues
+ uint16_t _numThreadPairsPerQueue; ///< Number of thread
pairs (enq and deq) per queue
+ uint16_t _enqTxnBlockSize; ///< Transaction block
size for enqueues
+ uint16_t _deqTxnBlockSize; ///< Transaction block
size for dequeues
+
+ /**
+ * \brief Defaault constructor
+ *
+ * Default constructor. Uses the default values for all parameters.
+ */
TestParameters();
- TestParameters(const uint32_t num_msgs,
- const uint32_t msg_size,
- const uint16_t num_queues,
- const uint16_t num_thread_pairs_per_queue,
- const uint16_t enq_txn_blk_size,
- const uint16_t deq_txn_blk_size);
+
+ /**
+ * \brief Constructor
+ *
+ * Convenience constructor.
+ */
+ TestParameters(const uint32_t numMsgs,
+ const uint32_t msgSize,
+ const uint16_t numQueues,
+ const uint16_t numThreadPairsPerQueue,
+ const uint16_t enqTxnBlockSize,
+ const uint16_t deqTxnBlockSize);
+
+ /**
+ * \brief Copy constructor
+ *
+ * Copy constructor.
+ */
TestParameters(const TestParameters& tp);
+
+ /**
+ * \brief Creates a string representation of the test parameters
+ *
+ * Convenience feature which creates a multiline string representation of all the
parameters, one parameter per
+ * line.
+ *
+ * \return multiline string representation of all the parameters, one parameter
per line.
+ */
std::string to_string();
};
Modified: store/trunk/cpp/perf/m
===================================================================
--- store/trunk/cpp/perf/m 2010-12-03 19:48:36 UTC (rev 4422)
+++ store/trunk/cpp/perf/m 2010-12-03 21:03:35 UTC (rev 4423)
@@ -5,14 +5,20 @@
# The variable JOURNAL2, if defined, will link with the new journal2 namespace journal.
Otherwise the old journal
# namespace will be used.
-#JOURNAL2=1
+JOURNAL2=1
# Optimization options
#OPT="-O0 -ggdb"
OPT="-O3 -g0 -DNDEBUG"
-PERF_FILES="StorePerformanceTest.cpp JournalInstance.cpp PerformanceTimer.cpp
JournalParameters.cpp TestParameters.cpp"
+WARN_COMMON="-Wall -Werror -Wextra -pedantic-errors"
+WARN_OTHER="-Wundef -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings
-Wsign-compare \
+ -Wmissing-field-initializers -Wpacked -Wredundant-decls -Wunreachable-code
-Wno-invalid-offsetof \
+ -Winvalid-pch -Wvolatile-register-var"
+PERF_FILES="StorePerformanceTest.cpp JournalInstance.cpp ScopedPerformanceTimer.cpp
JournalParameters.cpp \
+ TestParameters.cpp"
+
if [[ ${JOURNAL2}x == x ]] ; then
JRNL_FILES="../lib/jrnl/aio.cpp ../lib/jrnl/enq_map.cpp ../lib/jrnl/jdir.cpp
../lib/jrnl/jrec.cpp ../lib/jrnl/rfc.cpp \
@@ -21,6 +27,7 @@
../lib/jrnl/fcntl.cpp ../lib/jrnl/jexception.cpp ../lib/jrnl/lpmgr.cpp
../lib/jrnl/rrfc.cpp ../lib/jrnl/txn_map.cpp \
../lib/jrnl/deq_rec.cpp ../lib/jrnl/jcntl.cpp ../lib/jrnl/jinf.cpp ../lib/jrnl/pmgr.cpp
../lib/jrnl/slock.cpp \
../lib/jrnl/txn_rec.cpp"
+WARN="${WARN_COMMON} ${WARN_OTHER}"
else
@@ -28,10 +35,11 @@
JRNL_FILES="../lib/jrnl2/dtok.cpp ../lib/jrnl2/jdir.cpp ../lib/jrnl2/jexception.cpp
../lib/jrnl2/jrnl_state.cpp \
../lib/jrnl2/smutex.cpp ../lib/jrnl2/dtok_state.cpp ../lib/jrnl2/jerrno.cpp
../lib/jrnl2/jrnl.cpp \
- ../lib/jrnl2/slock.cpp ../lib/jrnl2/store_params.cpp"
+ ../lib/jrnl2/slock.cpp ../lib/jrnl2/JournalParameters.cpp"
+WARN="${WARN_COMMON} ${WARN_OTHER} -Wshadow -Wunsafe-loop-optimizations"
fi
rm -f *.o perf
-echo g++ -o perf -I ../lib -std=c++0x ${OPT} -lrt -laio -lpthread ${DEFINES}
${PERF_FILES} ${JRNL_FILES}
-g++ -o perf -I ../lib -std=c++0x ${OPT} -lrt -laio -lpthread ${DEFINES} ${PERF_FILES}
${JRNL_FILES}
+echo g++ -o perf -I ../lib -std=c++0x ${OPT} ${WARN} -lrt -laio -lpthread ${DEFINES}
${PERF_FILES} ${JRNL_FILES}
+g++ -o perf -I ../lib -std=c++0x ${OPT} ${WARN} -lrt -laio -lpthread ${DEFINES}
${PERF_FILES} ${JRNL_FILES}