rhmessaging commits: r1611 - in store/trunk/cpp: tests/jrnl/jtt and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2008-01-25 14:39:32 -0500 (Fri, 25 Jan 2008)
New Revision: 1611
Modified:
store/trunk/cpp/lib/jrnl/jcntl.cpp
store/trunk/cpp/lib/jrnl/txn_map.cpp
store/trunk/cpp/lib/jrnl/txn_map.hpp
store/trunk/cpp/tests/jrnl/jtt/_ut_test_case_set.cpp
store/trunk/cpp/tests/jrnl/jtt/jfile_chk.py
store/trunk/cpp/tests/jrnl/jtt/jrnl_instance.cpp
store/trunk/cpp/tests/jrnl/jtt/test_case_set.cpp
store/trunk/cpp/tests/jrnl/jtt/test_case_set.hpp
store/trunk/cpp/tests/jrnl/jtt/test_mgr.cpp
Log:
Various fixes for recover, especially transactional recover, both in the journal and the test tool.
Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp 2008-01-25 16:50:04 UTC (rev 1610)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp 2008-01-25 19:39:32 UTC (rev 1611)
@@ -448,7 +448,11 @@
{
_wmgr.get_events(pmgr::UNUSED);
if (cnt++ > MAX_AIO_CMPL_SLEEPS)
+ {
+ // TODO: Log this!
+ std::cout << "**** JERR_JCNTL_AIOCMPLWAIT *** " << _wmgr.status_str() << std::endl;
throw jexception(jerrno::JERR_JCNTL_AIOCMPLWAIT, "jcntl", "handle_aio_wait");
+ }
::usleep(AIO_CMPL_SLEEP);
}
return true;
@@ -501,7 +505,8 @@
u_int16_t next_wr_fid = (rd._lfid + 1) % _num_jfiles;
if (rd._ffid == next_wr_fid && rd._enq_cnt_list[next_wr_fid])
rd._full = true;
-
+
+ // Remove all transactions not in prep_txn_list
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();
@@ -590,21 +595,27 @@
ar.get_xid(&xidp);
assert(xidp != 0);
std::string xid((char*)xidp, ar.xid_size());
- txn_data_list tdl = _tmap.get_remove_tdata_list(xid);
- for (tdl_itr itr = tdl.begin(); itr != tdl.end(); itr++)
+ try
{
- try
- {
- if (!itr->_enq_flag)
- _emap.unlock(itr->_drid);
- }
- catch(const jexception& e)
+ txn_data_list tdl = _tmap.get_remove_tdata_list(xid);
+ for (tdl_itr itr = tdl.begin(); itr != tdl.end(); itr++)
{
- if (e.err_code() != jerrno::JERR_MAP_NOTFOUND) throw;
+ if (itr->_enq_flag)
+ rd._enq_cnt_list[itr->_fid]--;
+ else
+ {
+ try { _emap.unlock(itr->_drid); }
+ catch(const jexception& e)
+ {
+ if (e.err_code() != jerrno::JERR_MAP_NOTFOUND) throw;
+ }
+ }
}
- if (itr->_enq_flag)
- rd._enq_cnt_list[itr->_fid]--;
}
+ catch (const jexception& e)
+ {
+ if (e.err_code() != jerrno::JERR_MAP_NOTFOUND) throw;
+ }
::free(xidp);
}
break;
@@ -617,17 +628,31 @@
cr.get_xid(&xidp);
assert(xidp != 0);
std::string xid((char*)xidp, cr.xid_size());
- txn_data_list tdl = _tmap.get_remove_tdata_list(xid);
- for (tdl_itr itr = tdl.begin(); itr != tdl.end(); itr++)
+ try
{
- if (itr->_enq_flag) // txn enqueue
- _emap.insert_fid(itr->_rid, itr->_fid);
- else // txn dequeue
+ txn_data_list tdl = _tmap.get_remove_tdata_list(xid);
+ for (tdl_itr itr = tdl.begin(); itr != tdl.end(); itr++)
{
- u_int16_t fid = _emap.get_remove_fid(itr->_drid, true);
- rd._enq_cnt_list[fid]--;
+ if (itr->_enq_flag) // txn enqueue
+ _emap.insert_fid(itr->_rid, itr->_fid);
+ else // txn dequeue
+ {
+ try
+ {
+ u_int16_t fid = _emap.get_remove_fid(itr->_drid, true);
+ rd._enq_cnt_list[fid]--;
+ }
+ catch (const jexception& e)
+ {
+ if (e.err_code() != jerrno::JERR_MAP_NOTFOUND) throw;
+ }
+ }
}
}
+ catch (const jexception& e)
+ {
+ if (e.err_code() != jerrno::JERR_MAP_NOTFOUND) throw;
+ }
::free(xidp);
}
break;
Modified: store/trunk/cpp/lib/jrnl/txn_map.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/txn_map.cpp 2008-01-25 16:50:04 UTC (rev 1610)
+++ store/trunk/cpp/lib/jrnl/txn_map.cpp 2008-01-25 19:39:32 UTC (rev 1611)
@@ -89,7 +89,7 @@
if (itr == _map.end()) // not found in map
{
std::ostringstream oss;
- oss << std::hex << "xid=\"" << xid << "\"";
+ oss << std::hex << "xid=" << xid_format(xid);
throw jexception(jerrno::JERR_MAP_NOTFOUND, oss.str(), "txn_map", "get_tdata_list");
}
return itr->second;
@@ -104,7 +104,7 @@
{
pthread_mutex_unlock(&_mutex);
std::ostringstream oss;
- oss << std::hex << "xid=\"" << xid << "\"";
+ oss << std::hex << "xid=" << xid_format(xid);
throw jexception(jerrno::JERR_MAP_NOTFOUND, oss.str(), "txn_map",
"get_remove_tdata_list");
}
@@ -134,7 +134,7 @@
if (itr == _map.end()) // not found in map
{
std::ostringstream oss;
- oss << std::hex << "xid=\"" << xid << "\"";
+ oss << std::hex << "xid=" << xid_format(xid);
throw jexception(jerrno::JERR_MAP_NOTFOUND, oss.str(), "txn_map", "get_rid_count");
}
return itr->second.size();
@@ -149,7 +149,7 @@
{
pthread_mutex_unlock(&_mutex);
std::ostringstream oss;
- oss << std::hex << "xid=\"" << xid << "\"";
+ oss << std::hex << "xid=" << xid_format(xid);
throw jexception(jerrno::JERR_MAP_NOTFOUND, oss.str(), "txn_map", "is_txn_synced");
}
bool is_synced = true;
@@ -190,7 +190,7 @@
if (ok && !found)
{
std::ostringstream oss;
- oss << std::hex << "xid=\"" << xid << "\" rid=" << rid;
+ oss << std::hex << "xid=" << xid_format(xid) << " rid=" << rid;
throw jexception(jerrno::JERR_MAP_NOTFOUND, oss.str(), "txn_map", "set_aio_compl");
}
return ok;
@@ -206,5 +206,17 @@
pthread_mutex_unlock(&_mutex);
}
+// static fn
+std::string
+txn_map::xid_format(const std::string& xid)
+{
+ if (xid.size() < 100)
+ return xid;
+ std::ostringstream oss;
+ oss << "\"" << xid.substr(0, 20) << " ... " << xid.substr(xid.size() - 20, 20);
+ oss << "\" (size: " << xid.size() << ")";
+ return oss.str();
+}
+
} // namespace journal
} // namespace rhm
Modified: store/trunk/cpp/lib/jrnl/txn_map.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/txn_map.hpp 2008-01-25 16:50:04 UTC (rev 1610)
+++ store/trunk/cpp/lib/jrnl/txn_map.hpp 2008-01-25 19:39:32 UTC (rev 1611)
@@ -129,6 +129,8 @@
inline const bool empty() const { return _map.empty(); }
inline const u_int16_t size() const { return (u_int16_t)_map.size(); }
void xid_list(std::vector<std::string>& xv);
+ private:
+ static std::string xid_format(const std::string& xid);
};
} // namespace journal
Modified: store/trunk/cpp/tests/jrnl/jtt/_ut_test_case_set.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/jtt/_ut_test_case_set.cpp 2008-01-25 16:50:04 UTC (rev 1610)
+++ store/trunk/cpp/tests/jrnl/jtt/_ut_test_case_set.cpp 2008-01-25 19:39:32 UTC (rev 1611)
@@ -111,10 +111,16 @@
test_case_set tcs;
BOOST_REQUIRE_MESSAGE(check_csv_file(csv_file.c_str()), "Test CSV file \"" << csv_file <<
"\" is missing.");
- unsigned num_tcs = tcs.append_from_csv(csv_file);
+ tcs.append_from_csv(csv_file, false);
BOOST_CHECK(!tcs.empty());
- BOOST_CHECK_EQUAL(num_tcs, unsigned(44));
BOOST_CHECK_EQUAL(tcs.size(), unsigned(44));
+ BOOST_CHECK_EQUAL(tcs.ignored(), unsigned(0));
+ tcs.clear();
+ BOOST_CHECK(tcs.empty());
+ tcs.append_from_csv(csv_file, true);
+ BOOST_CHECK(!tcs.empty());
+ BOOST_CHECK_EQUAL(tcs.size(), unsigned(18));
+ BOOST_CHECK_EQUAL(tcs.ignored(), unsigned(26));
}
Modified: store/trunk/cpp/tests/jrnl/jtt/jfile_chk.py
===================================================================
--- store/trunk/cpp/tests/jrnl/jtt/jfile_chk.py 2008-01-25 16:50:04 UTC (rev 1610)
+++ store/trunk/cpp/tests/jrnl/jtt/jfile_chk.py 2008-01-25 19:39:32 UTC (rev 1611)
@@ -119,7 +119,7 @@
def split_str(s):
if len(s) > 25:
- return s[:10] + ' ... ' + s[-10:]
+ return s[:12] + ' ... ' + s[-10:]
else:
return s
@@ -435,6 +435,7 @@
self.file_num = 0
self.fro = 0x200
self.enqueued = {}
+ self.rec_cnt = 0
self.msg_cnt = 0
self.fhdr = None
self.f = None
@@ -468,6 +469,8 @@
break
if hdr.check():
stop = True;
+ else:
+ self.rec_cnt += 1
if self.first_rec:
if self.fhdr.fro != hdr.foffs:
raise Exception('File header first record offset mismatch: fro=0x%08x; rec_offs=0x%08x' % (self.fhdr.fro, hdr.foffs))
@@ -569,7 +572,7 @@
tss = fhdr.timestamp_str()
owi_found = True
if not self.qflag:
- print ' %s: owi=%s rid=%d, fro=0x%08x ts=%s' % (jfn, fhdr.owi(), fhdr.rid, fhdr.fro, fhdr.timestamp_str())
+ print ' %s: owi=%s rid=0x%x, fro=0x%08x ts=%s' % (jfn, fhdr.owi(), fhdr.rid, fhdr.fro, fhdr.timestamp_str())
if fnum < 0 or rid < 0 or fro < 0:
raise Exception('All journal files empty')
if not self.qflag: print ' Oldest complete file: %s: rid=%d, fro=0x%08x ts=%s' % (fname, rid, fro, tss)
@@ -736,7 +739,7 @@
for h in self.enqueued:
print self.enqueued[h]
print 'WARNING: Enqueue-Dequeue mismatch, %d enqueued records remain.' % len(self.enqueued)
- print 'Test passed; %d records processed.' % self.msg_cnt
+ print '%d enqueues, %d journal records processed.' % (self.msg_cnt, self.rec_cnt)
#===============================================================================
Modified: store/trunk/cpp/tests/jrnl/jtt/jrnl_instance.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/jtt/jrnl_instance.cpp 2008-01-25 16:50:04 UTC (rev 1610)
+++ store/trunk/cpp/tests/jrnl/jtt/jrnl_instance.cpp 2008-01-25 19:39:32 UTC (rev 1611)
@@ -78,6 +78,8 @@
jrnl_instance::init_tc(test_case::shared_ptr& tcp, const bool recover_mode, const bool keep_jrnls)
throw ()
{
+ test_case_result::shared_ptr p(new test_case_result(_jpp->jid()));
+ _tcrp = p;
try
{
_tcp = tcp;
@@ -93,22 +95,19 @@
{
std::vector<std::string> prep_txn_list;
u_int64_t highest_rid;
- recover(0, 0, prep_txn_list, highest_rid);
+ recover(aio_rd_callback, aio_wr_callback, prep_txn_list, highest_rid);
recover_complete();
}
catch (const rhm::journal::jexception& e)
{
if (e.err_code() == rhm::journal::jerrno::JERR_JDIR_STAT)
- initialize(0, 0);
+ initialize(aio_rd_callback, aio_wr_callback);
else
throw;
}
}
else
initialize(aio_rd_callback, aio_wr_callback);
-
- test_case_result::shared_ptr p(new test_case_result(_jpp->jid()));
- _tcrp = p;
}
catch (const rhm::journal::jexception& e) { _tcrp->add_exception(e); }
catch (const std::exception& e) { _tcrp->add_exception(e.what()); }
@@ -189,7 +188,7 @@
{
std::ostringstream oss;
oss << "ERROR: Timeout waiting for journal \"" << _jid;
- oss << "\" to empty.";
+ oss << "\" to empty. (RHM_IORES_ENQCAPTHRESH)";
_tcrp->add_exception(oss.str());
}
else
Modified: store/trunk/cpp/tests/jrnl/jtt/test_case_set.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/jtt/test_case_set.cpp 2008-01-25 16:50:04 UTC (rev 1610)
+++ store/trunk/cpp/tests/jrnl/jtt/test_case_set.cpp 2008-01-25 19:39:32 UTC (rev 1611)
@@ -24,6 +24,7 @@
#include "test_case_set.hpp"
#include <fstream>
+#include <iostream>
namespace rhm
{
@@ -31,13 +32,16 @@
{
test_case_set::test_case_set():
- _tc_list()
+ _tc_list(),
+ _csv_ignored(0)
{}
-test_case_set::test_case_set(const std::string& csv_filename, const csv_map& cols):
- _tc_list()
+test_case_set::test_case_set(const std::string& csv_filename, const bool recover_mode,
+ const csv_map& cols):
+ _tc_list(),
+ _csv_ignored(0)
{
- append_from_csv(csv_filename, cols);
+ append_from_csv(csv_filename, recover_mode, cols);
}
test_case_set::~test_case_set()
@@ -57,10 +61,10 @@
#define CSV_BUFF_SIZE 2048
-unsigned
-test_case_set::append_from_csv(const std::string& csv_filename, const csv_map& cols)
+void
+test_case_set::append_from_csv(const std::string& csv_filename, const bool recover_mode,
+ const csv_map& cols)
{
- unsigned num_tc = 0;
char buff[CSV_BUFF_SIZE];
std::ifstream ifs(csv_filename.c_str());
while (ifs.good())
@@ -71,12 +75,13 @@
test_case::shared_ptr tcp = get_tc_from_csv(buff, cols);
if (tcp.get())
{
- append(tcp);
- num_tc++;
+ if (!recover_mode || tcp->auto_deq())
+ append(tcp);
+ else
+ _csv_ignored++;
}
}
}
- return num_tc;
}
test_case::shared_ptr
Modified: store/trunk/cpp/tests/jrnl/jtt/test_case_set.hpp
===================================================================
--- store/trunk/cpp/tests/jrnl/jtt/test_case_set.hpp 2008-01-25 16:50:04 UTC (rev 1610)
+++ store/trunk/cpp/tests/jrnl/jtt/test_case_set.hpp 2008-01-25 19:39:32 UTC (rev 1611)
@@ -64,13 +64,16 @@
private:
tcl _tc_list;
static bool _map_init;
+ unsigned _csv_ignored;
public:
test_case_set();
- test_case_set(const std::string& csv_filename, const csv_map& cols = std_csv_map);
+ test_case_set(const std::string& csv_filename, const bool recover_mode,
+ const csv_map& cols = std_csv_map);
virtual ~test_case_set();
inline const unsigned size() const { return _tc_list.size(); }
+ inline const unsigned ignored() const { return _csv_ignored; }
inline const bool empty() const { return _tc_list.empty(); }
inline void append(const test_case::shared_ptr& tc) { _tc_list.push_back(tc); }
@@ -79,10 +82,12 @@
const size_t min_xid_size, const size_t max_xid_size,
const test_case::transient_t transient,
const test_case::external_t external, const std::string& comment);
- unsigned append_from_csv(const std::string& csv_filename, const csv_map& cols = std_csv_map);
+ void append_from_csv(const std::string& csv_filename, const bool recover_mode,
+ const csv_map& cols = std_csv_map);
inline tcl_itr begin() { return _tc_list.begin(); }
inline tcl_itr end() { return _tc_list.end(); }
inline const test_case::shared_ptr& operator[](unsigned i) { return _tc_list[i]; }
+ inline void clear() { _tc_list.clear(); }
private:
test_case::shared_ptr get_tc_from_csv(const std::string& csv_line, const csv_map& cols);
Modified: store/trunk/cpp/tests/jrnl/jtt/test_mgr.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/jtt/test_mgr.cpp 2008-01-25 16:50:04 UTC (rev 1610)
+++ store/trunk/cpp/tests/jrnl/jtt/test_mgr.cpp 2008-01-25 19:39:32 UTC (rev 1611)
@@ -52,11 +52,15 @@
const bool summary = true;
std::cout << "CSV file: \"" << _opts.test_case_csv_file_name << "\"";
- test_case_set tcs(_opts.test_case_csv_file_name);
+ test_case_set tcs(_opts.test_case_csv_file_name, _opts.recover_mode);
const unsigned num_test_cases = tcs.size();
if (num_test_cases)
{
- std::cout << " (containing " << tcs.size() << " test cases)" << std::endl;
+ std::cout << " (found " << tcs.size() << " test case" << (tcs.size() != 1 ? "s" : "") <<
+ ")" << std::endl;
+ if (tcs.ignored())
+ std::cout << "WARNING: " << tcs.ignored() << " test cases were ignored. "
+ "(recover-mode selected and test has no auto-dequeue.)" << std::endl;
_opts.print_flags();
}
else
@@ -132,7 +136,7 @@
{
std::ostringstream jid;
jid << std::hex << std::setfill('0');
- jid << "test_" << std::setw(2) << std::hex << i;
+ jid << "test_" << std::setw(4) << std::hex << i;
std::ostringstream jdir;
jdir << "/tmp/" << jid.str();
jrnl_init_params::shared_ptr jpp(new jrnl_init_params(jid.str(), jdir.str(), jid.str()));
16 years, 11 months
rhmessaging commits: r1610 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-01-25 11:50:04 -0500 (Fri, 25 Jan 2008)
New Revision: 1610
Modified:
mgmt/cumin/python/cumin/charts.py
Log:
Works around a cairo 1.2.x bug which causes show_text to fail when the text is the empty string.
Modified: mgmt/cumin/python/cumin/charts.py
===================================================================
--- mgmt/cumin/python/cumin/charts.py 2008-01-25 12:27:56 UTC (rev 1609)
+++ mgmt/cumin/python/cumin/charts.py 2008-01-25 16:50:04 UTC (rev 1610)
@@ -61,7 +61,9 @@
if i % step == 0:
value = absmax - (absmax * x / float(self.width))
- cr.show_text(fmt_duration_brief(value))
+ text = fmt_duration_brief(value)
+ if text:
+ cr.show_text(text)
i += 1
16 years, 11 months
rhmessaging commits: r1609 - store/trunk/cpp/tests/jrnl/jtt.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2008-01-25 07:27:56 -0500 (Fri, 25 Jan 2008)
New Revision: 1609
Modified:
store/trunk/cpp/tests/jrnl/jtt/jfile_chk.py
Log:
Additional improvements to jfile_chk.py, last change to use hex for non-alphanumeric was too strict.
Modified: store/trunk/cpp/tests/jrnl/jtt/jfile_chk.py
===================================================================
--- store/trunk/cpp/tests/jrnl/jtt/jfile_chk.py 2008-01-24 21:43:39 UTC (rev 1608)
+++ store/trunk/cpp/tests/jrnl/jtt/jfile_chk.py 2008-01-25 12:27:56 UTC (rev 1609)
@@ -23,6 +23,7 @@
import sys
import getopt
+import string
import xml.parsers.expat
from struct import unpack, calcsize
from time import gmtime, strftime
@@ -76,12 +77,15 @@
def file_full(f):
return f.tell() >= jfsize
+def isprintable(s):
+ return s.strip(string.printable) == ''
+
def print_xid(xidsize, xid):
if xid == None:
if xidsize > 0:
raise Exception('Inconsistent XID size: xidsize=%d, xid=None' % xidsize)
return ''
- if xid.isalnum():
+ if isprintable(xid):
xidstr = split_str(xid)
else:
xidstr = hex_split_str(xid)
@@ -92,7 +96,7 @@
def print_data(dsize, data):
if data == None:
return ''
- if data.isalnum():
+ if isprintable(data):
datastr = split_str(data)
else:
datastr = hex_split_str(data)
@@ -191,9 +195,9 @@
if self.empty():
return '0x%08x: <empty>' % (self.foffs)
if self.magic[-1] == 'x':
- return '0x%08x: \"%s\"' % (self.foffs, self.magic)
+ return '0x%08x: [\"%s\"]' % (self.foffs, self.magic)
if self.magic[-1] in ['a', 'c', 'd', 'e', 'f', 'x']:
- return '0x%08x: \"%s\" v=%d e=%d f=0x%04x rid=0x%x' % (self.foffs, self.magic, self.ver, self.end, self.flags, self.rid)
+ return '0x%08x: [\"%s\" v=%d e=%d f=0x%04x rid=0x%x]' % (self.foffs, self.magic, self.ver, self.end, self.flags, self.rid)
return '0x%08x: <error, unknown magic \"%s\" (possible overwrite boundary?)>' % (self.foffs, self.magic)
def empty(self):
@@ -282,7 +286,7 @@
return self.xid_complete and self.tail_complete
def __str__(self):
- return '%s %sdrid=%d' % (Hdr.__str__(self), print_xid(self.xidsize, self.xid), self.deq_rid)
+ return '%s %sdrid=0x%x' % (Hdr.__str__(self), print_xid(self.xidsize, self.xid), self.deq_rid)
#== class TxnHdr ===============================================================
16 years, 11 months
rhmessaging commits: r1608 - mgmt/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-01-24 16:43:39 -0500 (Thu, 24 Jan 2008)
New Revision: 1608
Modified:
mgmt/mint/python/mint/__init__.py
Log:
Revert the bit masking.
Modified: mgmt/mint/python/mint/__init__.py
===================================================================
--- mgmt/mint/python/mint/__init__.py 2008-01-24 20:22:41 UTC (rev 1607)
+++ mgmt/mint/python/mint/__init__.py 2008-01-24 21:43:39 UTC (rev 1608)
@@ -1,5 +1,4 @@
import socket
-import types
from qpid.management import ManagedBroker
from datetime import *
from sqlobject import *
@@ -137,9 +136,6 @@
def sanitizeDict(self, d):
if ("id" in d):
d[self.convertIdKey("id")] = d.pop("id")
- for (key,val) in d.iteritems():
- if (type(val) is types.LongType and (val & pow(2,63) > 0)):
- d[key] = val & (~ pow(2,63))
return d
def convertIdKey(self, k):
16 years, 11 months
rhmessaging commits: r1607 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-01-24 15:22:41 -0500 (Thu, 24 Jan 2008)
New Revision: 1607
Modified:
mgmt/cumin/python/cumin/client.py
mgmt/cumin/python/cumin/exchange.py
mgmt/cumin/python/cumin/queue.py
Log:
An awkward hack to work around divide-by-zero issues in rate
calculations.
Modified: mgmt/cumin/python/cumin/client.py
===================================================================
--- mgmt/cumin/python/cumin/client.py 2008-01-24 20:21:38 UTC (rev 1606)
+++ mgmt/cumin/python/cumin/client.py 2008-01-24 20:22:41 UTC (rev 1607)
@@ -24,16 +24,16 @@
self.add_sql_column("addr", "l.address")
self.add_sql_column("bs",
"(c.bytes_from_client - p.bytes_from_client)" +
- " / extract(epoch from (c.rec_time - p.rec_time))");
+ " / (extract(epoch from (c.rec_time - p.rec_time)) + 0.0001)");
self.add_sql_column("fs",
"(c.frames_from_client - p.frames_from_client)" +
- " / extract(epoch from (c.rec_time - p.rec_time))");
+ " / (extract(epoch from (c.rec_time - p.rec_time)) + 0.0001)");
self.add_sql_column("br",
"(c.bytes_to_client - p.bytes_to_client)" +
- " / extract(epoch from (c.rec_time - p.rec_time))");
+ " / (extract(epoch from (c.rec_time - p.rec_time)) + 0.0001)");
self.add_sql_column("fr",
"(c.frames_to_client - p.frames_to_client)" +
- " / extract(epoch from (c.rec_time - p.rec_time))");
+ " / (extract(epoch from (c.rec_time - p.rec_time)) + 0.0001)");
self.ids = CheckboxIdColumn(app, "id")
self.add_column(self.ids)
Modified: mgmt/cumin/python/cumin/exchange.py
===================================================================
--- mgmt/cumin/python/cumin/exchange.py 2008-01-24 20:21:38 UTC (rev 1606)
+++ mgmt/cumin/python/cumin/exchange.py 2008-01-24 20:22:41 UTC (rev 1607)
@@ -47,16 +47,16 @@
self.add_sql_column("bindings", "c.bindings")
self.add_sql_column("mreceived",
"(c.msg_receives - p.msg_receives)" +
- " / extract(epoch from (c.rec_time - p.rec_time))");
+ " / (extract(epoch from (c.rec_time - p.rec_time)) + 0.0001)");
self.add_sql_column("breceived",
"(c.byte_receives - p.byte_receives)" +
- " / extract(epoch from (c.rec_time - p.rec_time))");
+ " / (extract(epoch from (c.rec_time - p.rec_time)) + 0.0001)");
self.add_sql_column("mrouted",
"(c.msg_routes - p.msg_routes)" +
- " / extract(epoch from (c.rec_time - p.rec_time))");
+ " / (extract(epoch from (c.rec_time - p.rec_time)) + 0.0001)");
self.add_sql_column("brouted",
"(c.byte_routes - p.byte_routes)" +
- " / extract(epoch from (c.rec_time - p.rec_time))");
+ " / (extract(epoch from (c.rec_time - p.rec_time)) + 0.0001)");
self.add_sql_column("mdropped", "c.msg_drops");
self.add_sql_column("bdropped", "c.byte_drops");
Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py 2008-01-24 20:21:38 UTC (rev 1606)
+++ mgmt/cumin/python/cumin/queue.py 2008-01-24 20:22:41 UTC (rev 1607)
@@ -31,16 +31,16 @@
self.add_sql_column("bindings", "c.bindings")
self.add_sql_column("menqueued",
"(c.msg_total_enqueues - p.msg_total_enqueues)" +
- " / extract(epoch from (c.rec_time - p.rec_time))");
+ " / (extract(epoch from (c.rec_time - p.rec_time)) + 0.0001)");
self.add_sql_column("benqueued",
"(c.byte_total_enqueues - p.byte_total_enqueues)" +
- " / extract(epoch from (c.rec_time - p.rec_time))");
+ " / (extract(epoch from (c.rec_time - p.rec_time)) + 0.0001)");
self.add_sql_column("mdequeued",
"(c.msg_total_dequeues - p.msg_total_dequeues)" +
- " / extract(epoch from (c.rec_time - p.rec_time))");
+ " / (extract(epoch from (c.rec_time - p.rec_time)) + 0.0001)");
self.add_sql_column("bdequeued",
"(c.byte_total_dequeues - p.byte_total_dequeues)" +
- " / extract(epoch from (c.rec_time - p.rec_time))");
+ " / (extract(epoch from (c.rec_time - p.rec_time)) + 0.0001)");
self.add_sql_column("mdepth", "c.msg_depth")
self.add_sql_column("bdepth", "c.byte_depth")
self.add_sql_column("mdepthaccel", "1")
16 years, 11 months
rhmessaging commits: r1606 - mgmt/cumin-test-0/etc.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-01-24 15:21:38 -0500 (Thu, 24 Jan 2008)
New Revision: 1606
Modified:
mgmt/cumin-test-0/etc/cumin.conf
Log:
Bring the test instance conf file in line with the dist one.
Modified: mgmt/cumin-test-0/etc/cumin.conf
===================================================================
--- mgmt/cumin-test-0/etc/cumin.conf 2008-01-24 20:20:42 UTC (rev 1605)
+++ mgmt/cumin-test-0/etc/cumin.conf 2008-01-24 20:21:38 UTC (rev 1606)
@@ -1,3 +1,3 @@
[main]
-data: postgresql://localhost/cumin
+data: postgresql://cumin@localhost/cumin
port: 9090
16 years, 11 months
rhmessaging commits: r1605 - mgmt/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-01-24 15:20:42 -0500 (Thu, 24 Jan 2008)
New Revision: 1605
Modified:
mgmt/mint/python/mint/__init__.py
Log:
>From nuno: mask off the original id value from the broker so that it
will fit in the db column.
Modified: mgmt/mint/python/mint/__init__.py
===================================================================
--- mgmt/mint/python/mint/__init__.py 2008-01-24 20:18:48 UTC (rev 1604)
+++ mgmt/mint/python/mint/__init__.py 2008-01-24 20:20:42 UTC (rev 1605)
@@ -1,4 +1,5 @@
import socket
+import types
from qpid.management import ManagedBroker
from datetime import *
from sqlobject import *
@@ -136,6 +137,9 @@
def sanitizeDict(self, d):
if ("id" in d):
d[self.convertIdKey("id")] = d.pop("id")
+ for (key,val) in d.iteritems():
+ if (type(val) is types.LongType and (val & pow(2,63) > 0)):
+ d[key] = val & (~ pow(2,63))
return d
def convertIdKey(self, k):
16 years, 11 months
rhmessaging commits: r1604 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-01-24 15:18:48 -0500 (Thu, 24 Jan 2008)
New Revision: 1604
Modified:
mgmt/cumin/python/cumin/broker.py
Log:
Make sure we always set the port in broker registrations.
Modified: mgmt/cumin/python/cumin/broker.py
===================================================================
--- mgmt/cumin/python/cumin/broker.py 2008-01-24 20:18:04 UTC (rev 1603)
+++ mgmt/cumin/python/cumin/broker.py 2008-01-24 20:18:48 UTC (rev 1604)
@@ -681,7 +681,7 @@
if len(elems) > 1:
reg.host, reg.port = elems[0], int(elems[1])
else:
- reg.host = elems[0]
+ reg.host, reg.port = elems[0], 5672
reg.name = names[i]
16 years, 11 months
rhmessaging commits: r1603 - mgmt/bin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-01-24 15:18:04 -0500 (Thu, 24 Jan 2008)
New Revision: 1603
Modified:
mgmt/bin/devel-reload-database
Log:
Makes the reload script work with the dist deployed db location.
Modified: mgmt/bin/devel-reload-database
===================================================================
--- mgmt/bin/devel-reload-database 2008-01-24 18:34:12 UTC (rev 1602)
+++ mgmt/bin/devel-reload-database 2008-01-24 20:18:04 UTC (rev 1603)
@@ -1,11 +1,11 @@
#!/bin/bash
-if [ -z "$1" ]; then
- echo "Usage: devel-reload-database DATABASE-NAME"
+if [ -z "$1" -o -z "$2" ]; then
+ echo "Usage: devel-reload-database DATABASE-USER DATABASE-NAME"
exit 1
fi
-psql -d "$1" -c "drop schema public cascade; create schema public"
-psql -d "$1" -f "$DEVEL_HOME"/mint/python/mint/schema.sql
+psql -U "$1" -d "$2" -c "drop schema public cascade; create schema public"
+psql -U "$1" -d "$2" -f "$DEVEL_HOME"/mint/sql/schema.sql
-python "$DEVEL_HOME"/cumin/python/cumin/demo.py postgresql://localhost/"$1"
+python "$DEVEL_HOME"/cumin/python/cumin/demo.py postgresql://"$1"@localhost/"$2"
16 years, 11 months
rhmessaging commits: r1602 - store/trunk/cpp/tests/jrnl/jtt.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2008-01-24 13:34:12 -0500 (Thu, 24 Jan 2008)
New Revision: 1602
Modified:
store/trunk/cpp/tests/jrnl/jtt/jfile_chk.py
Log:
jfile_chk.py now displays hex rather than string when msg data and xid are non alphanumeric
Modified: store/trunk/cpp/tests/jrnl/jtt/jfile_chk.py
===================================================================
--- store/trunk/cpp/tests/jrnl/jtt/jfile_chk.py 2008-01-24 16:58:17 UTC (rev 1601)
+++ store/trunk/cpp/tests/jrnl/jtt/jfile_chk.py 2008-01-24 18:34:12 UTC (rev 1602)
@@ -81,10 +81,10 @@
if xidsize > 0:
raise Exception('Inconsistent XID size: xidsize=%d, xid=None' % xidsize)
return ''
- if len(xid) > 25:
- xidstr = xid[:10] + ' ... ' + xid[-10:]
+ if xid.isalnum():
+ xidstr = split_str(xid)
else:
- xidstr = xid
+ xidstr = hex_split_str(xid)
if xidsize != len(xid):
raise Exception('Inconsistent XID size: xidsize=%d, xid(%d)=\"%s\"' % (xidsize, len(xid), xidstr))
return 'xid(%d)=\"%s\" ' % (xidsize, xidstr)
@@ -92,14 +92,33 @@
def print_data(dsize, data):
if data == None:
return ''
- if len(data) > 25:
- datastr = data[:10] + ' ... ' + data[-10:]
+ if data.isalnum():
+ datastr = split_str(data)
else:
- datastr = data
+ datastr = hex_split_str(data)
if dsize != len(data):
raise Exception('Inconsistent data size: dsize=%d, data(%d)=\"%s\"' % (dsize, len(data), datastr))
return 'data(%d)=\"%s\" ' % (dsize, datastr)
+def hex_split_str(s):
+ hex_str = ''
+ if len(s) > 10:
+ for i in range(0, 5):
+ hex_str += '%02x ' % ord(s[i])
+ hex_str += '... '
+ for i in range(len(s)-5, len(s)):
+ hex_str += '%02x ' % ord(s[i])
+ else:
+ for i in range(0, len(s)):
+ hex_str += '%02x ' % ord(s[i])
+ return hex_str
+
+def split_str(s):
+ if len(s) > 25:
+ return s[:10] + ' ... ' + s[-10:]
+ else:
+ return s
+
def inv_str(s):
si = ''
for i in range(0,len(s)):
@@ -174,7 +193,7 @@
if self.magic[-1] == 'x':
return '0x%08x: \"%s\"' % (self.foffs, self.magic)
if self.magic[-1] in ['a', 'c', 'd', 'e', 'f', 'x']:
- return '0x%08x: \"%s\" v=%d e=%d f=0x%04x rid=%d' % (self.foffs, self.magic, self.ver, self.end, self.flags, self.rid)
+ return '0x%08x: \"%s\" v=%d e=%d f=0x%04x rid=0x%x' % (self.foffs, self.magic, self.ver, self.end, self.flags, self.rid)
return '0x%08x: <error, unknown magic \"%s\" (possible overwrite boundary?)>' % (self.foffs, self.magic)
def empty(self):
@@ -319,7 +338,7 @@
def __str__(self):
magic = inv_str(self.magic_inv)
- return '[\"%s\" rid=%d]' % (magic, self.rid)
+ return '[\"%s\" rid=0x%x]' % (magic, self.rid)
def skip(self, f):
f.read(rem_in_blk(f, dblk_size))
16 years, 11 months