rhmessaging commits: r3020 - in mgmt/trunk/sesame/cpp/src: qmfgen and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: tedross
Date: 2008-12-17 14:08:18 -0500 (Wed, 17 Dec 2008)
New Revision: 3020
Modified:
mgmt/trunk/sesame/cpp/src/SysAgent.cpp
mgmt/trunk/sesame/cpp/src/qmfgen/schema.xml
Log:
Added OS-distro property
Modified: mgmt/trunk/sesame/cpp/src/SysAgent.cpp
===================================================================
--- mgmt/trunk/sesame/cpp/src/SysAgent.cpp 2008-12-17 19:00:26 UTC (rev 3019)
+++ mgmt/trunk/sesame/cpp/src/SysAgent.cpp 2008-12-17 19:08:18 UTC (rev 3020)
@@ -93,6 +93,14 @@
mgmtObject->set_version (version);
mgmtObject->set_machine (machine);
+ ifstream distro("/etc/redhat-release");
+ if (distro.good()) {
+ char text[256];
+ distro.getline(text, 255);
+ mgmtObject->set_distro(string(text));
+ distro.close();
+ }
+
agent->addObject(mgmtObject, 1);
}
Modified: mgmt/trunk/sesame/cpp/src/qmfgen/schema.xml
===================================================================
--- mgmt/trunk/sesame/cpp/src/qmfgen/schema.xml 2008-12-17 19:00:26 UTC (rev 3019)
+++ mgmt/trunk/sesame/cpp/src/qmfgen/schema.xml 2008-12-17 19:08:18 UTC (rev 3020)
@@ -8,6 +8,7 @@
<property name="release" type="sstr" access="RO"/>
<property name="version" type="sstr" access="RO"/>
<property name="machine" type="sstr" access="RO"/>
+ <property name="distro" type="sstr" access="RO" optional="y"/>
<property name="memTotal" type="uint32" access="RO" unit="kByte"/>
<property name="swapTotal" type="uint32" access="RO" unit="kByte"/>
16 years
rhmessaging commits: r3019 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-12-17 14:00:26 -0500 (Wed, 17 Dec 2008)
New Revision: 3019
Modified:
mgmt/trunk/cumin/python/cumin/system.py
Log:
Don't crash when there's no stat data
Modified: mgmt/trunk/cumin/python/cumin/system.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/system.py 2008-12-17 18:34:21 UTC (rev 3018)
+++ mgmt/trunk/cumin/python/cumin/system.py 2008-12-17 19:00:26 UTC (rev 3019)
@@ -60,15 +60,25 @@
return "Free Memory"
def render_content(self, session, data):
- return "%i KB" % data["mem_free"]
+ mem_free = data["mem_free"]
+ if mem_free:
+ return "%i KB" % mem_free
+ else:
+ return fmt_none_brief()
+
class LoadColumn(SqlTableColumn):
def render_title(self, session, data):
return "Load Average"
def render_content(self, session, data):
- return "%0.3f" % data["load"]
+ load = data["load"]
+ if load:
+ return "%0.3f" % load
+ else:
+ return fmt_none_brief()
+
class TopSystemSet(TopTable):
def __init__(self, app, name):
super(TopSystemSet, self).__init__(app, name)
16 years
rhmessaging commits: r3018 - mgmt/trunk/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-12-17 13:34:21 -0500 (Wed, 17 Dec 2008)
New Revision: 3018
Modified:
mgmt/trunk/mint/python/mint/tools.py
mgmt/trunk/mint/python/mint/update.py
Log:
Extend the mint-bench output with finer-grained counters
Modified: mgmt/trunk/mint/python/mint/tools.py
===================================================================
--- mgmt/trunk/mint/python/mint/tools.py 2008-12-17 18:21:34 UTC (rev 3017)
+++ mgmt/trunk/mint/python/mint/tools.py 2008-12-17 18:34:21 UTC (rev 3018)
@@ -157,30 +157,73 @@
enq_last = 0
deq_last = 0
+ drp_last = 0
+ dfr_last = 0
+ prop_last = 0
+ stat_last = 0
+ meth_last = 0
+ exp_last = 0
- head = "%10s %10s %10s %10s %10s" % \
- ("enqs", "deqs", "depth", "discard", "defer")
- row = "%10i %10i %10i %10i %10i"
+ head = "%6s %6s %6s %6s %6s %6s %6s %6s %6s" % \
+ ("enqs", "deqs", "depth", "drop", "defer",
+ "prop", "stat", "meth", "exp")
+ row = "%6i %6i %6i %6i %6i %6i %6i %6i %6i"
- print head
+ samples = 0
while True:
+ if samples % 24 == 0:
+ print head
+
+ samples += 1
+
sleep(1)
ut = model.updateThread
enq = ut.enqueueCount
deq = ut.dequeueCount
+ drp = ut.dropCount
+ dfr = ut.deferCount
+ prop = ut.propUpdateCount
+ stat = ut.statUpdateCount
+ meth = ut.methUpdateCount
+ exp = ut.expireUpdateCount
+
print row % (enq - enq_last,
deq - deq_last,
enq - deq,
- ut.discardCount,
- ut.deferCount)
+ drp - drp_last,
+ dfr - dfr_last,
+ prop - prop_last,
+ stat - stat_last,
+ meth - meth_last,
+ exp - exp_last)
enq_last = enq
deq_last = deq
+ drp_last = drp
+ dfr_last = dfr
+
+ prop_last = prop
+ stat_last = stat
+ meth_last = meth
+ exp_last = exp
finally:
+
+ print "Totals:"
+
+ print row % (enq,
+ deq,
+ enq - deq,
+ drp,
+ dfr,
+ prop,
+ stat,
+ meth,
+ exp)
+
#from threading import enumerate
#for item in enumerate():
# print item
Modified: mgmt/trunk/mint/python/mint/update.py
===================================================================
--- mgmt/trunk/mint/python/mint/update.py 2008-12-17 18:21:34 UTC (rev 3017)
+++ mgmt/trunk/mint/python/mint/update.py 2008-12-17 18:34:21 UTC (rev 3018)
@@ -25,7 +25,11 @@
self.enqueueCount = 0
self.dequeueCount = 0
- self.discardCount = 0
+ self.statUpdateCount = 0
+ self.propUpdateCount = 0
+ self.methUpdateCount = 0
+ self.expireUpdateCount = 0
+ self.dropCount = 0
self.deferCount = 0
self.commitThreshold = 100
@@ -148,6 +152,7 @@
# handled by sqlobject
results[name] = str(value)
elif key.type == 15:
+ #if value:
results[name] = pickle.dumps(value)
elif not hasattr(cls, name):
# Discard attrs that we don't have in our schema
@@ -186,7 +191,7 @@
except ReferenceException, e:
log.info("Referenced class %r not found", e.sought)
- thread.discardCount += 1
+ thread.dropCount += 1
return
oid = self.object.getObjectId()
@@ -287,6 +292,8 @@
except KeyError:
pass
+ thread.propUpdateCount += 1
+
def processBroker(self, cursor, id):
if self.broker.databaseId is None:
op = SqlGetBrokerRegistration()
@@ -320,7 +327,7 @@
id = self.broker.objectDatabaseIds.get(oid)
if id is None:
- thread.discardCount += 1
+ thread.dropCount += 1
return
timestamps = self.object.getTimestamps()
@@ -331,13 +338,13 @@
if t < tnow - timedelta(seconds=30):
log.debug("Update is %i seconds old; skipping it", (tnow -t).seconds)
- thread.discardCount += 1
+ thread.dropCount += 1
return
try:
attrs = self.processAttributes(self.object.getStatistics(), statsCls)
except ReferenceException:
- thread.discardCount += 1
+ thread.dropCount += 1
return
attrs["qmfUpdateTime"] = t > tnow and tnow or t
@@ -350,6 +357,8 @@
log.debug("%s(%s) created", statsCls.__name__, id)
+ thread.statUpdateCount += 1
+
class MethodUpdate(ModelUpdate):
def __init__(self, model, broker, seq, response):
super(MethodUpdate, self).__init__(model, broker, response)
@@ -365,6 +374,8 @@
finally:
self.model.unlock()
+ thread.methUpdateCount += 1
+
class DBExpireUpdate(ModelUpdate):
def __init__(self, model):
super(DBExpireUpdate, self).__init__(model, None, None)
@@ -389,6 +400,8 @@
log.debug("%i total records expired", total)
+ thread.expireUpdateCount += 1
+
class UpdateQueue(ConcurrentQueue):
def __init__(self, maxsize=0, slotCount=1):
self.slotCount = slotCount
16 years
rhmessaging commits: r3017 - store/trunk/cpp/lib/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2008-12-17 13:21:34 -0500 (Wed, 17 Dec 2008)
New Revision: 3017
Modified:
store/trunk/cpp/lib/jrnl/fcntl.cpp
store/trunk/cpp/lib/jrnl/fcntl.hpp
store/trunk/cpp/lib/jrnl/jcntl.cpp
store/trunk/cpp/lib/jrnl/jcntl.hpp
store/trunk/cpp/lib/jrnl/rmgr.cpp
store/trunk/cpp/lib/jrnl/wmgr.cpp
Log:
Fix for intermittent JERR_FCNTL_RDOFFSOVFL and JERR_RMGR_UNKNOWNMAGIC errors, especially during _st_read.increasing_interval_delayed_read test, but also during recovery (BZ466533).
Modified: store/trunk/cpp/lib/jrnl/fcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/fcntl.cpp 2008-12-17 18:03:47 UTC (rev 3016)
+++ store/trunk/cpp/lib/jrnl/fcntl.cpp 2008-12-17 18:21:34 UTC (rev 3017)
@@ -57,7 +57,8 @@
_rd_cmpl_cnt_dblks(0),
_wr_subm_cnt_dblks(0),
_wr_cmpl_cnt_dblks(0),
- _aio_cnt(0)
+ _aio_cnt(0),
+ _fhdr_wr_aio_outstanding(false)
{
initialize(fbasename, fid, lid, jfsize_sblks, ro);
open_wr_fh();
Modified: store/trunk/cpp/lib/jrnl/fcntl.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/fcntl.hpp 2008-12-17 18:03:47 UTC (rev 3016)
+++ store/trunk/cpp/lib/jrnl/fcntl.hpp 2008-12-17 18:21:34 UTC (rev 3017)
@@ -68,6 +68,7 @@
u_int32_t _wr_subm_cnt_dblks; ///< Write file count (data blocks) for submitted AIO
u_int32_t _wr_cmpl_cnt_dblks; ///< Write file count (data blocks) for completed AIO
u_int16_t _aio_cnt; ///< Outstanding AIO operations on this file
+ bool _fhdr_wr_aio_outstanding; ///< Outstanding file header write on this file
public:
// Constructors with implicit initialize() and open()
@@ -114,6 +115,9 @@
inline u_int16_t incr_aio_cnt() { return ++_aio_cnt; }
u_int16_t decr_aio_cnt();
+ inline bool wr_fhdr_aio_outstanding() { return _fhdr_wr_aio_outstanding; }
+ inline void set_wr_fhdr_aio_outstanding(const bool wfao) { _fhdr_wr_aio_outstanding = wfao; }
+
// Derived helper functions
inline bool rd_void() const { return _wr_cmpl_cnt_dblks == 0; }
Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp 2008-12-17 18:03:47 UTC (rev 3016)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp 2008-12-17 18:21:34 UTC (rev 3017)
@@ -430,6 +430,24 @@
_rmgr.invalidate();
}
+#define AIO_CMPL_SLEEP 200 // 0.2 ms
+#define MAX_AIO_CMPL_SLEEPS 50000 // Total: 10 sec
+
+void
+jcntl::fhdr_wr_sync(const u_int16_t lid)
+{
+ long cnt = 0;
+ fcntl* fcntlp = _lfmgr.get_fcntlp(lid);
+ get_wr_events();
+ while (fcntlp->wr_fhdr_aio_outstanding())
+ {
+ if (++cnt > AIO_CMPL_SLEEP)
+ throw jexception(jerrno::JERR_JCNTL_AIOCMPLWAIT, "jcntl", "fhdr_wr_sync");
+ ::usleep(MAX_AIO_CMPL_SLEEPS);
+ get_wr_events();
+ }
+}
+
fcntl*
jcntl::new_fcntl(jcntl* const jcp, const u_int16_t lid, const u_int16_t fid, const rcvdat* const rdp)
{
@@ -476,9 +494,6 @@
ji.write();
}
-#define AIO_CMPL_SLEEP 200 // 0.2 ms
-#define MAX_AIO_CMPL_SLEEPS 50000 // Total: 10 sec
-
void
jcntl::aio_cmpl_wait()
{
Modified: store/trunk/cpp/lib/jrnl/jcntl.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.hpp 2008-12-17 18:03:47 UTC (rev 3016)
+++ store/trunk/cpp/lib/jrnl/jcntl.hpp 2008-12-17 18:21:34 UTC (rev 3017)
@@ -645,6 +645,7 @@
// FIXME these are _rmgr to _wmgr interactions, remove when _rmgr contains ref to _wmgr:
void chk_wr_frot();
inline u_int32_t unflushed_dblks() { return _wmgr.unflushed_dblks(); }
+ void fhdr_wr_sync(const u_int16_t lid);
// Management instrumentation callbacks
inline virtual void instr_incr_outstanding_aio_cnt() {}
Modified: store/trunk/cpp/lib/jrnl/rmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/rmgr.cpp 2008-12-17 18:03:47 UTC (rev 3016)
+++ store/trunk/cpp/lib/jrnl/rmgr.cpp 2008-12-17 18:21:34 UTC (rev 3017)
@@ -144,8 +144,7 @@
aio_cycle();
return RHM_IORES_PAGE_AIOWAIT;
}
- void* rptr = (void*)((char*)_page_ptr_arr[_pg_index] +
- (_pg_offset_dblks * JRNL_DBLK_SIZE));
+ void* rptr = (void*)((char*)_page_ptr_arr[_pg_index] + (_pg_offset_dblks * JRNL_DBLK_SIZE));
std::memcpy(&_hdr, rptr, sizeof(rec_hdr));
switch (_hdr._magic)
{
@@ -667,6 +666,7 @@
void
rmgr::init_file_header_read()
{
+ _jc->fhdr_wr_sync(_rrfc.fid()); // wait if the file header write is outstanding
int rfh = _rrfc.fh();
aio::prep_pread_2(_fhdr_aio_cb_ptr, rfh, _fhdr_buffer, _sblksize, 0);
if (aio::submit(_ioctx, 1, &_fhdr_aio_cb_ptr) < 0)
Modified: store/trunk/cpp/lib/jrnl/wmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/wmgr.cpp 2008-12-17 18:03:47 UTC (rev 3016)
+++ store/trunk/cpp/lib/jrnl/wmgr.cpp 2008-12-17 18:21:34 UTC (rev 3017)
@@ -876,6 +876,7 @@
fcntl* fcntlp = _jc->get_fcntlp(fid);
fcntlp->add_wr_cmpl_cnt_dblks(JRNL_SBLK_SIZE);
fcntlp->decr_aio_cnt();
+ fcntlp->set_wr_fhdr_aio_outstanding(false);
}
}
@@ -1062,6 +1063,7 @@
_aio_evt_rem++;
_wrfc.add_subm_cnt_dblks(JRNL_SBLK_SIZE);
_wrfc.incr_aio_cnt();
+ _wrfc.file_controller()->set_wr_fhdr_aio_outstanding(true);
}
void
16 years
rhmessaging commits: r3016 - in mgmt/trunk/mint: python/mint and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-12-17 13:03:47 -0500 (Wed, 17 Dec 2008)
New Revision: 3016
Modified:
mgmt/trunk/mint/bin/mint-bench
mgmt/trunk/mint/python/mint/__init__.py
mgmt/trunk/mint/python/mint/tools.py
mgmt/trunk/mint/python/mint/update.py
Log:
Consolidate commit and rollback behaviors under methods.
Pass the update thread into update objects.
Isolate the update invocation from the run loop, so that switching to
a single-threaded mode for profiling is possible.
Shorten the mint-bench profile calibration step.
Add more counters to the update thread, for tracking deferred and
discarded updates.
Modified: mgmt/trunk/mint/bin/mint-bench
===================================================================
--- mgmt/trunk/mint/bin/mint-bench 2008-12-17 18:00:07 UTC (rev 3015)
+++ mgmt/trunk/mint/bin/mint-bench 2008-12-17 18:03:47 UTC (rev 3016)
@@ -20,8 +20,8 @@
biases = list()
- for i in range(5):
- bias = prof.calibrate(100000)
+ for i in range(4):
+ bias = prof.calibrate(20000)
biases.append(bias)
print i, bias
Modified: mgmt/trunk/mint/python/mint/__init__.py
===================================================================
--- mgmt/trunk/mint/python/mint/__init__.py 2008-12-17 18:00:07 UTC (rev 3015)
+++ mgmt/trunk/mint/python/mint/__init__.py 2008-12-17 18:03:47 UTC (rev 3016)
@@ -384,6 +384,8 @@
self.qmfSession = qmf.console.Session \
(self, manageConnections=True, rcvObjects=self.updateObjects)
+ self.updateThread.init()
+
def start(self):
self.updateThread.start()
Modified: mgmt/trunk/mint/python/mint/tools.py
===================================================================
--- mgmt/trunk/mint/python/mint/tools.py 2008-12-17 18:00:07 UTC (rev 3015)
+++ mgmt/trunk/mint/python/mint/tools.py 2008-12-17 18:03:47 UTC (rev 3016)
@@ -67,9 +67,10 @@
if "debug" in opts:
level = "debug"
+ file = sys.stderr
+ else:
+ file = opts.get("log-file", sys.stderr)
- file = opts.get("log-file", sys.stderr)
-
enable_logging("mint", level, file)
data = opts.get("data", "postgresql://cumin@localhost/cumin")
@@ -157,22 +158,33 @@
enq_last = 0
deq_last = 0
- print "enqs", "\t", "deqs", "\t", "depth"
+ head = "%10s %10s %10s %10s %10s" % \
+ ("enqs", "deqs", "depth", "discard", "defer")
+ row = "%10i %10i %10i %10i %10i"
+ print head
+
while True:
sleep(1)
- enq = model.updateThread.enqueueCount
- deq = model.updateThread.dequeueCount
+ ut = model.updateThread
- enq_rate = enq - enq_last
- deq_rate = deq - deq_last
+ enq = ut.enqueueCount
+ deq = ut.dequeueCount
- print enq_rate, "\t", deq_rate, "\t", enq - deq
+ print row % (enq - enq_last,
+ deq - deq_last,
+ enq - deq,
+ ut.discardCount,
+ ut.deferCount)
enq_last = enq
deq_last = deq
finally:
+ #from threading import enumerate
+ #for item in enumerate():
+ # print item
+
for broker in added:
model.delBroker(broker)
Modified: mgmt/trunk/mint/python/mint/update.py
===================================================================
--- mgmt/trunk/mint/python/mint/update.py 2008-12-17 18:00:07 UTC (rev 3015)
+++ mgmt/trunk/mint/python/mint/update.py 2008-12-17 18:03:47 UTC (rev 3016)
@@ -25,8 +25,15 @@
self.enqueueCount = 0
self.dequeueCount = 0
+ self.discardCount = 0
+ self.deferCount = 0
self.commitThreshold = 100
+ self.conn = None
+
+ def init(self):
+ self.conn = self.model.dbConn.getConnection()
+
def enqueue(self, update):
try:
self.updates.put(update)
@@ -36,12 +43,12 @@
log.exception("Queue is full")
if self.updates.qsize() > 1000:
- # This is an attempt to yield
+ # This is an attempt to yield from the enqueueing thread (this
+ # method's caller) to the update thread
+
sleep(0.1)
def run(self):
- conn = self.model.dbConn.getConnection()
-
while True:
try:
update = self.updates.get(True, 1)
@@ -59,35 +66,37 @@
log.debug("Queue is empty")
continue
- try:
- update.process(conn)
+ self.process_update(update)
+
+ def process_update(self, update):
+ try:
+ update.process(self)
- if self.dequeueCount % self.commitThreshold == 0 \
- or self.updates.qsize() == 0:
- # commit only every "commitThreshold" updates, or whenever
- # the update queue is empty
+ if self.dequeueCount % self.commitThreshold == 0 \
+ or self.updates.qsize() == 0:
+ # commit only every "commitThreshold" updates, or whenever
+ # the update queue is empty
- if profile:
- start = clock()
+ self.commit()
+ except:
+ log.exception("Update failed")
- conn.commit()
+ self.rollback()
- for broker in self.model.mintBrokersByQmfBroker.values():
- broker.objectDatabaseIds.commit()
+ def cursor(self):
+ return self.conn.cursor()
- profile.commitTime += clock() - start
- else:
- conn.commit()
+ def commit(self):
+ self.conn.commit()
- for broker in self.model.mintBrokersByQmfBroker.values():
- broker.objectDatabaseIds.commit()
- except:
- conn.rollback()
+ for broker in self.model.mintBrokersByQmfBroker.values():
+ broker.objectDatabaseIds.commit()
- for broker in self.model.mintBrokersByQmfBroker.values():
- broker.objectDatabaseIds.rollback()
+ def rollback(self):
+ self.conn.rollback()
- log.exception("Update failed")
+ for broker in self.model.mintBrokersByQmfBroker.values():
+ broker.objectDatabaseIds.rollback()
class ReferenceException(Exception):
def __init__(self, sought):
@@ -120,7 +129,7 @@
except KeyError:
raise ReferenceException(name)
- def process(self, conn):
+ def process(self, thread):
pass
def processAttributes(self, attrs, cls):
@@ -171,11 +180,13 @@
results[name] = t
class PropertyUpdate(ModelUpdate):
- def process(self, conn):
+ def process(self, thread):
try:
cls = self.getClass()
except ReferenceException, e:
log.info("Referenced class %r not found", e.sought)
+
+ thread.discardCount += 1
return
oid = self.object.getObjectId()
@@ -191,6 +202,7 @@
except KeyError:
self.broker.orphans[oid] = list((self,))
+ thread.deferCount += 1
return
timestamps = self.object.getTimestamps()
@@ -208,7 +220,7 @@
attrs["qmfClassKey"] = str(self.object.getClassKey())
attrs["qmfBrokerId"] = str(self.broker.qmfBroker.getBrokerId())
- cursor = conn.cursor()
+ cursor = thread.cursor()
# Cases:
#
@@ -271,7 +283,7 @@
len(orphans))
for orphan in orphans:
- self.model.updateThread.enqueue(orphan)
+ thread.enqueue(orphan)
except KeyError:
pass
@@ -295,7 +307,7 @@
self.broker.databaseId = id
class StatisticUpdate(ModelUpdate):
- def process(self, conn):
+ def process(self, thread):
try:
cls = self.getClass()
except ReferenceException, e:
@@ -308,7 +320,7 @@
id = self.broker.objectDatabaseIds.get(oid)
if id is None:
- # Just drop it; we'll get more stats later
+ thread.discardCount += 1
return
timestamps = self.object.getTimestamps()
@@ -318,18 +330,20 @@
if t < tnow - timedelta(seconds=30):
log.debug("Update is %i seconds old; skipping it", (tnow -t).seconds)
+
+ thread.discardCount += 1
return
try:
attrs = self.processAttributes(self.object.getStatistics(), statsCls)
except ReferenceException:
- # Drop it
+ thread.discardCount += 1
return
attrs["qmfUpdateTime"] = t > tnow and tnow or t
attrs["%s_id" % cls.sqlmeta.table] = id
- cursor = conn.cursor()
+ cursor = thread.cursor()
op = SqlInsert(statsCls, attrs)
op.execute(cursor, attrs)
@@ -342,7 +356,7 @@
self.seq = seq
- def process(self, conn):
+ def process(self, thread):
self.model.lock()
try:
@@ -355,19 +369,19 @@
def __init__(self, model):
super(DBExpireUpdate, self).__init__(model, None, None)
- def process(self, conn):
- cursor = conn.cursor()
+ def process(self, thread):
+ cursor = thread.cursor()
attrs = self.model.dbExpireThread.attrs
total = 0
- conn.commit()
+ thread.commit()
for op in self.model.dbExpireThread.ops:
log.debug("Running expire op %s", op)
count = op.execute(cursor, attrs)
- conn.commit()
+ thread.commit()
log.debug("%i records expired", count)
16 years
rhmessaging commits: r3015 - in mgmt/trunk/sesame/cpp: src and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: tedross
Date: 2008-12-17 13:00:07 -0500 (Wed, 17 Dec 2008)
New Revision: 3015
Modified:
mgmt/trunk/sesame/cpp/etc/sesame.conf
mgmt/trunk/sesame/cpp/etc/sysvinit-sesame
mgmt/trunk/sesame/cpp/src/SysAgent.cpp
Log:
Added support for logging to syslog with configurable log filter.
Modified: mgmt/trunk/sesame/cpp/etc/sesame.conf
===================================================================
--- mgmt/trunk/sesame/cpp/etc/sesame.conf 2008-12-17 13:26:51 UTC (rev 3014)
+++ mgmt/trunk/sesame/cpp/etc/sesame.conf 2008-12-17 18:00:07 UTC (rev 3015)
@@ -43,3 +43,17 @@
##
#state-dir=/var/lib/sesame
+##=========
+## Logging
+##=========
+
+# log-enable=RULE
+#
+# Enable logging for selected levels and components. RULE is in the form
+# 'LEVEL[+][:PATTERN]' Levels are one of:
+# trace debug info notice warning error critical
+#
+# For example:
+# '--log-enable warning+' logs all warning, error and critical messages.
+
+#log-enable notice+
Modified: mgmt/trunk/sesame/cpp/etc/sysvinit-sesame
===================================================================
--- mgmt/trunk/sesame/cpp/etc/sysvinit-sesame 2008-12-17 13:26:51 UTC (rev 3014)
+++ mgmt/trunk/sesame/cpp/etc/sysvinit-sesame 2008-12-17 18:00:07 UTC (rev 3015)
@@ -17,11 +17,13 @@
processname=sesame
servicename=sesame
+[ -f /etc/sysconfig/$servicename ] && . /etc/sysconfig/$servicename
+
RETVAL=0
start() {
echo -n $"Starting Sesame daemon: "
- daemon --user sesame --check $servicename $processname \&
+ daemon --user sesame --check $servicename $processname $SESAME_OPTIONS\&
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$servicename
Modified: mgmt/trunk/sesame/cpp/src/SysAgent.cpp
===================================================================
--- mgmt/trunk/sesame/cpp/src/SysAgent.cpp 2008-12-17 13:26:51 UTC (rev 3014)
+++ mgmt/trunk/sesame/cpp/src/SysAgent.cpp 2008-12-17 18:00:07 UTC (rev 3015)
@@ -3,6 +3,8 @@
#include <qpid/management/ManagementObject.h>
#include <qpid/agent/ManagementAgent.h>
#include <qpid/sys/Mutex.h>
+#include "qpid/log/Logger.h"
+#include "qpid/log/posix/SinkOptions.h"
#include "qpid/sys/SystemInfo.h"
#include "qpid/framing/Uuid.h"
#include "qmf/com/redhat/sesame/Package.h"
@@ -304,23 +306,35 @@
int main_int(int argc, char** argv)
{
+ qpid::log::Logger& logger = qpid::log::Logger::instance();
+ qpid::log::Options logOptions(argv[0], "sesame");
+ qpid::log::posix::SinkOptions* sinkOptions =
+ static_cast<qpid::log::posix::SinkOptions*>(logOptions.sinkOptions.get());
+
singleton = new ManagementAgent::Singleton();
signal(SIGINT, shutdown);
- options["no-config"] = Option("", "", "Don't read configuration file");
- options["config"] = Option("FILE", CONF_FILE, "Configuration file");
- options["host"] = Option("ADDR", "localhost", "Broker host name or IP address");
- options["port"] = Option("N", "5672", "Port for broker service");
- options["proto"] = Option("NAME", "tcp", "Protocol for broker communication");
- options["mech"] = Option("NAME", "PLAIN", "Authentication mechanism");
- options["uid"] = Option("NAME", "guest", "Authentication user name");
- options["pwd"] = Option("PASSWORD", "guest", "Authentication password");
- options["pwd-file"] = Option("FILE", "", "File containing password");
- options["state-dir"] = Option("DIR", LOCSTATE_DIR, "Directory for stored state");
+ options["no-config"] = Option("", "", "Don't read configuration file");
+ options["config"] = Option("FILE", CONF_FILE, "Configuration file");
+ options["host"] = Option("ADDR", "localhost", "Broker host name or IP address");
+ options["port"] = Option("N", "5672", "Port for broker service");
+ options["proto"] = Option("NAME", "tcp", "Protocol for broker communication");
+ options["mech"] = Option("NAME", "PLAIN", "Authentication mechanism");
+ options["uid"] = Option("NAME", "guest", "Authentication user name");
+ options["pwd"] = Option("PASSWORD", "guest", "Authentication password");
+ options["pwd-file"] = Option("FILE", "", "File containing password");
+ options["state-dir"] = Option("DIR", LOCSTATE_DIR, "Directory for stored state");
+ options["log-enable"] = Option("", "notice+", "Log severity threshold");
configure(argc, argv);
getPassword();
+ logOptions.selectors.clear();
+ logOptions.selectors.push_back(options["log-enable"].value);
+ logOptions.time = false;
+ sinkOptions->logToSyslog = true;
+ logger.configure(logOptions);
+
// Create the qmf management agent
ManagementAgent* agent = singleton->getInstance();
16 years
rhmessaging commits: r3014 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-12-17 08:26:51 -0500 (Wed, 17 Dec 2008)
New Revision: 3014
Modified:
mgmt/trunk/cumin/python/cumin/system.py
Log:
Fixed bad call to super for rendering the system slot vis.
Modified: mgmt/trunk/cumin/python/cumin/system.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/system.py 2008-12-16 20:51:31 UTC (rev 3013)
+++ mgmt/trunk/cumin/python/cumin/system.py 2008-12-17 13:26:51 UTC (rev 3014)
@@ -144,7 +144,7 @@
def render(self, session):
cells = self.get_cells(session)
if len(cells) > 0:
- return super(SystemStats.SlotUtilizationGrid).render(self, session)
+ return super(SystemStats.SlotUtilizationGrid, self).render(session)
def get_cells(self, session):
system = self.frame.get_args(session)[0]
16 years
rhmessaging commits: r3013 - mgmt/trunk/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-12-16 15:51:31 -0500 (Tue, 16 Dec 2008)
New Revision: 3013
Modified:
mgmt/trunk/mint/python/mint/cache.py
Log:
Restore use of the pending id set; it is indeed in use
Modified: mgmt/trunk/mint/python/mint/cache.py
===================================================================
--- mgmt/trunk/mint/python/mint/cache.py 2008-12-16 20:33:42 UTC (rev 3012)
+++ mgmt/trunk/mint/python/mint/cache.py 2008-12-16 20:51:31 UTC (rev 3013)
@@ -7,7 +7,10 @@
self.__dirty = False
def get(self, key):
- return self.__cache.get(key)
+ try:
+ return self.__cache[key]
+ except KeyError:
+ return self.__pending.get(key)
def set(self, key, value):
self.__pending[key] = value
16 years
rhmessaging commits: r3012 - mgmt/trunk/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-12-16 15:33:42 -0500 (Tue, 16 Dec 2008)
New Revision: 3012
Modified:
mgmt/trunk/mint/python/mint/cache.py
Log:
A speedup; drop a capability we're not currently using, and don't look in the hashtable twice on each get
Modified: mgmt/trunk/mint/python/mint/cache.py
===================================================================
--- mgmt/trunk/mint/python/mint/cache.py 2008-12-16 20:17:44 UTC (rev 3011)
+++ mgmt/trunk/mint/python/mint/cache.py 2008-12-16 20:33:42 UTC (rev 3012)
@@ -6,15 +6,9 @@
self.__pending = dict()
self.__dirty = False
- def get(self, key, usePending=True):
- result = None
+ def get(self, key):
+ return self.__cache.get(key)
- if key in self.__cache:
- result = self.__cache[key]
- elif usePending and key in self.__pending:
- result = self.__pending[key]
- return result
-
def set(self, key, value):
self.__pending[key] = value
self.__dirty = True
16 years
rhmessaging commits: r3011 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-12-16 15:17:44 -0500 (Tue, 16 Dec 2008)
New Revision: 3011
Modified:
mgmt/trunk/cumin/python/cumin/system.py
Log:
Don't display the sysimage slot vis Title if there are no slots.
Modified: mgmt/trunk/cumin/python/cumin/system.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/system.py 2008-12-16 20:07:36 UTC (rev 3010)
+++ mgmt/trunk/cumin/python/cumin/system.py 2008-12-16 20:17:44 UTC (rev 3011)
@@ -141,6 +141,11 @@
return self.page.main.pool.job.get_href(session, job)
class SlotUtilizationGrid(StatUtilizationGrid):
+ def render(self, session):
+ cells = self.get_cells(session)
+ if len(cells) > 0:
+ return super(SystemStats.SlotUtilizationGrid).render(self, session)
+
def get_cells(self, session):
system = self.frame.get_args(session)[0]
action = self.app.model.system.slots
16 years