rhmessaging commits: r3038 - store/trunk/cpp/lib/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-01-12 11:58:29 -0500 (Mon, 12 Jan 2009)
New Revision: 3038
Modified:
store/trunk/cpp/lib/jrnl/jcntl.cpp
Log:
Fix for BZ479714 - "qpidd+store message loss (detected by txtest --check yes after qpidd recovery)".
Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp 2009-01-08 21:28:26 UTC (rev 3037)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp 2009-01-12 16:58:29 UTC (rev 3038)
@@ -680,28 +680,30 @@
case RHM_JDAT_ENQ_MAGIC:
{
enq_rec er;
+ u_int16_t start_fid = fid; // fid may increment in decode() if record folds over file boundary
if (!decode(er, fid, ifsp, cum_size_read, h, lowi, rd, file_pos))
return false;
if (!er.is_transient()) // Ignore transient msgs
{
- rd._enq_cnt_list[fid]++;
+ rd._enq_cnt_list[start_fid]++;
if (er.xid_size())
{
er.get_xid(&xidp);
assert(xidp != 0);
std::string xid((char*)xidp, er.xid_size());
- _tmap.insert_txn_data(xid, txn_data(h._rid, 0, fid, true));
+ _tmap.insert_txn_data(xid, txn_data(h._rid, 0, start_fid, true));
_tmap.set_aio_compl(xid, h._rid);
std::free(xidp);
}
else
- _emap.insert_fid(h._rid, fid);
+ _emap.insert_fid(h._rid, start_fid);
}
}
break;
case RHM_JDAT_DEQ_MAGIC:
{
deq_rec dr;
+ u_int16_t start_fid = fid; // fid may increment in decode() if record folds over file boundary
if (!decode(dr, fid, ifsp, cum_size_read, h, lowi, rd, file_pos))
return false;
if (dr.xid_size())
@@ -715,7 +717,7 @@
dr.get_xid(&xidp);
assert(xidp != 0);
std::string xid((char*)xidp, dr.xid_size());
- _tmap.insert_txn_data(xid, txn_data(dr.rid(), dr.deq_rid(), fid, false,
+ _tmap.insert_txn_data(xid, txn_data(dr.rid(), dr.deq_rid(), start_fid, false,
dr.is_txn_coml_commit()));
_tmap.set_aio_compl(xid, dr.rid());
std::free(xidp);
15 years, 11 months
rhmessaging commits: r3037 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-01-08 16:28:26 -0500 (Thu, 08 Jan 2009)
New Revision: 3037
Modified:
mgmt/trunk/cumin/python/cumin/broker.strings
mgmt/trunk/cumin/python/cumin/model.py
mgmt/trunk/cumin/python/cumin/pool.strings
Log:
Added ajax update of Broker Status
Modified: mgmt/trunk/cumin/python/cumin/broker.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/broker.strings 2009-01-08 15:54:37 UTC (rev 3036)
+++ mgmt/trunk/cumin/python/cumin/broker.strings 2009-01-08 21:28:26 UTC (rev 3037)
@@ -45,10 +45,21 @@
[BrokerView.javascript]
function updateBroker(data) {
var model = data.objectify();
+ var brokers = model.broker;
+ var broker;
+ for (var key in brokers) {
+ broker = brokers[key];
+ break;
+ }
+
cumin.runModelListeners(model);
+ cumin.runObjectListeners(broker);
+
+ //throw new Error();
}
+
[BrokerView.html]
<script type="text/javascript">
<![CDATA[
@@ -105,12 +116,25 @@
</tbody>
</table>
+[BrokerStatus.javascript]
+function updateBrokerStatus(id, broker) {
+ var s = broker.stat;
+ var sdata = {"div": [s.connection.value]};
+
+ wooly.doc().elembyid(id).update(sdata);
+}
+
[BrokerStatus.html]
<div id="{id}" class="CuminStatus {color}">
<h2>Broker Status</h2>
- {status}
+ <div>{status}</div>
</div>
+<script type="text/javascript">
+<![CDATA[
+ cumin.objectListeners["{id}"] = updateBrokerStatus;
+]]>
+</script>
[BrokerStats.html]
<table class="twocol">
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2009-01-08 15:54:37 UTC (rev 3036)
+++ mgmt/trunk/cumin/python/cumin/model.py 2009-01-08 21:28:26 UTC (rev 3037)
@@ -783,6 +783,9 @@
prop = CuminProperty(self, "dataDir")
prop.title = "Data Directory"
+ stat = self.StatusStat(self, "connection")
+ stat.category = "status"
+
action = self.AddExchange(self, "add_exchange")
action.summary = True
@@ -805,6 +808,24 @@
def get_object_name(self, broker):
return broker.id
+ class StatusStat(CuminStat):
+ def value_text(self, broker):
+ connected = False
+ if broker:
+ try:
+ mbroker = self.model.data.mintBrokersById[broker.qmfBrokerId]
+ connected = mbroker.connected
+ except KeyError:
+ pass
+
+ if connected:
+ return "Connected"
+ else:
+ return "Disconnected"
+
+ def rate_text(self, record):
+ return ""
+
class AddExchange(CuminAction):
MSG_SEQUENCE = "qpid.msg_sequence"
IVE = "qpid.ive"
Modified: mgmt/trunk/cumin/python/cumin/pool.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/pool.strings 2009-01-08 15:54:37 UTC (rev 3036)
+++ mgmt/trunk/cumin/python/cumin/pool.strings 2009-01-08 21:28:26 UTC (rev 3037)
@@ -57,7 +57,7 @@
function updatePoolStatus(id, pool) {
var s = pool.stat;
- var sdata = {"div": {"span": [s.active.value, s.all.value]}};
+ var sdata = {"div": {"span": [s.idl.value, s.all.value]}};
wooly.doc().elembyid(id).update(sdata);
if (pool_stats_last_all != "") {
15 years, 12 months
rhmessaging commits: r3036 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-01-08 10:54:37 -0500 (Thu, 08 Jan 2009)
New Revision: 3036
Modified:
mgmt/trunk/cumin/python/cumin/tools.py
Log:
Try longer to kill the mint-server process
Modified: mgmt/trunk/cumin/python/cumin/tools.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/tools.py 2009-01-08 14:53:33 UTC (rev 3035)
+++ mgmt/trunk/cumin/python/cumin/tools.py 2009-01-08 15:54:37 UTC (rev 3036)
@@ -470,7 +470,7 @@
def stop(self):
os.kill(self.proc.pid, signal.SIGTERM)
- for i in range(10):
+ for i in range(30):
code = self.proc.poll()
if code is not None:
15 years, 12 months
rhmessaging commits: r3035 - store/trunk/cpp/lib.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-01-08 09:53:33 -0500 (Thu, 08 Jan 2009)
New Revision: 3035
Modified:
store/trunk/cpp/lib/MessageStoreImpl.cpp
store/trunk/cpp/lib/MessageStoreImpl.h
Log:
Improved hash function gives more even distribution of queues across 29 dirs
Modified: store/trunk/cpp/lib/MessageStoreImpl.cpp
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.cpp 2009-01-07 20:10:31 UTC (rev 3034)
+++ store/trunk/cpp/lib/MessageStoreImpl.cpp 2009-01-08 14:53:33 UTC (rev 3035)
@@ -1729,15 +1729,20 @@
return getJrnlDir(queue.getName().c_str());
}
+u_int32_t MessageStoreImpl::bHash(const std::string str)
+{
+ // Daniel Bernstein hash fn
+ u_int32_t h = 0;
+ for (std::string::const_iterator i = str.begin(); i < str.end(); i++)
+ h = 33*h + *i;
+ return h;
+}
+
std::string MessageStoreImpl::getJrnlDir(const char* queueName) //for exmaple /var/rhm/ + queueDir/
{
std::stringstream dir;
dir << getJrnlBaseDir() << std::hex << std::setfill('0') << std::setw(4);
- u_int32_t count = 0;
- for (u_int32_t i = 0; i < strlen(queueName); i++) {
- count += queueName[i];
- }
- dir << (count % 29); // Use a prime number for better distribution across dirs
+ dir << (bHash(queueName) % 29); // Use a prime number for better distribution across dirs
dir << "/" << queueName << "/";
return dir.str();
}
Modified: store/trunk/cpp/lib/MessageStoreImpl.h
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.h 2009-01-07 20:10:31 UTC (rev 3034)
+++ store/trunk/cpp/lib/MessageStoreImpl.h 2009-01-08 14:53:33 UTC (rev 3035)
@@ -241,6 +241,7 @@
// journal functions
void createJrnlQueue(const qpid::broker::PersistableQueue& queue);
+ u_int32_t bHash(const std::string str);
std::string getJrnlDir(const qpid::broker::PersistableQueue& queue); //for exmaple /var/rhm/ + queueDir/
std::string getJrnlDir(const char* queueName);
std::string getJrnlBaseDir();
15 years, 12 months
rhmessaging commits: r3034 - store/trunk/cpp/lib/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-01-07 15:10:31 -0500 (Wed, 07 Jan 2009)
New Revision: 3034
Modified:
store/trunk/cpp/lib/jrnl/fcntl.cpp
store/trunk/cpp/lib/jrnl/jcntl.cpp
store/trunk/cpp/lib/jrnl/pmgr.cpp
Log:
Closed a recover file handle that was being left open needlessly. Minor corrections to exception formatting.
Modified: store/trunk/cpp/lib/jrnl/fcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/fcntl.cpp 2009-01-07 14:22:24 UTC (rev 3033)
+++ store/trunk/cpp/lib/jrnl/fcntl.cpp 2009-01-07 20:10:31 UTC (rev 3034)
@@ -324,7 +324,7 @@
if (::posix_memalign(&nullbuf, sblksize, nullbuffsize))
{
std::ostringstream oss;
- oss << ": posix_memalign() failed: size=" << nullbuffsize << " blk_size=" << sblksize;
+ oss << "posix_memalign() failed: size=" << nullbuffsize << " blk_size=" << sblksize;
oss << FORMAT_SYSERR(errno);
throw jexception(jerrno::JERR__MALLOC, oss.str(), "fcntl", "clean_file");
}
@@ -336,7 +336,7 @@
{
std::free(nullbuf);
std::ostringstream oss;
- oss << ": open() failed:" << "\"" << FORMAT_SYSERR(errno);
+ oss << "open() failed:" << FORMAT_SYSERR(errno);
throw jexception(jerrno::JERR_FCNTL_OPENWR, oss.str(), "fcntl", "clean_file");
}
@@ -348,7 +348,7 @@
::close(fh);
std::free(nullbuf);
std::ostringstream oss;
- oss << ": wr_size=" << (this_write_sblks * sblksize) << FORMAT_SYSERR(errno);
+ oss << "wr_size=" << (this_write_sblks * sblksize) << FORMAT_SYSERR(errno);
throw jexception(jerrno::JERR_FCNTL_WRITE, oss.str(), "fcntl", "clean_file");
}
nsblks -= this_write_sblks;
Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp 2009-01-07 14:22:24 UTC (rev 3033)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp 2009-01-07 20:10:31 UTC (rev 3034)
@@ -611,6 +611,7 @@
std::ifstream ifs;
bool lowi = rd._owi; // local copy of owi to be used during analysis
while (rcvr_get_next_record(fid, &ifs, lowi, rd)) ;
+ if (ifs.is_open()) ifs.close();
// Remove all txns from tmap that are not in the prepared list
if (prep_txn_list_ptr)
Modified: store/trunk/cpp/lib/jrnl/pmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/pmgr.cpp 2009-01-07 14:22:24 UTC (rev 3033)
+++ store/trunk/cpp/lib/jrnl/pmgr.cpp 2009-01-07 20:10:31 UTC (rev 3034)
@@ -158,7 +158,7 @@
if (int ret = aio::queue_init(max_aio_evts, &_ioctx))
{
std::ostringstream oss;
- oss << "io_queue_init() failed: " << std::strerror(-ret) << " (" << ret << ")";
+ oss << "io_queue_init() failed: " << FORMAT_SYSERR(-ret);
throw jexception(jerrno::JERR__AIO, oss.str(), "pmgr", "initialize");
}
}
15 years, 12 months
rhmessaging commits: r3033 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-01-07 09:22:24 -0500 (Wed, 07 Jan 2009)
New Revision: 3033
Modified:
mgmt/trunk/cumin/python/cumin/model.py
mgmt/trunk/cumin/python/cumin/pool.py
mgmt/trunk/cumin/python/cumin/slot.strings
Log:
Changed pool status box to show "x of x slots idle" instead of "x of x slots active".
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2009-01-06 14:58:24 UTC (rev 3032)
+++ mgmt/trunk/cumin/python/cumin/model.py 2009-01-07 14:22:24 UTC (rev 3033)
@@ -1933,7 +1933,7 @@
stat = self.PercentStat(self, "total")
stat.title = "Total Jobs"
- stat = self.StatusStat(self, "active")
+ stat = self.StatusStat(self, "idl")
stat.category = "status"
stat = self.StatusStat(self, "all")
Modified: mgmt/trunk/cumin/python/cumin/pool.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/pool.py 2009-01-06 14:58:24 UTC (rev 3032)
+++ mgmt/trunk/cumin/python/cumin/pool.py 2009-01-07 14:22:24 UTC (rev 3033)
@@ -518,5 +518,5 @@
action = self.app.model.pool.poolstatus
record = action.get_stat_record(session, pool)
- return record and "<div><span>%i</span> of <span>%i</span> slots active</div>" % \
- (record["active"], record["all"]) or ""
+ return record and "<div><span>%i</span> of <span>%i</span> slots idle</div>" % \
+ (record["idl"], record["all"]) or ""
Modified: mgmt/trunk/cumin/python/cumin/slot.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/slot.strings 2009-01-06 14:58:24 UTC (rev 3032)
+++ mgmt/trunk/cumin/python/cumin/slot.strings 2009-01-07 14:22:24 UTC (rev 3033)
@@ -20,7 +20,7 @@
[SlotStatSet.sql]
select
- sum(case activity when 'Idle' then 0 else 1 end) as active,
+ sum(case activity when 'Idle' then 1 else 0 end) as idl,
sum(1) as all
from (select
s.name,
15 years, 12 months
rhmessaging commits: r3032 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-01-06 09:58:24 -0500 (Tue, 06 Jan 2009)
New Revision: 3032
Modified:
mgmt/trunk/cumin/python/cumin/model.py
mgmt/trunk/cumin/python/cumin/pool.py
mgmt/trunk/cumin/python/cumin/pool.strings
mgmt/trunk/cumin/python/cumin/slot.py
mgmt/trunk/cumin/python/cumin/stat.py
mgmt/trunk/cumin/python/cumin/stat.strings
mgmt/trunk/cumin/python/cumin/system.py
Log:
Consolidate sql for vis and the count of slots on the "Grid Slots (x)" tab so it gets called only once.
On Grid statistics page, only display the machine vis if slot vis won't fit. This is so the number of sql calls is kept to a minimum.
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2009-01-05 15:40:29 UTC (rev 3031)
+++ mgmt/trunk/cumin/python/cumin/model.py 2009-01-06 14:58:24 UTC (rev 3032)
@@ -584,8 +584,7 @@
def get_boxes(self, session, object, *args):
if args:
self.itemset.set_args(session, *args)
- cursor = self.itemset.get_items(session, object)
- box_list = self.itemset.cursor_to_rows(cursor)
+ box_list = self.itemset.get_items(session, object)
return box_list
def get_color(self, session, box):
@@ -703,6 +702,11 @@
super(CuminSystem.SystemSlotVisualization, self).__init__(cls, name)
self.itemset = self.ModelSystemSlotSet(cls.model.app, "slot")
+ self.itemset.items.path = "CuminSystem.SystemSlotVisualization.slot"
+
+ def get_slot_count(self, session, system):
+ items = self.itemset.get_items(session, system)
+ return len(items)
class ModelSystemSlotSet(SystemSlotSet):
def render_sql_limit(self, session, *args):
@@ -746,7 +750,7 @@
master = Master.select("System = '%s'" % system_name)[0]
except IndexError:
raise Exception("Master daemon not running")
- master.Stop(self.model.data, completion, args["subsystem"])
+ #master.Stop(self.model.data, completion, args["subsystem"])
class CuminBroker(RemoteClass):
def __init__(self, model):
@@ -2021,6 +2025,7 @@
super(CuminPool.PoolSlotVisualization, self).__init__(cls, name)
self.itemset = self.ModelPoolSlotSet(cls.model.app, "slot")
+ self.itemset.items.path = "CuminPool.PoolSlotVisualization.slot"
def set_machine(self, session, machine):
self.itemset.set_machine(session, machine)
@@ -2073,7 +2078,8 @@
super(CuminPool.FakeJobStats, self).__init__(cls, name)
self.itemset = PoolJobStats(cls.model.app, "stats")
-
+ self.itemset.items.path = "CuminPool.FakeJobStats.stats"
+
def get_stat_record(self, session, pool):
cursor = self.itemset.get_items(session, pool)
rows = self.itemset.cursor_to_rows(cursor)
@@ -2085,10 +2091,10 @@
super(CuminPool.PoolStatus, self).__init__(cls, name)
self.itemset = self.StatusPoolSlotSet(cls.model.app, "stats")
+ self.itemset.items.path = "CuminPool.PoolStatus.stats"
def get_stat_record(self, session, pool):
- cursor = self.itemset.get_items(session, pool)
- rows = self.itemset.cursor_to_rows(cursor)
+ rows = self.itemset.get_items(session, pool)
if len(rows):
return rows[0]
@@ -2117,6 +2123,7 @@
super(CuminPool.VisMachine, self).__init__(cls, name)
self.itemset = PoolMachineSet(cls.model.app, "machine")
+ self.itemset.items.path = "CuminPool.VisMachine.machine"
def get_field_tuples(self, session):
return [("machine", "Machine"), ("busy", "Busy Slots"), ("idle", "Idle Slots")]
Modified: mgmt/trunk/cumin/python/cumin/pool.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/pool.py 2009-01-05 15:40:29 UTC (rev 3031)
+++ mgmt/trunk/cumin/python/cumin/pool.py 2009-01-06 14:58:24 UTC (rev 3032)
@@ -310,24 +310,21 @@
stats = PoolStatSet(app, "general", "general")
self.add_child(stats)
+ self.machine_grid = self.MachineVisualization(app, "machine_grid")
+ self.add_child(self.machine_grid)
+
self.slot_grid = self.SlotVisualization(app, "slot_grid")
self.add_child(self.slot_grid)
- self.machine_grid = self.MachineVisualization(app, "machine_grid")
- self.add_child(self.machine_grid)
-
self.all_fits = Attribute(app, "can_show_all")
self.add_attribute(self.all_fits)
self.machine_param = Parameter(app, "machine_param")
self.add_parameter(self.machine_param)
- self.show_all_slots = self.ShowAllSlots(app, "show_all_slots")
- self.add_child(self.show_all_slots)
-
def process(self, session):
super(PoolStats, self).process(session)
- all_slots = self.show_all_slots.get(session)
+ all_slots = self.slot_grid.show_all_slots.get(session)
machine = self.machine_param.get(session)
all_fits = True
@@ -348,15 +345,17 @@
def render_title(self, session):
return "Statistics"
- def render_slot_title(self, session):
- pool = self.frame.get_args(session)[0]
- machine = self.slot_grid.get_machine(session)
- return machine and "Slots on (%s)" % machine or "Slots on %s" % pool.name
-
def render_machine_title(self, session):
- pool = self.frame.get_args(session)[0]
- return "Machines on %s" % pool.name
+ slots_fit = self.all_fits.get(session)
+ if not slots_fit:
+ pool = self.frame.get_args(session)[0]
+ return "Machines on %s" % pool.name
+ def render_machine_help(self, session):
+ slots_fit = self.all_fits.get(session)
+ if not slots_fit:
+ return "Select a Machine to view its slots"
+
def render_slot_job_url(self, session):
job = Identifiable("XXX")
return self.page.main.pool.job.get_href(session, job)
@@ -365,13 +364,23 @@
def __init__(self, app, name):
super(PoolStats.SlotVisualization, self).__init__(app, name)
+ self.show_all_slots = self.ShowAllSlots(app, "show_all_slots")
+ self.add_child(self.show_all_slots)
+
+ def render(self, session, *args):
+ slots_fit = self.parent.all_fits.get(session)
+ if slots_fit:
+ return super(PoolStats.SlotVisualization, self).render(session, *args)
+
def get_cells(self, session):
pool = self.frame.get_args(session)[0]
action = self.app.model.pool.slots
return action.get_boxes(session, pool)
def render_title(self, session):
- return ""
+ pool = self.frame.get_args(session)[0]
+ machine = self.get_machine(session)
+ return machine and "Slots on (%s)" % machine or "Slots on %s" % pool.name
def set_machine(self, session, machine):
action = self.app.model.pool.slots
@@ -399,12 +408,42 @@
pool = self.parent.frame.get_args(session)[0]
machine = self.get_machine(session)
return "call.xml?class=pool;id=%s;method=slots;xargs=%s" % (pool.id, machine)
-
+
def get_sticky_info(self, session):
action = self.app.model.pool.slots
return action.get_field_tuples(session)
+ class ShowAllSlots(StateSwitch):
+ def __init__(self, app, name):
+ super(PoolStats.SlotVisualization.ShowAllSlots, self).__init__(app, name)
+
+ self.add_state("a", "All")
+ self.add_state("m", "Machine")
+
+ def render(self, session):
+ state = self.get(session)
+ if state == "m":
+ return super(PoolStats.SlotVisualization.ShowAllSlots, self).render(session)
+
+ def render_href(self, session):
+ state = self.get(session)
+ if state == "m":
+ branch = session.branch()
+ self.set(branch, "a")
+ return branch.marshal()
+ else:
+ return "#"
+
+ def render_class(self, session):
+ state = self.get(session)
+ return state == "a" and "disabled" or "enabled"
+
class MachineVisualization(StatUtilizationGrid):
+ def render(self, session, *args):
+ slots_fit = self.parent.all_fits.get(session)
+ if not slots_fit:
+ return super(PoolStats.MachineVisualization, self).render(session, *args)
+
def get_cells(self, session):
pool = self.frame.get_args(session)[0]
action = self.app.model.pool.machines
@@ -434,7 +473,7 @@
machine = data["machine"]
branch = session.branch()
self.parent.machine_param.set(branch, machine)
- self.parent.show_all_slots.set(branch, "m")
+ self.parent.slot_grid.show_all_slots.set(branch, "m")
return branch.marshal()
def get_url(self, session):
@@ -445,26 +484,6 @@
action = self.app.model.pool.machines
return action.get_field_tuples(session)
- class ShowAllSlots(StateSwitch):
- def __init__(self, app, name):
- super(PoolStats.ShowAllSlots, self).__init__(app, name)
-
- self.add_state("a", "All")
- self.add_state("m", "Machine")
-
- def render_href(self, session):
- state = self.get(session)
- if state == "m":
- branch = session.branch()
- self.set(branch, "a")
- return branch.marshal()
- else:
- return "#"
-
- def render_class(self, session):
- state = self.get(session)
- return state == "a" and "disabled" or "enabled"
-
class PoolStatSet(StatSet):
def render_rate_text(self, session, args):
return "Percentage"
Modified: mgmt/trunk/cumin/python/cumin/pool.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/pool.strings 2009-01-05 15:40:29 UTC (rev 3031)
+++ mgmt/trunk/cumin/python/cumin/pool.strings 2009-01-06 14:58:24 UTC (rev 3032)
@@ -100,22 +100,32 @@
</div>
</div>
<div style="float: left; margin-left: 4em;">
- <div class="vistats">
- <h2>{machine_title}</h2>
- <div class="machine_help">Select a Machine to view its slots</div>
{machine_grid}
- </div>
- <div class="vistats">
- <h2>{slot_title}</h2>
- {show_all_slots}
{slot_grid}
- </div>
</div>
<div style="clear:left;"><!-- --></div>
<script type="text/javascript">
var show_slot_job_url = "{slot_job_url}";
</script>
+[SlotVisualization.html]
+{show_all_slots}
+<div class="vistats">
+ <h2>{title}</h2>
+ <div class="StatUtilizationGrid" id="{id}">
+ <div class="visualization">
+ <div id="StatGrid" class="StatGrid" style="width:{grid_width};">
+ {grid}
+ <div style="clear:left;"><!-- --></div>
+ </div>
+ </div>
+ <div id="legend_{name}" class="cell_legend">
+ {grid_legend}
+ </div>
+ </div>
+</div>
+{grid_updater}
+
[ShowAllSlots.html]
<div style="margin:1em;">
<a href="{href}"><button class="{class}" type="button" tabindex="100" >Show All Slots</button></a>
Modified: mgmt/trunk/cumin/python/cumin/slot.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/slot.py 2009-01-05 15:40:29 UTC (rev 3031)
+++ mgmt/trunk/cumin/python/cumin/slot.py 2009-01-06 14:58:24 UTC (rev 3032)
@@ -19,6 +19,12 @@
from slot as ss
where s.name = ss.name))"""
+ def do_get_items(self, session, *args):
+ cursor = super(UniqueSlot, self).do_get_items(session, *args)
+ items = self.cursor_to_rows(cursor)
+ self.items.set(session, items)
+ return items
+
class SlotSet(UniqueSlot):
def __init__(self, app, name):
super(SlotSet, self).__init__(app, name)
@@ -30,6 +36,18 @@
def render_title(self, session, data):
return "Name"
+ def render_items(self, session, *args):
+ """ overridden because a slotset query is expensive.
+ the rows are cached """
+
+ rows = self.get_items(session, *args)
+ writer = Writer()
+
+ for row in rows:
+ self.item_tmpl.render(writer, session, row)
+
+ return writer.to_string()
+
class MachineSet(UniqueSlot):
pass
Modified: mgmt/trunk/cumin/python/cumin/stat.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/stat.py 2009-01-05 15:40:29 UTC (rev 3031)
+++ mgmt/trunk/cumin/python/cumin/stat.py 2009-01-06 14:58:24 UTC (rev 3032)
@@ -164,6 +164,9 @@
def render_name(self, session):
return self.name
+ def render_vis_help(self, session):
+ pass
+
def will_it_fit(self, session):
count = len(self.cells.get_items(session))
columns = self.cells.calculate_columns(count)
@@ -209,7 +212,6 @@
def do_get_items(self, session):
cells = self.parent.get_cells(session)
- self.items.set(session, cells)
self.width.set(session,
self.calculate_cell_width(len(cells)))
return cells
Modified: mgmt/trunk/cumin/python/cumin/stat.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/stat.strings 2009-01-05 15:40:29 UTC (rev 3031)
+++ mgmt/trunk/cumin/python/cumin/stat.strings 2009-01-06 14:58:24 UTC (rev 3032)
@@ -294,9 +294,11 @@
}
[StatUtilizationGrid.html]
-<div class="StatUtilizationGrid" id="{id}">
+<div class="vistats">
+ <h2>{title}</h2>
+ <div class="vis_help">{vis_help}</div>
+ <div class="StatUtilizationGrid" id="{id}">
<div class="visualization">
- <h2>{title}</h2>
<div id="StatGrid" class="StatGrid" style="width:{grid_width};">
{grid}
<div style="clear:left;"><!-- --></div>
@@ -305,6 +307,7 @@
<div id="legend_{name}" class="cell_legend">
{grid_legend}
</div>
+ </div>
</div>
{grid_updater}
Modified: mgmt/trunk/cumin/python/cumin/system.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/system.py 2009-01-05 15:40:29 UTC (rev 3031)
+++ mgmt/trunk/cumin/python/cumin/system.py 2009-01-06 14:58:24 UTC (rev 3032)
@@ -186,7 +186,7 @@
def get_url(self, session):
system = self.parent.frame.get_args(session)[0]
return "call.xml?class=system;id=%i;method=slots" % system.id
-
+
def get_sticky_info(self, session):
action = self.app.model.system.slots
return action.get_field_tuples(session)
@@ -236,7 +236,10 @@
return self.frame.get_args(session)
def render_title(self, session, system):
- return "Grid Slots %s" % fmt_count(self.get_item_count(session, system))
+ # dont' use self.get_item_count because it will cause a costly sql query
+ # instead, use the systemslotset in model so it will be cached
+ count = self.app.model.system.slots.get_slot_count(session, system)
+ return "Grid Slots %s" % fmt_count(count)
def render_sql_where(self, session, system):
elems = list()
15 years, 12 months
rhmessaging commits: r3031 - store/trunk/cpp/m4.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-01-05 10:40:29 -0500 (Mon, 05 Jan 2009)
New Revision: 3031
Modified:
store/trunk/cpp/m4/extensions.m4
Log:
Fix for circular reference error that shows up on new autoconf-2.63 when running bootstrap - the fix is identical to that done in qpid r.726999.
Modified: store/trunk/cpp/m4/extensions.m4
===================================================================
--- store/trunk/cpp/m4/extensions.m4 2008-12-18 23:24:18 UTC (rev 3030)
+++ store/trunk/cpp/m4/extensions.m4 2009-01-05 15:40:29 UTC (rev 3031)
@@ -1,7 +1,7 @@
-# serial 4 -*- Autoconf -*-
+# serial 5 -*- Autoconf -*-
# Enable extensions on systems that normally disable them.
-# Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006, 2008 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -16,6 +16,7 @@
# ------------------------
# Enable extensions on systems that normally disable them,
# typically due to standards-conformance issues.
+m4_ifdef([AC_USE_SYSTEM_EXTENSIONS], [], [
AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
[
AC_BEFORE([$0], [AC_COMPILE_IFELSE])
@@ -48,7 +49,7 @@
AC_DEFINE([__EXTENSIONS__])
AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
AC_DEFINE([_TANDEM_SOURCE])
-])
+])])
# gl_USE_SYSTEM_EXTENSIONS
# ------------------------
16 years