rhmessaging commits: r1188 - mgmt/notes.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-10-30 16:59:27 -0400 (Tue, 30 Oct 2007)
New Revision: 1188
Added:
mgmt/notes/errors.txt
mgmt/notes/justin-todo.txt
mgmt/notes/wooly-overview.txt
Removed:
mgmt/notes/Errors
mgmt/notes/InterfaceQuestions
mgmt/notes/ProtocolQuestions
mgmt/notes/Todo
mgmt/notes/WoolyOverview
Log:
Renames some files in notes
Deleted: mgmt/notes/Errors
===================================================================
--- mgmt/notes/Errors 2007-10-30 20:55:56 UTC (rev 1187)
+++ mgmt/notes/Errors 2007-10-30 20:59:27 UTC (rev 1188)
@@ -1,3 +0,0 @@
-[justin@localhost cumindev]$ cumindev-etags
-/home/justin/cumindev/cumin/python/cumin/.#model.py: No such file or directory
-
Deleted: mgmt/notes/InterfaceQuestions
===================================================================
--- mgmt/notes/InterfaceQuestions 2007-10-30 20:55:56 UTC (rev 1187)
+++ mgmt/notes/InterfaceQuestions 2007-10-30 20:59:27 UTC (rev 1188)
@@ -1,5 +0,0 @@
- * Should the default exchange appear in the UI at all?
-
- * Is there any place in the UI for transient queues and exchanges?
- It would seem not, except perhaps in status information.
-
Deleted: mgmt/notes/ProtocolQuestions
===================================================================
--- mgmt/notes/ProtocolQuestions 2007-10-30 20:55:56 UTC (rev 1187)
+++ mgmt/notes/ProtocolQuestions 2007-10-30 20:59:27 UTC (rev 1188)
@@ -1,19 +0,0 @@
- * Why use null for the default exchange name? It would seem
- consistent and more convenient in developing software to use a name
- such as "amq.default"
-
- * Can the routing key of the default binding to the default exchange
- for new queues be changed? How different is the default exchange
- from other types of exchanges? The docs suggest that the default
- binding is for "point and shoot" use of the broker, so it would
- make sense if the default exchange only supported simple
- queue-named routing keys, no?
-
- * I didn't run into anything that spelled out the multiplicity of
- bindings vis a vis queues. I assumed that queues and exchanges
- support many bindings.
-
- * Can a queue, for instance, be in more than one realm?
-
- * It strikes me that UML would answer many of my questions.
-
Deleted: mgmt/notes/Todo
===================================================================
--- mgmt/notes/Todo 2007-10-30 20:55:56 UTC (rev 1187)
+++ mgmt/notes/Todo 2007-10-30 20:59:27 UTC (rev 1188)
@@ -1,111 +0,0 @@
-Big picture
-
- * A more-or-less complete demonstration of an admin UI
-
-Higher
-
-Lower
-
- * more form inputs, non scalar ones too
-
- * Add an error banner to form
-
- * use wsgiref instead of BaseHTTPServer
-
- * Make sure HTTPServer handles concurrent requests; need to look at
- documentation
-
- - It does not, and it's not easily changed. Will need to switch to
- wsgi stuff, I believe.
-
- * Change declared charset to iso-8859???, not utf-8, since it's
- important to be honest
-
- * Make it a little simpler to express hrefs
-
- * Make form help buttons pop up a (for now, empty) help page
-
- * Icons: machine looking thing for vhost. For Cumin in general, I'm
- not sure. The hammer and screwdriver?
-
- * Make item counts in tab labels a little grayer, that is, less
- intense than the name
-
- * If debug is enabled, append a comment to the response containing
- render and process traces
-
- * Add ability to send a test message to a queue
-
- * Add favicon and a mapping in the server to serve it
-
- * Separate wooly stuff into its own devel subdir
-
- * Consider having a cssclass set on widgets
-
- * Use page attributes for session errors, redirect
-
- * See if we can eliminate the attr/param distinction, and use whether
- or not a param is added to a widget via add_param to do that
-
- * Add a parameter that takes a modelclass
-
- * Servers tab
-
- - Add server to group
-
- - Find/connect in bulk
-
- - Add checkboxes and bulk operations
-
- - Add an ungrouped radio button
-
- * Func host view
-
- - Remove config tab
-
- * Cluster
-
- - Add load balance action
-
- - Add remove action
-
- - Stop, start
-
- - Display load, profiles (?)
-
- * Add group type to group add,edit
-
- * Consider making add_child, add_param, add_mode, add_tab,
- etc. return their argument
-
- * Add a CuminItemSet with add/edit/remove href parts
-
- * Rename ServerGroupType to ServerGroupCategory
-
- * Add a frame() accessor to Widget
-
- * Add a sanity check traversal to the widget tree and to the
- registered sets of widgets and parameters
-
- * Add more bindings to the demo data
-
- * Add producers to the default exchange
-
- * queue: link consumers stat to consumers view
-
- * exch: link bindings, producers stats to respective views
-
- * model: get rid of the old *_count stat fields and use the new ones
-
- * Add rates to stats views
-
- * Right now, non cumin pages don't print their stack traces in the
- log
-
- * Move q,e to server level (using default vhost)
-
- * Replace all those inline td styles with a class attr
-
- * Make sure nav links are so marked
-
- * Make the status lights also be links to an appropriate view
Deleted: mgmt/notes/WoolyOverview
===================================================================
--- mgmt/notes/WoolyOverview 2007-10-30 20:55:56 UTC (rev 1187)
+++ mgmt/notes/WoolyOverview 2007-10-30 20:59:27 UTC (rev 1188)
@@ -1,40 +0,0 @@
-Widget
- - A display object
- - Usually bound to a Template
- - May have state represented in Parameters
- - Lives in a tree of widgets
- - Has a process method
- - Manipulates state, both ui state and model state
- - Called in the process phase, before rendering
- - Has a render method
- - Produces HTML
- - Called after all processing is done
-
-Template
- - A string with placeholders such as {foo}
- - A placeholder {foo} resolves to: widget.render_foo(...)
- - Or it resolves to: widget.get_child("foo").render(...)
-
-Application
- - The static state of the app
- - Holds Pages
-
-Page
- - A top-level widget with some extra methods for producing HTTP
- responses
- - The root widget of all widget trees is a page
-
-Parameter
- - Represents state for the life of the request/response
- - Attached to a widget
- - Stores its session-level state on a Session
- - Marshals and unmarshals itself to url params
-
-Session
- - The main source of state
- - Can be "branched" for producing "future states", URLs
-
-ModeSet
- - A widget that shows only one of its children
- - Used for producing various UI behaviors, tabs for instance
- - Generally useful for controlling visibility
Copied: mgmt/notes/errors.txt (from rev 1187, mgmt/notes/Errors)
===================================================================
--- mgmt/notes/errors.txt (rev 0)
+++ mgmt/notes/errors.txt 2007-10-30 20:59:27 UTC (rev 1188)
@@ -0,0 +1,3 @@
+[justin@localhost cumindev]$ cumindev-etags
+/home/justin/cumindev/cumin/python/cumin/.#model.py: No such file or directory
+
Copied: mgmt/notes/justin-todo.txt (from rev 1187, mgmt/notes/Todo)
===================================================================
--- mgmt/notes/justin-todo.txt (rev 0)
+++ mgmt/notes/justin-todo.txt 2007-10-30 20:59:27 UTC (rev 1188)
@@ -0,0 +1,111 @@
+Big picture
+
+ * A more-or-less complete demonstration of an admin UI
+
+Higher
+
+Lower
+
+ * more form inputs, non scalar ones too
+
+ * Add an error banner to form
+
+ * use wsgiref instead of BaseHTTPServer
+
+ * Make sure HTTPServer handles concurrent requests; need to look at
+ documentation
+
+ - It does not, and it's not easily changed. Will need to switch to
+ wsgi stuff, I believe.
+
+ * Change declared charset to iso-8859???, not utf-8, since it's
+ important to be honest
+
+ * Make it a little simpler to express hrefs
+
+ * Make form help buttons pop up a (for now, empty) help page
+
+ * Icons: machine looking thing for vhost. For Cumin in general, I'm
+ not sure. The hammer and screwdriver?
+
+ * Make item counts in tab labels a little grayer, that is, less
+ intense than the name
+
+ * If debug is enabled, append a comment to the response containing
+ render and process traces
+
+ * Add ability to send a test message to a queue
+
+ * Add favicon and a mapping in the server to serve it
+
+ * Separate wooly stuff into its own devel subdir
+
+ * Consider having a cssclass set on widgets
+
+ * Use page attributes for session errors, redirect
+
+ * See if we can eliminate the attr/param distinction, and use whether
+ or not a param is added to a widget via add_param to do that
+
+ * Add a parameter that takes a modelclass
+
+ * Servers tab
+
+ - Add server to group
+
+ - Find/connect in bulk
+
+ - Add checkboxes and bulk operations
+
+ - Add an ungrouped radio button
+
+ * Func host view
+
+ - Remove config tab
+
+ * Cluster
+
+ - Add load balance action
+
+ - Add remove action
+
+ - Stop, start
+
+ - Display load, profiles (?)
+
+ * Add group type to group add,edit
+
+ * Consider making add_child, add_param, add_mode, add_tab,
+ etc. return their argument
+
+ * Add a CuminItemSet with add/edit/remove href parts
+
+ * Rename ServerGroupType to ServerGroupCategory
+
+ * Add a frame() accessor to Widget
+
+ * Add a sanity check traversal to the widget tree and to the
+ registered sets of widgets and parameters
+
+ * Add more bindings to the demo data
+
+ * Add producers to the default exchange
+
+ * queue: link consumers stat to consumers view
+
+ * exch: link bindings, producers stats to respective views
+
+ * model: get rid of the old *_count stat fields and use the new ones
+
+ * Add rates to stats views
+
+ * Right now, non cumin pages don't print their stack traces in the
+ log
+
+ * Move q,e to server level (using default vhost)
+
+ * Replace all those inline td styles with a class attr
+
+ * Make sure nav links are so marked
+
+ * Make the status lights also be links to an appropriate view
Copied: mgmt/notes/wooly-overview.txt (from rev 1187, mgmt/notes/WoolyOverview)
===================================================================
--- mgmt/notes/wooly-overview.txt (rev 0)
+++ mgmt/notes/wooly-overview.txt 2007-10-30 20:59:27 UTC (rev 1188)
@@ -0,0 +1,40 @@
+Widget
+ - A display object
+ - Usually bound to a Template
+ - May have state represented in Parameters
+ - Lives in a tree of widgets
+ - Has a process method
+ - Manipulates state, both ui state and model state
+ - Called in the process phase, before rendering
+ - Has a render method
+ - Produces HTML
+ - Called after all processing is done
+
+Template
+ - A string with placeholders such as {foo}
+ - A placeholder {foo} resolves to: widget.render_foo(...)
+ - Or it resolves to: widget.get_child("foo").render(...)
+
+Application
+ - The static state of the app
+ - Holds Pages
+
+Page
+ - A top-level widget with some extra methods for producing HTTP
+ responses
+ - The root widget of all widget trees is a page
+
+Parameter
+ - Represents state for the life of the request/response
+ - Attached to a widget
+ - Stores its session-level state on a Session
+ - Marshals and unmarshals itself to url params
+
+Session
+ - The main source of state
+ - Can be "branched" for producing "future states", URLs
+
+ModeSet
+ - A widget that shows only one of its children
+ - Used for producing various UI behaviors, tabs for instance
+ - Generally useful for controlling visibility
17 years, 1 month
rhmessaging commits: r1187 - in store/trunk/cpp: lib/jrnl and 1 other directories.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2007-10-30 16:55:56 -0400 (Tue, 30 Oct 2007)
New Revision: 1187
Modified:
store/trunk/cpp/lib/BdbMessageStore.cpp
store/trunk/cpp/lib/JournalImpl.cpp
store/trunk/cpp/lib/TxnCtxt.h
store/trunk/cpp/lib/jrnl/jcntl.cpp
store/trunk/cpp/lib/jrnl/rmgr.cpp
store/trunk/cpp/lib/jrnl/txn_map.cpp
store/trunk/cpp/lib/jrnl/txn_map.hpp
store/trunk/cpp/tests/persistence.py
store/trunk/cpp/tests/system_test.sh
Log:
Added journal and bdb modes to system tests, both now pass.
Modified: store/trunk/cpp/lib/BdbMessageStore.cpp
===================================================================
--- store/trunk/cpp/lib/BdbMessageStore.cpp 2007-10-30 20:54:29 UTC (rev 1186)
+++ store/trunk/cpp/lib/BdbMessageStore.cpp 2007-10-30 20:55:56 UTC (rev 1187)
@@ -335,7 +335,8 @@
jQueue->recover(prepared, key.id); // start recovery
recoverMessages(txn, registry, queue, prepared, messages);
jQueue->recover_complete(); // start journal.
- } catch (journal::jexception& e) {
+ } catch (const journal::jexception& e) {
+std::cout << e << std::flush;
std::string s;
THROW_STORE_EXCEPTION(e.to_string(s) + queueName);
}
@@ -349,7 +350,6 @@
if (!usingJrnl()) //read all messages:
recoverMessages(txn, registry, queue_index, prepared, messages);
-
}
Modified: store/trunk/cpp/lib/JournalImpl.cpp
===================================================================
--- store/trunk/cpp/lib/JournalImpl.cpp 2007-10-30 20:54:29 UTC (rev 1186)
+++ store/trunk/cpp/lib/JournalImpl.cpp 2007-10-30 20:55:56 UTC (rev 1187)
@@ -22,6 +22,7 @@
*/
#include "JournalImpl.h"
+#include "jrnl/jerrno.hpp"
using namespace rhm::bdbstore;
@@ -52,14 +53,20 @@
// Populate PreparedTransaction lists from _tmap
for (bdbstore::PreparedTransaction::list::iterator i = prep_tx_list.begin();
i != prep_tx_list.end(); i++) {
- journal::txn_data_list tdl = _tmap.get_tdata_list(i->xid);
- assert(tdl.size()); // should never be empty
- for (journal::tdl_itr tdl_itr = tdl.begin(); tdl_itr < tdl.end(); tdl_itr++) {
- if (tdl_itr->_enq_flag) { // enqueue op
- i->enqueues->add(queue_id, tdl_itr->_rid);
- } else { // dequeue op
- i->dequeues->add(queue_id, tdl_itr->_drid);
+ try {
+ journal::txn_data_list tdl = _tmap.get_tdata_list(i->xid);
+ assert(tdl.size()); // should never be empty
+ for (journal::tdl_itr tdl_itr = tdl.begin(); tdl_itr < tdl.end(); tdl_itr++) {
+ if (tdl_itr->_enq_flag) { // enqueue op
+ i->enqueues->add(queue_id, tdl_itr->_rid);
+ } else { // dequeue op
+ i->dequeues->add(queue_id, tdl_itr->_drid);
+ }
}
}
+ catch (const journal::jexception& e) {
+ if (e.err_code() != journal::jerrno::JERR_MAP_NOTFOUND)
+ throw e;
+ }
}
}
Modified: store/trunk/cpp/lib/TxnCtxt.h
===================================================================
--- store/trunk/cpp/lib/TxnCtxt.h 2007-10-30 20:54:29 UTC (rev 1186)
+++ store/trunk/cpp/lib/TxnCtxt.h 2007-10-30 20:55:56 UTC (rev 1187)
@@ -90,7 +90,7 @@
public:
TxnCtxt(IdSequence* _loggedtx=NULL) : loggedtx(_loggedtx), txn(0) {
- if (loggedtx) tid = "rhm-tid" + getCount();
+ if (loggedtx){ tid.assign( "rhm-tid"); tid+=getCount(); }
}
/**
Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp 2007-10-30 20:54:29 UTC (rev 1186)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp 2007-10-30 20:55:56 UTC (rev 1187)
@@ -199,7 +199,7 @@
const bool transient) throw (jexception)
{
check_wstatus("enqueue_tx_data_record");
- return _wmgr.enqueue(data_buff, tot_data_len, this_data_len, dtokp, xid.c_str(), xid.size(),
+ return _wmgr.enqueue(data_buff, tot_data_len, this_data_len, dtokp, xid.data(), xid.size(),
transient);
}
@@ -237,21 +237,21 @@
jcntl::dequeue_txn_data_record(data_tok* const dtokp, const std::string& xid) throw (jexception)
{
check_wstatus("dequeue_data");
- return _wmgr.dequeue(dtokp, xid.c_str(), xid.size());
+ return _wmgr.dequeue(dtokp, xid.data(), xid.size());
}
const iores
jcntl::txn_abort(data_tok* const dtokp, const std::string& xid) throw (jexception)
{
check_wstatus("txn_abort");
- return _wmgr.abort(dtokp, xid.c_str(), xid.size());
+ return _wmgr.abort(dtokp, xid.data(), xid.size());
}
const iores
jcntl::txn_commit(data_tok* const dtokp, const std::string& xid) throw (jexception)
{
check_wstatus("txn_commit");
- return _wmgr.commit(dtokp, xid.c_str(), xid.size());
+ return _wmgr.commit(dtokp, xid.data(), xid.size());
}
const bool
Modified: store/trunk/cpp/lib/jrnl/rmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/rmgr.cpp 2007-10-30 20:54:29 UTC (rev 1186)
+++ store/trunk/cpp/lib/jrnl/rmgr.cpp 2007-10-30 20:55:56 UTC (rev 1187)
@@ -215,7 +215,7 @@
rmgr::read(void** const datapp, size_t& dsize, void** const xidpp, size_t& xidsize, bool& transient,
data_tok* dtokp) throw (jexception)
{
-//std::cout << " rmgr::read()" << std::flush;
+//std::cout << " rmgr::read() ro=" << (_jc->is_read_only()?"T":"F") << std::flush;
iores res = pre_read_check(dtokp);
if (res != RHM_IORES_SUCCESS)
@@ -281,34 +281,44 @@
bool is_enq = false;
try
{
-//std::cout << " ?" << _hdr._rid << std::flush;
+//std::cout << " rid=" << _hdr._rid << std::flush;
fid = _emap.get_fid(_hdr._rid);
-//std::cout << "-ok" << std::flush;
+//std::cout << ":ok" << std::flush;
is_enq = true;
}
catch (jexception& e)
{
+ // Block read for transactionally locked record (only when not recovering)
if (e.err_code() == jerrno::JERR_MAP_LOCKED && !_jc->is_read_only())
throw e;
+//if (e.err_code() == jerrno::JERR_MAP_LOCKED) std::cout << ":locked" << std::flush;
- // Ok, not in emap, now search tmap for recover
+ // (Recover mode only) Ok, not in emap - now search tmap, if present then read
if (_jc->is_read_only())
{
std::vector<std::string> xid_list;
_tmap.xid_list(xid_list);
- for (std::vector<std::string>::iterator itr = xid_list.begin(); itr != xid_list.end() && !is_enq; itr++)
+ for (std::vector<std::string>::iterator itr = xid_list.begin();
+ itr != xid_list.end() && !is_enq; itr++)
{
+//std::cout << "[xid=" << *itr << ":" << std::flush;
txn_data_list tx_list = _tmap.get_tdata_list(*itr);
- for (tdl_itr ditr = tx_list.begin(); ditr != tx_list.end() && !is_enq; ditr++)
+ for (tdl_itr ditr = tx_list.begin(); ditr != tx_list.end() && !is_enq;
+ ditr++)
{
- if (ditr->_rid == _hdr._rid)
- is_enq = true;
+//std::cout << (ditr->_enq_flag?"enq":"deq") << ",rid=" << ditr->_rid << std::flush;
+//if (!ditr->_enq_flag) std::cout << ",drid=" << ditr->_drid << std::flush;
+ if (ditr->_enq_flag)
+ is_enq = ditr->_rid == _hdr._rid;
+ else
+ is_enq = ditr->_drid == _hdr._rid;
}
+//std::cout << "]" << std::flush;
}
- }
-//std::cout << "-nf" << std::flush;
+ }
}
#endif
+//std::cout << (is_enq?":enq":":not-enq") << std::flush;
if (is_enq) // ok, this record is enqueued, check it, then read it...
{
//std::cout << "e" << std::flush;
Modified: store/trunk/cpp/lib/jrnl/txn_map.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/txn_map.cpp 2007-10-30 20:54:29 UTC (rev 1186)
+++ store/trunk/cpp/lib/jrnl/txn_map.cpp 2007-10-30 20:55:56 UTC (rev 1187)
@@ -93,7 +93,7 @@
{
std::stringstream ss;
ss << std::hex << "xid=\"" << xid << "\"";
- throw jexception(jerrno::JERR_MAP_NOTFOUND, ss.str(), "txn_map", "txn_data_list");
+ throw jexception(jerrno::JERR_MAP_NOTFOUND, ss.str(), "txn_map", "get_tdata_list");
}
return itr->second;
}
Modified: store/trunk/cpp/lib/jrnl/txn_map.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/txn_map.hpp 2007-10-30 20:54:29 UTC (rev 1186)
+++ store/trunk/cpp/lib/jrnl/txn_map.hpp 2007-10-30 20:55:56 UTC (rev 1187)
@@ -58,7 +58,8 @@
u_int16_t _fid; ///< File id, to be used when transferring to emap on commit
bool _enq_flag; ///< If true, enq op, otherwise deq op
bool _aio_compl; ///< Initially false, set to true when AIO returns
- txn_data_struct(const u_int64_t rid, const u_int64_t drid, const u_int16_t fid, const bool enq_flag);
+ txn_data_struct(const u_int64_t rid, const u_int64_t drid, const u_int16_t fid,
+ const bool enq_flag);
};
typedef txn_data_struct txn_data;
typedef std::vector<txn_data> txn_data_list;
Modified: store/trunk/cpp/tests/persistence.py
===================================================================
--- store/trunk/cpp/tests/persistence.py 2007-10-30 20:54:29 UTC (rev 1186)
+++ store/trunk/cpp/tests/persistence.py 2007-10-30 20:55:56 UTC (rev 1187)
@@ -251,7 +251,7 @@
def xid(self, txid, branchqual = ''):
- return pack('LBB', 0, len(txid), len(branchqual)) + txid + branchqual
+ return pack('!LBB', 0, len(txid), len(branchqual)) + txid + branchqual
def txswap(self, src, dest, tx):
self.assertEqual(self.XA_OK, self.channel.dtx_demarcation_start(xid=tx).status)
Modified: store/trunk/cpp/tests/system_test.sh
===================================================================
--- store/trunk/cpp/tests/system_test.sh 2007-10-30 20:54:29 UTC (rev 1186)
+++ store/trunk/cpp/tests/system_test.sh 2007-10-30 20:55:56 UTC (rev 1187)
@@ -33,6 +33,7 @@
exit
fi
+WORKING_DIR=/var/rhm
QPIDD=$QPID_DIR/cpp/src/qpidd
if test "$VERBOSE" = yes; then
@@ -58,19 +59,36 @@
fail=0
-for p in `seq 1 6`; do
- log="$abs_srcdir/vg-log.$p"
- $vg $QPIDD -s $LIBBDBSTORE >> "$abs_srcdir/qpid.log" 2> $log & pid=$!
- sleep 5
+let sync=0
+JRNLFLAGS=''
+while ((sync <= 1)); do
+ echo
+ echo '*** FIXME: Journal cannot be started when previous mode was BDB and database exists.'
+ rm -rf $WORKING_DIR/*
+ if ((sync == 1)); then
+ JRNLFLAGS='--store-async yes'
+ mode='jrnl'
+ echo 'Journal (AIO) persistence...'
+ else
+ mode='bdb'
+ echo 'BDB persistence...'
+ fi
+ for p in `seq 1 6`; do
+ log="$abs_srcdir/vg-log.$mode.$p"
+ echo "$vg $QPIDD -s $LIBBDBSTORE $JRNLFLAGS"
+ $vg $QPIDD -s $LIBBDBSTORE $JRNLFLAGS >> "$abs_srcdir/qpid.log" 2> $log & pid=$!
+ sleep 5
- echo phase $p...
- pwd
- python "$abs_srcdir/persistence.py" -s "$xml_spec" -p $p -r 3 || fail=1
- sleep 1
- kill -SIGINT $pid || { echo process already died; cat qpid.log ; fail=1; }
- wait $pid #temporarily disable failure until broker can shutdown cleanly|| fail=1
+ echo phase $p...
+ pwd
+ python "$abs_srcdir/persistence.py" -s "$xml_spec" -p $p -r 3 || fail=1
+ sleep 1
+ kill -SIGINT $pid || { echo process already died; cat qpid.log ; fail=1; }
+ wait $pid #temporarily disable failure until broker can shutdown cleanly|| fail=1
- vg_check $log || fail=1
+ vg_check $log || fail=1
+ done
+ ((sync++))
done
pid=0
17 years, 1 month
rhmessaging commits: r1186 - mgmt/etc.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-10-30 16:54:29 -0400 (Tue, 30 Oct 2007)
New Revision: 1186
Modified:
mgmt/etc/devel.profile
Log:
Makes sourcing etc/devel.profile idempotent again. Restores
$DEVEL_HOME/bin to the default devel path.
Modified: mgmt/etc/devel.profile
===================================================================
--- mgmt/etc/devel.profile 2007-10-30 20:46:41 UTC (rev 1185)
+++ mgmt/etc/devel.profile 2007-10-30 20:54:29 UTC (rev 1186)
@@ -4,19 +4,33 @@
export DEVEL_MODULES="mint cumin"
-export DEVEL_ORIGINAL_PYTHONPATH="$PYTHONPATH"
-PYTHONPATH="$DEVEL_HOME"/lib/python:"$HOME"/lib/python:"$DEVEL_ORIGINAL_PYTHONPATH"
+# PYTHONPATH
+
+if test -z "$DEVEL_ORIGINAL_PYTHONPATH"; then
+ export DEVEL_ORIGINAL_PYTHONPATH="$PYTHONPATH"
+fi
+
+pypath="$DEVEL_HOME"/lib/python:"$HOME"/lib/python:"$DEVEL_ORIGINAL_PYTHONPATH"
+
for module in $DEVEL_MODULES; do
- PYTHONPATH="$DEVEL_HOME"/"$module"/python:"$PYTHONPATH"
+ pypath="$DEVEL_HOME"/"$module"/python:"$pypath"
done
+
export PYTHONPATH
-export DEVEL_ORIGINAL_PATH="$PATH"
-PATH="$DEVEL_ORIGINAL_PATH"
+# PATH
+
+if test -z "$DEVEL_ORIGINAL_PATH"; then
+ export DEVEL_ORIGINAL_PATH="$PATH"
+fi
+
+path="$DEVEL_HOME"/bin:"$DEVEL_ORIGINAL_PATH"
+
for module in $DEVEL_MODULES; do
- PATH="$DEVEL_HOME"/"$module"/bin:"$PATH"
+ path="$DEVEL_HOME"/"$module"/bin:"$path"
done
-export PATH
+export PATH="$path"
+
# cumin test instance
export CUMIN_HOME="$DEVEL_HOME"/cumin-test-0
17 years, 1 month
rhmessaging commits: r1185 - mgmt/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-10-30 16:46:41 -0400 (Tue, 30 Oct 2007)
New Revision: 1185
Modified:
mgmt/mint/python/mint/
Log:
Ignore pyc files
Property changes on: mgmt/mint/python/mint
___________________________________________________________________
Name: svn:ignore
+ *.pyc
17 years, 1 month
rhmessaging commits: r1184 - in mgmt: etc and 5 other directories.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-10-30 13:57:35 -0400 (Tue, 30 Oct 2007)
New Revision: 1184
Added:
mgmt/mint/bin/
mgmt/mint/bin/mint-test
mgmt/mint/python/
mgmt/mint/python/mint/
mgmt/mint/python/mint/__init__.py
mgmt/mint/python/mint/schema.py
mgmt/mint/python/mint/updater.py
Modified:
mgmt/cumin/python/cumin/charts.py
mgmt/cumin/python/cumin/model.py
mgmt/cumin/python/cumin/page.strings
mgmt/cumin/python/cumin/queue.py
mgmt/cumin/python/cumin/queue.strings
mgmt/etc/devel.profile
mgmt/misc/mint-test.py
Log:
Adds a mint-test command, adapted from nuno's management client
script, that updates a model.
Improves the devel environment's support for multiple modules.
Makes the charts use mint model data.
A slight styling fix to radiotabs.
Modified: mgmt/cumin/python/cumin/charts.py
===================================================================
--- mgmt/cumin/python/cumin/charts.py 2007-10-29 21:57:49 UTC (rev 1183)
+++ mgmt/cumin/python/cumin/charts.py 2007-10-30 17:57:35 UTC (rev 1184)
@@ -86,11 +86,13 @@
measures = [queue.get_measurement(x) \
for x in self.measurements.get(session)]
- # XXX only get the max of the values we're going to display
+ values = dict()
+ for m in measures:
+ values[m] = m.get_values(250)
max_value = 0
for m in measures:
- max_value = max(max(m.values), max_value)
+ max_value = max(max(values[m]), max_value)
max_value = max_value * 1.1
max_value = max_value + (100 - max_value % 100)
chart.set_max_value(int(max_value))
@@ -101,7 +103,7 @@
colors = ((1,0,0), (0,0,1), (0,1,0))
for m, c in zip(measures, colors):
- chart.plot_values(m.values, color=c)
+ chart.plot_values(values[m], color=c)
chart.plot_frame()
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2007-10-29 21:57:49 UTC (rev 1183)
+++ mgmt/cumin/python/cumin/model.py 2007-10-30 17:57:35 UTC (rev 1184)
@@ -316,7 +316,7 @@
self.categories = ()
self.title = None
self.__value = None
- self.values = list()
+ self.__values = list()
self.class_ = class_
self.highlow = False
@@ -328,10 +328,10 @@
def add_value(self, value):
self.__value = value
- self.values.append(value)
+ self.__values.append(value)
- if len(self.values) > 1000:
- del self.values[0]
+ if len(self.__values) > 1000:
+ del self.__values[0]
if self.highlow:
if self.__high == None or self.__low == None:
@@ -346,11 +346,21 @@
def get_value(self):
if self.class_:
- stats = self.class_.select()[1]
- return getattr(stats, self.name, None)
+ try:
+ stats = self.class_.select().orderBy("recTime").reversed()[0]
+ return getattr(stats, self.name, None)
+ except IndexError:
+ pass
else:
return self.__value
+ def get_values(self, limit=100):
+ if self.class_:
+ stats = self.class_.select().orderBy("recTime").reversed()
+ return [getattr(x, self.name) for x in stats[:limit + 1]]
+ else:
+ return self.__values
+
def get_high(self):
return self.__high
Modified: mgmt/cumin/python/cumin/page.strings
===================================================================
--- mgmt/cumin/python/cumin/page.strings 2007-10-29 21:57:49 UTC (rev 1183)
+++ mgmt/cumin/python/cumin/page.strings 2007-10-30 17:57:35 UTC (rev 1184)
@@ -360,7 +360,7 @@
ul.radiotabs {
list-style: none;
- margin: 0.25em 0 1em 0;
+ margin: 0 0 1em 0;
padding: 0;
}
Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py 2007-10-29 21:57:49 UTC (rev 1183)
+++ mgmt/cumin/python/cumin/queue.py 2007-10-30 17:57:35 UTC (rev 1184)
@@ -355,10 +355,6 @@
self.add_tab(self.StatisticsCurrent(app, "current"))
self.add_tab(self.StatisticsHistory(app, "history"))
- def render_something(self, session, queue):
- statses = MgmtQueueStats.select()
- stats = statses[0]
-
def render_title(self, session, queue):
return "Statistics"
Modified: mgmt/cumin/python/cumin/queue.strings
===================================================================
--- mgmt/cumin/python/cumin/queue.strings 2007-10-29 21:57:49 UTC (rev 1183)
+++ mgmt/cumin/python/cumin/queue.strings 2007-10-30 17:57:35 UTC (rev 1184)
@@ -185,7 +185,6 @@
</script>
[QueueStatistics.html]
-<p>{something}</p>
<ul class="radiotabs tabs">{tabs}</ul>
<div class="radiotabs mode">{mode}</div>
Modified: mgmt/etc/devel.profile
===================================================================
--- mgmt/etc/devel.profile 2007-10-29 21:57:49 UTC (rev 1183)
+++ mgmt/etc/devel.profile 2007-10-30 17:57:35 UTC (rev 1184)
@@ -2,10 +2,21 @@
export DEVEL_HOME="$PWD"
fi
-export CUMIN_HOME="$DEVEL_HOME"/cumin-test-0
+export DEVEL_MODULES="mint cumin"
export DEVEL_ORIGINAL_PYTHONPATH="$PYTHONPATH"
-export PYTHONPATH="$CUMIN_HOME"/lib/python:"$DEVEL_HOME"/lib/python:"$HOME"/lib/python:"$PYTHONPATH"
+PYTHONPATH="$DEVEL_HOME"/lib/python:"$HOME"/lib/python:"$DEVEL_ORIGINAL_PYTHONPATH"
+for module in $DEVEL_MODULES; do
+ PYTHONPATH="$DEVEL_HOME"/"$module"/python:"$PYTHONPATH"
+done
+export PYTHONPATH
export DEVEL_ORIGINAL_PATH="$PATH"
-export PATH="$CUMIN_HOME"/bin:"$DEVEL_HOME"/bin:"$PATH"
+PATH="$DEVEL_ORIGINAL_PATH"
+for module in $DEVEL_MODULES; do
+ PATH="$DEVEL_HOME"/"$module"/bin:"$PATH"
+done
+export PATH
+
+# cumin test instance
+export CUMIN_HOME="$DEVEL_HOME"/cumin-test-0
Added: mgmt/mint/bin/mint-test
===================================================================
--- mgmt/mint/bin/mint-test (rev 0)
+++ mgmt/mint/bin/mint-test 2007-10-30 17:57:35 UTC (rev 1184)
@@ -0,0 +1,45 @@
+#!/usr/bin/env python
+
+import sys
+
+def usage():
+ print "Usage: mint-test DATABASE-URI BROKER-ADDRESS"
+ print "Example: mint-test postgresql://who@where/dbname example.com:10001"
+ sys.exit(1)
+
+from sqlobject import *
+
+try:
+ connuri = sys.argv[1]
+ conn = connectionForURI(connuri)
+ sqlhub.processConnection = conn
+except IndexError:
+ usage()
+
+from mint import *
+from mint.updater import *
+from qpid.management import ManagedBroker
+
+def do_main(dburi, brokerhost, brokerport):
+ model = MintModel(dburi)
+ model.init()
+
+ broker = ManagedBroker(host=brokerhost, port=brokerport)
+
+ updater = MintUpdater(model, broker)
+ updater.start()
+
+def main():
+ if len(sys.argv) != 3:
+ usage()
+
+ dburi, brokeraddr = sys.argv[1:]
+ brokerhost, brokerport = brokeraddr.split(":")
+
+ try:
+ do_main(dburi, brokerhost, int(brokerport))
+ except KeyboardInterrupt:
+ pass
+
+if __name__ == "__main__":
+ main()
Property changes on: mgmt/mint/bin/mint-test
___________________________________________________________________
Name: svn:executable
+ *
Added: mgmt/mint/python/mint/__init__.py
===================================================================
--- mgmt/mint/python/mint/__init__.py (rev 0)
+++ mgmt/mint/python/mint/__init__.py 2007-10-30 17:57:35 UTC (rev 1184)
@@ -0,0 +1,10 @@
+from sqlobject import *
+
+from schema import *
+
+class MintModel(object):
+ def __init__(self, dburi):
+ self.dburi = dburi
+
+ def init(self):
+ pass
Added: mgmt/mint/python/mint/schema.py
===================================================================
--- mgmt/mint/python/mint/schema.py (rev 0)
+++ mgmt/mint/python/mint/schema.py 2007-10-30 17:57:35 UTC (rev 1184)
@@ -0,0 +1,127 @@
+from sqlobject import *
+
+class MgmtServer(SQLObject):
+ class sqlmeta:
+ fromDatabase = True
+ def joinCluster():
+ pass
+
+ def leaveCluster():
+ pass
+
+
+class MgmtServerStats(SQLObject):
+ class sqlmeta:
+ fromDatabase = True
+
+class MgmtVhost(SQLObject):
+ class sqlmeta:
+ fromDatabase = True
+
+class MgmtVhostStats(SQLObject):
+ class sqlmeta:
+ fromDatabase = True
+
+class MgmtQueue(SQLObject):
+ class sqlmeta:
+ fromDatabase = True
+ def purge():
+ """Discard all messages on queue"""
+ pass
+
+ def increaseDiskSize():
+ """Increase number of disk pages allocated for this queue"""
+ pass
+
+
+class MgmtQueueStats(SQLObject):
+ class sqlmeta:
+ fromDatabase = True
+
+class MgmtExchange(SQLObject):
+ class sqlmeta:
+ fromDatabase = True
+
+class MgmtExchangeStats(SQLObject):
+ class sqlmeta:
+ fromDatabase = True
+
+class MgmtBinding(SQLObject):
+ class sqlmeta:
+ fromDatabase = True
+
+class MgmtBindingStats(SQLObject):
+ class sqlmeta:
+ fromDatabase = True
+
+class MgmtClient(SQLObject):
+ class sqlmeta:
+ fromDatabase = True
+ def close():
+ pass
+
+ def detach():
+ pass
+
+
+class MgmtClientStats(SQLObject):
+ class sqlmeta:
+ fromDatabase = True
+
+class MgmtSession(SQLObject):
+ class sqlmeta:
+ fromDatabase = True
+ def solicitAck():
+ pass
+
+ def detach():
+ pass
+
+ def resetLifespan():
+ pass
+
+ def close():
+ pass
+
+
+class MgmtSessionStats(SQLObject):
+ class sqlmeta:
+ fromDatabase = True
+
+class MgmtDestination(SQLObject):
+ class sqlmeta:
+ fromDatabase = True
+ def throttle():
+ """Apply extra rate limiting to destination: 0 = Normal, 10 = Maximum"""
+ pass
+
+ def stop():
+ pass
+
+ def start():
+ pass
+
+
+class MgmtDestinationStats(SQLObject):
+ class sqlmeta:
+ fromDatabase = True
+
+class MgmtProducer(SQLObject):
+ class sqlmeta:
+ fromDatabase = True
+
+class MgmtProducerStats(SQLObject):
+ class sqlmeta:
+ fromDatabase = True
+
+class MgmtConsumer(SQLObject):
+ class sqlmeta:
+ fromDatabase = True
+ def close():
+ pass
+
+
+class MgmtConsumerStats(SQLObject):
+ class sqlmeta:
+ fromDatabase = True
+
Added: mgmt/mint/python/mint/updater.py
===================================================================
--- mgmt/mint/python/mint/updater.py (rev 0)
+++ mgmt/mint/python/mint/updater.py 2007-10-30 17:57:35 UTC (rev 1184)
@@ -0,0 +1,57 @@
+from time import sleep
+from datetime import datetime
+
+from schema import *
+
+class MintUpdater(object):
+ def __init__(self, model, broker):
+ self.model = model
+ self.broker = broker
+
+ self.broker.configListener("XXXcontext", configCallback)
+ self.broker.instrumentationListener("XXXcontext", instCallback)
+
+ def start(self):
+ self.broker.start()
+
+ while True:
+ sleep(1)
+
+def getQueueByName(name, create=False):
+ try:
+ queues = MgmtQueue.selectBy(name=name)[:1]
+ queue = queues[0]
+ except IndexError:
+ if (create): queue = MgmtQueue()
+ return queue
+
+def configCallback(broker, oid, list, timestamps):
+ print "broker=" + broker
+ if oid == 4:
+ print list
+ d = dict(list)
+ queue = getQueueByName(d["name"], True)
+ queue.set(**d)
+ recOn = datetime.fromtimestamp(timestamps[0]/1000000000)
+ createdOn = datetime.fromtimestamp(timestamps[1]/1000000000)
+ queue.set(recTime=recOn,creationTime=createdOn)
+ print queue.id
+ print " -> " + d["name"]
+ return queue
+
+def instCallback(broker, oid, list, timestamps):
+ print "broker=" + broker
+ if oid == 4:
+ print list
+ d = dict(list)
+ queue = getQueueByName(d.pop("name"))
+ d["mgmtQueue"] = queue.id
+ recOn = datetime.fromtimestamp(timestamps[0]/1000000000)
+ queueStats = MgmtQueueStats()
+ queueStats.set(recTime=recOn)
+ queueStats.set(**d)
+ if (timestamps[2] != 0):
+ deletedOn = datetime.fromtimestamp(timestamps[2]/1000000000)
+ queue.set(deletionTime=deletedOn)
+ print queue.id
+ return queueStats
Modified: mgmt/misc/mint-test.py
===================================================================
--- mgmt/misc/mint-test.py 2007-10-29 21:57:49 UTC (rev 1183)
+++ mgmt/misc/mint-test.py 2007-10-30 17:57:35 UTC (rev 1184)
@@ -1,33 +1,44 @@
#!/usr/bin/env python
from qpid.management import ManagedBroker
+from schema import *
from time import sleep
-from schema import *
from datetime import *
from sqlobject import *
-conn = connectionForURI("postgresql://jross@localhost/mint")
+conn_uri = "postgresql://jross@localhost/mint"
+conn = connectionForURI(conn_uri)
sqlhub.processConnection = conn
-def configElement(broker, oid, list, timestamps):
+broker_address = "dhcp83-108.boston.redhat.com:10001"
+
+def getQueueByName(name, create=False):
+ try:
+ queues = MgmtQueue.selectBy(name=name)[:1]
+ queue = queues[0]
+ except IndexError:
+ if (create): queue = MgmtQueue()
+ return queue
+
+def configCallback(broker, oid, list, timestamps):
+ print "broker=" + broker
if oid == 4:
print list
-
- queue = MgmtQueue()
d = dict(list)
+ queue = getQueueByName(d["name"], True)
queue.set(**d)
recOn = datetime.fromtimestamp(timestamps[0]/1000000000)
createdOn = datetime.fromtimestamp(timestamps[1]/1000000000)
queue.set(recTime=recOn,creationTime=createdOn)
print queue.id
print " -> " + d["name"]
+ return queue
-def instElement(broker, oid, list, timestamps):
+def instCallback(broker, oid, list, timestamps):
+ print "broker=" + broker
if oid == 4:
print list
d = dict(list)
- queues = MgmtQueue.selectBy(name=d["name"])[:1]
- del d["name"]
- queue = queues[0]
+ queue = getQueueByName(d.pop("name"))
d["mgmtQueue"] = queue.id
recOn = datetime.fromtimestamp(timestamps[0]/1000000000)
queueStats = MgmtQueueStats()
@@ -37,16 +48,15 @@
deletedOn = datetime.fromtimestamp(timestamps[2]/1000000000)
queue.set(deletionTime=deletedOn)
print queue.id
-# print " -> " + d["name"]
+ return queueStats
-target1 = ManagedBroker (host="dhcp83-108.boston.redhat.com", port=10001)
-target1.configListener("172.16.83.108:10001", configElement)
-target1.instrumentationListener ("172.16.83.108:10001", instElement)
+host, port = broker_address.split(":")
+target1 = ManagedBroker(host=host, port=int(port))
+target1.configListener(broker_address, configCallback)
+target1.instrumentationListener(broker_address, instCallback)
target1.start ()
while 1:
sleep (1)
-
-
17 years, 1 month
rhmessaging commits: r1183 - in mgmt: lib and 1 other directories.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-10-29 17:57:49 -0400 (Mon, 29 Oct 2007)
New Revision: 1183
Added:
mgmt/lib/python/
mgmt/misc/mint-test.py
Modified:
mgmt/cumin/python/cumin/demo.py
mgmt/cumin/python/cumin/model.py
mgmt/cumin/python/cumin/queue.py
mgmt/cumin/python/cumin/queue.strings
Log:
In a temporarily useless fashion, connects queue statistics to real
data.
Modified: mgmt/cumin/python/cumin/demo.py
===================================================================
--- mgmt/cumin/python/cumin/demo.py 2007-10-29 15:03:14 UTC (rev 1182)
+++ mgmt/cumin/python/cumin/demo.py 2007-10-29 21:57:49 UTC (rev 1183)
@@ -187,6 +187,10 @@
mobject.unlock()
def frob_measure(self, measure):
+ # XXX if the class_ is set, we are using real data
+ if measure.class_:
+ return
+
if measure.type == "int":
if random() < 0.5:
if random() < 0.66:
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2007-10-29 15:03:14 UTC (rev 1182)
+++ mgmt/cumin/python/cumin/model.py 2007-10-29 21:57:49 UTC (rev 1183)
@@ -1,5 +1,6 @@
from wooly import *
from wooly.model import *
+from schema import *
class CuminModel(Model):
def __init__(self):
@@ -309,13 +310,14 @@
writer.write("</realm>")
class Measurement(object):
- def __init__(self, name, type):
+ def __init__(self, name, type, class_=None):
self.name = name
self.type = type
self.categories = ()
self.title = None
self.__value = None
self.values = list()
+ self.class_ = class_
self.highlow = False
self.__high = None
@@ -343,7 +345,11 @@
self.__low = value
def get_value(self):
- return self.__value
+ if self.class_:
+ stats = self.class_.select()[1]
+ return getattr(stats, self.name, None)
+ else:
+ return self.__value
def get_high(self):
return self.__high
@@ -371,45 +377,45 @@
# General
- measure = Measurement("msgDepth", "int")
+ measure = Measurement("msgDepth", "int", MgmtQueueStats)
measure.title = "Message depth"
measure.categories = ("message", "general")
measure.highlow = True
self.measurements.append(measure)
- measure = Measurement("msgTotalEnqueues", "int")
+ measure = Measurement("msgTotalEnqueues", "int", MgmtQueueStats)
measure.title = "Messages enqueued"
measure.categories = ("message", "general")
self.measurements.append(measure)
- measure = Measurement("msgTotalDequeues", "int")
+ measure = Measurement("msgTotalDequeues", "int", MgmtQueueStats)
measure.title = "Messages dequeued"
measure.categories = ("message", "general")
self.measurements.append(measure)
- measure = Measurement("byteDepth", "int")
+ measure = Measurement("byteDepth", "int", MgmtQueueStats)
measure.title = "Byte depth"
measure.categories = ("byte", "general")
measure.highlow = True
self.measurements.append(measure)
- measure = Measurement("byteTotalEnqueues", "int")
+ measure = Measurement("byteTotalEnqueues", "int", MgmtQueueStats)
measure.title = "Bytes enqueued"
measure.categories = ("byte", "general")
self.measurements.append(measure)
- measure = Measurement("byteTotalDequeues", "int")
+ measure = Measurement("byteTotalDequeues", "int", MgmtQueueStats)
measure.title = "Bytes dequeued"
measure.categories = ("byte", "general")
self.measurements.append(measure)
- measure = Measurement("consumers", "int")
+ measure = Measurement("consumers", "int", MgmtQueueStats)
measure.title = "Consumers"
measure.categories = ("general")
measure.highlow = True
self.measurements.append(measure)
- measure = Measurement("unackedMessages", "int")
+ measure = Measurement("unackedMessages", "int", MgmtQueueStats)
measure.title = "Unacknowledged messages"
measure.categories = ("general")
self.measurements.append(measure)
@@ -421,7 +427,7 @@
#measure.categories = ("disk")
#self.measurements.append(measure)
- measure = Measurement("diskPages", "int")
+ measure = Measurement("diskPages", "int", MgmtQueueStats)
measure.title = "Disk pages"
measure.categories = ("general")
self.measurements.append(measure)
@@ -433,63 +439,63 @@
# Transactional
- measure = Measurement("msgTxEnqueues", "int")
+ measure = Measurement("msgTxEnqueues", "int", MgmtQueueStats)
measure.title = "Messages enqueued"
measure.categories = ("message", "transactional")
self.measurements.append(measure)
- measure = Measurement("msgTxDequeues", "int")
+ measure = Measurement("msgTxDequeues", "int", MgmtQueueStats)
measure.title = "Messages dequeued"
measure.categories = ("message", "transactional")
self.measurements.append(measure)
- measure = Measurement("byteTxEnqueues", "int")
+ measure = Measurement("byteTxEnqueues", "int", MgmtQueueStats)
measure.title = "Bytes enqueued"
measure.categories = ("byte", "transactional")
self.measurements.append(measure)
- measure = Measurement("byteTxDequeues", "int")
+ measure = Measurement("byteTxDequeues", "int", MgmtQueueStats)
measure.title = "Bytes dequeued"
measure.categories = ("byte", "transactional")
self.measurements.append(measure)
- measure = Measurement("enqueueTxStarts", "int")
+ measure = Measurement("enqueueTxStarts", "int", MgmtQueueStats)
measure.title = "Enq. trans. started"
measure.categories = ("transaction")
self.measurements.append(measure)
- measure = Measurement("enqueueTxCommits", "int")
+ measure = Measurement("enqueueTxCommits", "int", MgmtQueueStats)
measure.title = "Enq. trans. committed"
measure.categories = ("transaction")
self.measurements.append(measure)
- measure = Measurement("enqueueTxRejects", "int")
+ measure = Measurement("enqueueTxRejects", "int", MgmtQueueStats)
measure.title = "Enq. trans. rejected"
measure.categories = ("transaction")
self.measurements.append(measure)
- measure = Measurement("enqueueTxCount", "int")
+ measure = Measurement("enqueueTxCount", "int", MgmtQueueStats)
measure.title = "Enq. trans. pending"
measure.categories = ("transaction")
measure.highlow = True
self.measurements.append(measure)
- measure = Measurement("dequeueTxStarts", "int")
+ measure = Measurement("dequeueTxStarts", "int", MgmtQueueStats)
measure.title = "Deq. trans. started"
measure.categories = ("transaction")
self.measurements.append(measure)
- measure = Measurement("dequeueTxCommits", "int")
+ measure = Measurement("dequeueTxCommits", "int", MgmtQueueStats)
measure.title = "Deq. trans. committed"
measure.categories = ("transaction")
self.measurements.append(measure)
- measure = Measurement("dequeueTxRejects", "int")
+ measure = Measurement("dequeueTxRejects", "int", MgmtQueueStats)
measure.title = "Deq. trans. rejected"
measure.categories = ("transaction")
self.measurements.append(measure)
- measure = Measurement("dequeueTxCount", "int")
+ measure = Measurement("dequeueTxCount", "int", MgmtQueueStats)
measure.title = "Deq. trans. pending"
measure.categories = ("transaction")
measure.highlow = True
@@ -497,22 +503,22 @@
# Persistent
- measure = Measurement("msgPersistEnqueues", "int")
+ measure = Measurement("msgPersistEnqueues", "int", MgmtQueueStats)
measure.title = "Messages enqueued"
measure.categories = ("message", "persistent")
self.measurements.append(measure)
- measure = Measurement("msgPersistDequeues", "int")
+ measure = Measurement("msgPersistDequeues", "int", MgmtQueueStats)
measure.title = "Messages dequeued"
measure.categories = ("message", "persistent")
self.measurements.append(measure)
- measure = Measurement("bytePersistEnqueues", "int")
+ measure = Measurement("bytePersistEnqueues", "int", MgmtQueueStats)
measure.title = "Bytes enqueued"
measure.categories = ("byte", "persistent")
self.measurements.append(measure)
- measure = Measurement("bytePersistDequeues", "int")
+ measure = Measurement("bytePersistDequeues", "int", MgmtQueueStats)
measure.title = "Bytes dequeued"
measure.categories = ("byte", "persistent")
self.measurements.append(measure)
Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py 2007-10-29 15:03:14 UTC (rev 1182)
+++ mgmt/cumin/python/cumin/queue.py 2007-10-29 21:57:49 UTC (rev 1183)
@@ -9,6 +9,8 @@
from parameters import *
from util import *
+from schema import *
+
strings = StringCatalog(__file__)
class QueueXmlPage(Page):
@@ -353,6 +355,10 @@
self.add_tab(self.StatisticsCurrent(app, "current"))
self.add_tab(self.StatisticsHistory(app, "history"))
+ def render_something(self, session, queue):
+ statses = MgmtQueueStats.select()
+ stats = statses[0]
+
def render_title(self, session, queue):
return "Statistics"
Modified: mgmt/cumin/python/cumin/queue.strings
===================================================================
--- mgmt/cumin/python/cumin/queue.strings 2007-10-29 15:03:14 UTC (rev 1182)
+++ mgmt/cumin/python/cumin/queue.strings 2007-10-29 21:57:49 UTC (rev 1183)
@@ -185,6 +185,7 @@
</script>
[QueueStatistics.html]
+<p>{something}</p>
<ul class="radiotabs tabs">{tabs}</ul>
<div class="radiotabs mode">{mode}</div>
Added: mgmt/misc/mint-test.py
===================================================================
--- mgmt/misc/mint-test.py (rev 0)
+++ mgmt/misc/mint-test.py 2007-10-29 21:57:49 UTC (rev 1183)
@@ -0,0 +1,52 @@
+#!/usr/bin/env python
+from qpid.management import ManagedBroker
+from time import sleep
+from schema import *
+from datetime import *
+from sqlobject import *
+
+conn = connectionForURI("postgresql://jross@localhost/mint")
+sqlhub.processConnection = conn
+
+def configElement(broker, oid, list, timestamps):
+ if oid == 4:
+ print list
+
+ queue = MgmtQueue()
+ d = dict(list)
+ queue.set(**d)
+ recOn = datetime.fromtimestamp(timestamps[0]/1000000000)
+ createdOn = datetime.fromtimestamp(timestamps[1]/1000000000)
+ queue.set(recTime=recOn,creationTime=createdOn)
+ print queue.id
+ print " -> " + d["name"]
+
+def instElement(broker, oid, list, timestamps):
+ if oid == 4:
+ print list
+ d = dict(list)
+ queues = MgmtQueue.selectBy(name=d["name"])[:1]
+ del d["name"]
+ queue = queues[0]
+ d["mgmtQueue"] = queue.id
+ recOn = datetime.fromtimestamp(timestamps[0]/1000000000)
+ queueStats = MgmtQueueStats()
+ queueStats.set(recTime=recOn)
+ queueStats.set(**d)
+ if (timestamps[2] != 0):
+ deletedOn = datetime.fromtimestamp(timestamps[2]/1000000000)
+ queue.set(deletionTime=deletedOn)
+ print queue.id
+# print " -> " + d["name"]
+
+
+target1 = ManagedBroker (host="dhcp83-108.boston.redhat.com", port=10001)
+target1.configListener("172.16.83.108:10001", configElement)
+target1.instrumentationListener ("172.16.83.108:10001", instElement)
+
+target1.start ()
+
+while 1:
+ sleep (1)
+
+
17 years, 1 month
rhmessaging commits: r1182 - store/trunk/cpp/lib.
by rhmessaging-commits@lists.jboss.org
Author: cctrieloff
Date: 2007-10-29 11:03:14 -0400 (Mon, 29 Oct 2007)
New Revision: 1182
Modified:
store/trunk/cpp/lib/BdbMessageStore.cpp
Log:
- set bdb home
- hack for missing event loop
- memory cleanup
Modified: store/trunk/cpp/lib/BdbMessageStore.cpp
===================================================================
--- store/trunk/cpp/lib/BdbMessageStore.cpp 2007-10-29 14:20:07 UTC (rev 1181)
+++ store/trunk/cpp/lib/BdbMessageStore.cpp 2007-10-29 15:03:14 UTC (rev 1182)
@@ -70,9 +70,11 @@
useAsync = async;
if (dir.size()>0) storeDir = dir;
+ string bdbdir = storeDir + "/rhm/dat/";
+ journal::jdir::create_dir(bdbdir);
TxnCtxt txn;
try {
- env.open(envPath, DB_THREAD | DB_CREATE | DB_INIT_TXN | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_USE_ENVIRON, 0);
+ env.open(bdbdir.c_str(), DB_THREAD | DB_CREATE | DB_INIT_TXN | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_USE_ENVIRON, 0);
txn.begin(env);
open(queueDb, txn.get(), "queues.db", false);
@@ -466,9 +468,11 @@
dtokp.reset();
dtokp.set_wstate(DataTokenImpl::ENQ);
- ::free(dbuff);
- if (xidbuff)
+
+ if (xidbuff)
::free(xidbuff);
+ else if (dbuff)
+ ::free(dbuff);
break;
}
case rhm::journal::RHM_IORES_AIO_WAIT:
@@ -755,7 +759,11 @@
checkInit();
try {
JournalImpl* jc = static_cast<JournalImpl*>(queue.getExternalQueueStore());
- if (jc) jc->flush();
+ if (jc){
+ jc->flush();
+ ::usleep(10000); /////////////// hack ----------- FIX!!
+ jc->get_wr_events();
+ }
}catch ( journal::jexception& e) {
std::string str;
THROW_STORE_EXCEPTION("Flush failed: " + e.to_string(str) );
@@ -904,6 +912,10 @@
// add queue* to the txn map..
if (ctxt) txn->addXidRecord(queue.getExternalQueueStore());
async_dequeue(ctxt, msg, queue);
+ // added here as we are not doing it async on call back
+ msg.dequeueComplete();
+ if ( msg.isDequeueComplete() ) // clear id after last dequeue
+ msg.setPersistenceId(0);
} else if (txn->isTPC()) {
//if this is part of a 2pc transaction, then only record the dequeue now,
@@ -1176,7 +1188,7 @@
string BdbMessageStore::getJrnlBaseDir()
{
std::stringstream dir;
- dir << storeDir<< "/rhm/" ;
+ dir << storeDir<< "/rhm/jrnl/" ;
return dir.str();
}
17 years, 1 month
rhmessaging commits: r1181 - in mgmt: cumin-test-0/lib and 1 other directories.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-10-29 10:20:07 -0400 (Mon, 29 Oct 2007)
New Revision: 1181
Added:
mgmt/cumin-test-0/lib/
mgmt/cumin-test-0/lib/python
Modified:
mgmt/etc/devel.profile
Log:
Part 2 of 2: Finishes changing paths to support external modules.
Added: mgmt/cumin-test-0/lib/python
===================================================================
--- mgmt/cumin-test-0/lib/python (rev 0)
+++ mgmt/cumin-test-0/lib/python 2007-10-29 14:20:07 UTC (rev 1181)
@@ -0,0 +1 @@
+link ../../cumin/python
\ No newline at end of file
Property changes on: mgmt/cumin-test-0/lib/python
___________________________________________________________________
Name: svn:special
+ *
Modified: mgmt/etc/devel.profile
===================================================================
--- mgmt/etc/devel.profile 2007-10-29 14:17:00 UTC (rev 1180)
+++ mgmt/etc/devel.profile 2007-10-29 14:20:07 UTC (rev 1181)
@@ -4,8 +4,8 @@
export CUMIN_HOME="$DEVEL_HOME"/cumin-test-0
-export PYTHONPATH="$CUMIN_HOME"/lib:"$CUMIN_HOME"/python
+export DEVEL_ORIGINAL_PYTHONPATH="$PYTHONPATH"
+export PYTHONPATH="$CUMIN_HOME"/lib/python:"$DEVEL_HOME"/lib/python:"$HOME"/lib/python:"$PYTHONPATH"
export DEVEL_ORIGINAL_PATH="$PATH"
-
-export PATH="$CUMIN_HOME"/bin:"$DEVEL_HOME"/bin:"$DEVEL_ORIGINAL_PATH"
+export PATH="$CUMIN_HOME"/bin:"$DEVEL_HOME"/bin:"$PATH"
17 years, 1 month
rhmessaging commits: r1180 - mgmt/cumin-test-0.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-10-29 10:17:00 -0400 (Mon, 29 Oct 2007)
New Revision: 1180
Removed:
mgmt/cumin-test-0/lib
mgmt/cumin-test-0/python
Log:
Part 1 of 2 of changing paths for the test cumin instance so that
external libraries may be used.
Deleted: mgmt/cumin-test-0/lib
===================================================================
--- mgmt/cumin-test-0/lib 2007-10-28 18:00:27 UTC (rev 1179)
+++ mgmt/cumin-test-0/lib 2007-10-29 14:17:00 UTC (rev 1180)
@@ -1 +0,0 @@
-link ../lib
\ No newline at end of file
Deleted: mgmt/cumin-test-0/python
===================================================================
--- mgmt/cumin-test-0/python 2007-10-28 18:00:27 UTC (rev 1179)
+++ mgmt/cumin-test-0/python 2007-10-29 14:17:00 UTC (rev 1180)
@@ -1 +0,0 @@
-link ../cumin/python
\ No newline at end of file
17 years, 1 month
rhmessaging commits: r1179 - in mgmt: notes and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-10-28 14:00:27 -0400 (Sun, 28 Oct 2007)
New Revision: 1179
Modified:
mgmt/cumin/python/cumin/page.strings
mgmt/notes/Todo
Log:
Makes the status light numbers easier to read.
Modified: mgmt/cumin/python/cumin/page.strings
===================================================================
--- mgmt/cumin/python/cumin/page.strings 2007-10-28 17:55:25 UTC (rev 1178)
+++ mgmt/cumin/python/cumin/page.strings 2007-10-28 18:00:27 UTC (rev 1179)
@@ -416,7 +416,6 @@
height: 1em;
margin: 0.25em 1px 0 0;
padding: 0.15em;
- color: #fff;
font-size: 0.8em;
text-align: center;
line-height: 1.1em;
@@ -424,10 +423,12 @@
div.statuslight.red {
background-color: #e33;
+ color: #fd3;
}
div.statuslight.yellow {
background-color: #fd3;
+ color: #e33;
}
div.statuslight.green {
Modified: mgmt/notes/Todo
===================================================================
--- mgmt/notes/Todo 2007-10-28 17:55:25 UTC (rev 1178)
+++ mgmt/notes/Todo 2007-10-28 18:00:27 UTC (rev 1179)
@@ -107,3 +107,5 @@
* Replace all those inline td styles with a class attr
* Make sure nav links are so marked
+
+ * Make the status lights also be links to an appropriate view
17 years, 1 month