rhmessaging commits: r3313 - in mgmt/trunk/mint: sql and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-04-20 14:55:47 -0400 (Mon, 20 Apr 2009)
New Revision: 3313
Modified:
mgmt/trunk/mint/python/mint/schema.py
mgmt/trunk/mint/sql/Makefile
mgmt/trunk/mint/sql/schema.sql
mgmt/trunk/mint/sql/triggers.sql
Log:
Latest make of schema files
Modified: mgmt/trunk/mint/python/mint/schema.py
===================================================================
--- mgmt/trunk/mint/python/mint/schema.py 2009-04-20 18:54:45 UTC (rev 3312)
+++ mgmt/trunk/mint/python/mint/schema.py 2009-04-20 18:55:47 UTC (rev 3313)
@@ -441,6 +441,12 @@
qmfUpdateTime = TimestampCol(default=None)
collector = ForeignKey('Collector', cascade='null', default=None)
classInfos = dict() # brokerId => classInfo
+ RunningJobs = BigIntCol(default=None)
+ IdleJobs = BigIntCol(default=None)
+ HostsTotal = BigIntCol(default=None)
+ HostsClaimed = BigIntCol(default=None)
+ HostsUnclaimed = BigIntCol(default=None)
+ HostsOwner = BigIntCol(default=None)
@@ -509,6 +515,50 @@
+class Grid(SQLObject):
+ class sqlmeta:
+ lazyUpdate = True
+
+ qmfBrokerId = StringCol(length=1000, default=None)
+ qmfScopeId = BigIntCol(default=None)
+ qmfObjectId = BigIntCol(default=None)
+ qmfIdsUnique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
+ qmfClassKey = StringCol(length=1000, default=None)
+ qmfUpdateTime = TimestampCol(default=None)
+ qmfCreateTime = TimestampCol(default=None)
+ qmfDeleteTime = TimestampCol(default=None)
+ statsCurr = ForeignKey('GridStats', cascade='null', default=None)
+ statsCurrIndex = DatabaseIndex(statsCurr)
+ statsPrev = ForeignKey('GridStats', cascade='null', default=None)
+ statsPrevIndex = DatabaseIndex(statsPrev)
+ classInfos = dict() # brokerId => classInfo
+ Pool = StringCol(length=1000, default=None)
+ Name = StringCol(length=1000, default=None)
+ ScheddName = StringCol(length=1000, default=None)
+ Owner = StringCol(length=1000, default=None)
+ JobLimit = BigIntCol(default=None)
+ SubmitLimit = BigIntCol(default=None)
+ GridResourceUnavailableTime = TimestampCol(default=None)
+
+
+class GridStats(SQLObject):
+ class sqlmeta:
+ lazyUpdate = True
+
+ qmfUpdateTime = TimestampCol(default=None)
+ grid = ForeignKey('Grid', cascade='null', default=None)
+ classInfos = dict() # brokerId => classInfo
+ NumJobs = BigIntCol(default=None)
+ SubmitsInProgress = BigIntCol(default=None)
+ SubmitsQueued = BigIntCol(default=None)
+ SubmitsAllowed = BigIntCol(default=None)
+ SubmitsWanted = BigIntCol(default=None)
+ RunningJobs = BigIntCol(default=None)
+ IdleJobs = BigIntCol(default=None)
+
+
+
+
class Acl(SQLObject):
class sqlmeta:
lazyUpdate = True
@@ -572,14 +622,18 @@
broker = ForeignKey('Broker', cascade='null', default=None)
clusterName = StringCol(length=1000, default=None)
clusterID = StringCol(length=1000, default=None)
+ memberID = StringCol(length=1000, default=None)
publishedURL = StringCol(length=1000, default=None)
clusterSize = IntCol(default=None)
status = StringCol(length=1000, default=None)
members = StringCol(length=4000, default=None)
+ memberIDs = StringCol(length=4000, default=None)
- def stopClusterNode(self, model, callback):
+ def stopClusterNode(self, model, callback, brokerId):
actualArgs = list()
+ if brokerId is not None:
+ actualArgs.append(brokerId)
originalId = ObjectId(None, self.qmfScopeId, self.qmfObjectId)
model.callMethod(self.qmfBrokerId, originalId, self.qmfClassKey, "stopClusterNode",
callback, args=actualArgs)
@@ -677,8 +731,10 @@
readPageSize = BigIntCol(default=None)
readPages = BigIntCol(default=None)
initialFileCount = IntCol(default=None)
+ autoExpand = BoolCol(default=None)
+ currentFileCount = IntCol(default=None)
+ maxFileCount = IntCol(default=None)
dataFileSize = BigIntCol(default=None)
- currentFileCount = BigIntCol(default=None)
def expand(self, model, callback, by):
@@ -702,6 +758,7 @@
recordDepthHigh = BigIntCol(default=None)
enqueues = BigIntCol(default=None)
dequeues = BigIntCol(default=None)
+ txn = BigIntCol(default=None)
txnEnqueues = BigIntCol(default=None)
txnDequeues = BigIntCol(default=None)
txnCommits = BigIntCol(default=None)
@@ -845,6 +902,7 @@
qmfUpdateTime = TimestampCol(default=None)
broker = ForeignKey('Broker', cascade='null', default=None)
classInfos = dict() # brokerId => classInfo
+ uptime = BigIntCol(default=None)
@@ -1096,6 +1154,9 @@
SystemConnection = BoolCol(default=None)
federationLink = BoolCol(default=None)
authIdentity = StringCol(length=1000, default=None)
+ remoteProcessName = StringCol(length=1000, default=None)
+ remotePid = BigIntCol(default=None)
+ remoteParentPid = BigIntCol(default=None)
def close(self, model, callback):
@@ -1150,7 +1211,7 @@
model.callMethod(self.qmfBrokerId, originalId, self.qmfClassKey, "close",
callback, args=actualArgs)
- def bridge(self, model, callback, durable, src, dest, key, tag, excludes, srcIsQueue, srcIsLocal, dynamic):
+ def bridge(self, model, callback, durable, src, dest, key, tag, excludes, srcIsQueue, srcIsLocal, dynamic, sync):
"""Bridge messages over the link"""
actualArgs = list()
if durable is not None:
@@ -1171,6 +1232,8 @@
actualArgs.append(srcIsLocal)
if dynamic is not None:
actualArgs.append(dynamic)
+ if sync is not None:
+ actualArgs.append(sync)
originalId = ObjectId(None, self.qmfScopeId, self.qmfObjectId)
model.callMethod(self.qmfBrokerId, originalId, self.qmfClassKey, "bridge",
callback, args=actualArgs)
@@ -1216,6 +1279,7 @@
tag = StringCol(length=1000, default=None)
excludes = StringCol(length=1000, default=None)
dynamic = BoolCol(default=None)
+ syncRsv = IntCol(default=None)
def close(self, model, callback):
@@ -1259,6 +1323,7 @@
detachedLifespan = BigIntCol(default=None)
attached = BoolCol(default=None)
expireTime = TimestampCol(default=None)
+ maxClientRate = BigIntCol(default=None)
def solicitAck(self, model, callback):
@@ -1297,6 +1362,7 @@
TxnCommits = BigIntCol(default=None)
TxnRejects = BigIntCol(default=None)
TxnCount = BigIntCol(default=None)
+ clientCredit = BigIntCol(default=None)
@@ -1399,6 +1465,11 @@
Master.sqlmeta.addJoin(SQLMultipleJoin('MasterStats', joinMethodName='stats'))
+classToSchemaNameMap['Grid'] = 'Grid'
+schemaNameToClassMap['Grid'] = Grid
+
+Grid.sqlmeta.addJoin(SQLMultipleJoin('GridStats', joinMethodName='stats'))
+
classToSchemaNameMap['Acl'] = 'Acl'
schemaNameToClassMap['Acl'] = Acl
@@ -1528,6 +1599,6 @@
Sysimage.sqlmeta.addJoin(SQLMultipleJoin('SysimageStats', joinMethodName='stats'))
-entityClasses = ['Slot', 'Job', 'Scheduler', 'Submitter', 'Negotiator', 'Collector', 'Master', 'Acl', 'Cluster', 'Store', 'Journal', 'System', 'Broker', 'Agent', 'Vhost', 'Queue', 'Exchange', 'Binding', 'ClientConnection', 'Link', 'Bridge', 'Session', 'Sysimage']
+entityClasses = ['Slot', 'Job', 'Scheduler', 'Submitter', 'Negotiator', 'Collector', 'Master', 'Grid', 'Acl', 'Cluster', 'Store', 'Journal', 'System', 'Broker', 'Agent', 'Vhost', 'Queue', 'Exchange', 'Binding', 'ClientConnection', 'Link', 'Bridge', 'Session', 'Sysimage']
-statsClasses = ['SlotStats', 'JobStats', 'SchedulerStats', 'SubmitterStats', 'NegotiatorStats', 'CollectorStats', 'MasterStats', 'AclStats', 'ClusterStats', 'StoreStats', 'JournalStats', 'SystemStats', 'BrokerStats', 'AgentStats', 'VhostStats', 'QueueStats', 'ExchangeStats', 'BindingStats', 'ClientConnectionStats', 'LinkStats', 'BridgeStats', 'SessionStats', 'SysimageStats']
+statsClasses = ['SlotStats', 'JobStats', 'SchedulerStats', 'SubmitterStats', 'NegotiatorStats', 'CollectorStats', 'MasterStats', 'GridStats', 'AclStats', 'ClusterStats', 'StoreStats', 'JournalStats', 'SystemStats', 'BrokerStats', 'AgentStats', 'VhostStats', 'QueueStats', 'ExchangeStats', 'BindingStats', 'ClientConnectionStats', 'LinkStats', 'BridgeStats', 'SessionStats', 'SysimageStats']
Modified: mgmt/trunk/mint/sql/Makefile
===================================================================
--- mgmt/trunk/mint/sql/Makefile 2009-04-20 18:54:45 UTC (rev 3312)
+++ mgmt/trunk/mint/sql/Makefile 2009-04-20 18:55:47 UTC (rev 3313)
@@ -5,7 +5,7 @@
schema: schema.sql
schema.sql: ../python/mint/*.py
- sqlobject-admin sql -m mint -m mint.schema -c ${dsn} | sed -e '1,2d' > schema.sql
+ sqlobject-admin sql -m mint.model -m mint.schema -c ${dsn} | sed -e '1,2d' > schema.sql
clean:
rm -f schema.sql
Modified: mgmt/trunk/mint/sql/schema.sql
===================================================================
--- mgmt/trunk/mint/sql/schema.sql 2009-04-20 18:54:45 UTC (rev 3312)
+++ mgmt/trunk/mint/sql/schema.sql 2009-04-20 18:55:47 UTC (rev 3313)
@@ -1,8 +1,3 @@
-CREATE TABLE broker_cluster (
- id SERIAL PRIMARY KEY,
- name VARCHAR(1000)
-);
-
CREATE TABLE broker_group (
id SERIAL PRIMARY KEY,
name VARCHAR(1000) NOT NULL UNIQUE
@@ -15,18 +10,11 @@
);
CREATE UNIQUE INDEX broker_group_mapping_unique ON broker_group_mapping (broker_id, broker_group_id);
-CREATE TABLE broker_profile (
- id SERIAL PRIMARY KEY,
- name VARCHAR(1000)
-);
-
CREATE TABLE broker_registration (
id SERIAL PRIMARY KEY,
name VARCHAR(1000) NOT NULL UNIQUE,
url VARCHAR(1000),
- broker_id INT,
- cluster_id INT,
- profile_id INT
+ broker_id INT
);
CREATE UNIQUE INDEX broker_registration_url_unique ON broker_registration (url);
@@ -167,7 +155,8 @@
src_is_local BOOL,
tag VARCHAR(1000),
excludes VARCHAR(1000),
- dynamic BOOL
+ dynamic BOOL,
+ sync_rsv INT
);
CREATE UNIQUE INDEX bridge_qmfIdsUnique ON bridge (qmf_broker_id, qmf_scope_id, qmf_object_id);
CREATE INDEX bridge_statsCurrIndex ON bridge (stats_curr_id);
@@ -208,7 +197,8 @@
CREATE TABLE broker_stats (
id SERIAL PRIMARY KEY,
qmf_update_time TIMESTAMP,
- broker_id INT
+ broker_id INT,
+ uptime BIGINT
);
CREATE TABLE client_connection (
@@ -227,7 +217,10 @@
incoming BOOL,
system_connection BOOL,
federation_link BOOL,
- auth_identity VARCHAR(1000)
+ auth_identity VARCHAR(1000),
+ remote_process_name VARCHAR(1000),
+ remote_pid BIGINT,
+ remote_parent_pid BIGINT
);
CREATE UNIQUE INDEX client_connection_qmfIdsUnique ON client_connection (qmf_broker_id, qmf_scope_id, qmf_object_id);
CREATE INDEX client_connection_statsCurrIndex ON client_connection (stats_curr_id);
@@ -258,10 +251,12 @@
broker_id INT,
cluster_name VARCHAR(1000),
cluster_id VARCHAR(1000),
+ member_id VARCHAR(1000),
published_ur_l VARCHAR(1000),
cluster_size INT,
status VARCHAR(1000),
- members VARCHAR(4000)
+ members VARCHAR(4000),
+ member_i_ds VARCHAR(4000)
);
CREATE UNIQUE INDEX cluster_qmfIdsUnique ON cluster (qmf_broker_id, qmf_scope_id, qmf_object_id);
CREATE INDEX cluster_statsCurrIndex ON cluster (stats_curr_id);
@@ -298,7 +293,13 @@
CREATE TABLE collector_stats (
id SERIAL PRIMARY KEY,
qmf_update_time TIMESTAMP,
- collector_id INT
+ collector_id INT,
+ running_jobs BIGINT,
+ idle_jobs BIGINT,
+ hosts_total BIGINT,
+ hosts_claimed BIGINT,
+ hosts_unclaimed BIGINT,
+ hosts_owner BIGINT
);
CREATE TABLE exchange (
@@ -340,6 +341,42 @@
byte_routes BIGINT
);
+CREATE TABLE grid (
+ id SERIAL PRIMARY KEY,
+ qmf_broker_id VARCHAR(1000),
+ qmf_scope_id BIGINT,
+ qmf_object_id BIGINT,
+ qmf_class_key VARCHAR(1000),
+ qmf_update_time TIMESTAMP,
+ qmf_create_time TIMESTAMP,
+ qmf_delete_time TIMESTAMP,
+ stats_curr_id INT,
+ stats_prev_id INT,
+ pool VARCHAR(1000),
+ name VARCHAR(1000),
+ schedd_name VARCHAR(1000),
+ owner VARCHAR(1000),
+ job_limit BIGINT,
+ submit_limit BIGINT,
+ grid_resource_unavailable_time TIMESTAMP
+);
+CREATE UNIQUE INDEX grid_qmfIdsUnique ON grid (qmf_broker_id, qmf_scope_id, qmf_object_id);
+CREATE INDEX grid_statsCurrIndex ON grid (stats_curr_id);
+CREATE INDEX grid_statsPrevIndex ON grid (stats_prev_id);
+
+CREATE TABLE grid_stats (
+ id SERIAL PRIMARY KEY,
+ qmf_update_time TIMESTAMP,
+ grid_id INT,
+ num_jobs BIGINT,
+ submits_in_progress BIGINT,
+ submits_queued BIGINT,
+ submits_allowed BIGINT,
+ submits_wanted BIGINT,
+ running_jobs BIGINT,
+ idle_jobs BIGINT
+);
+
CREATE TABLE job (
id SERIAL PRIMARY KEY,
qmf_broker_id VARCHAR(1000),
@@ -410,8 +447,10 @@
read_page_size BIGINT,
read_pages BIGINT,
initial_file_count INT,
- data_file_size BIGINT,
- current_file_count BIGINT
+ auto_expand BOOL,
+ current_file_count INT,
+ max_file_count INT,
+ data_file_size BIGINT
);
CREATE UNIQUE INDEX journal_qmfIdsUnique ON journal (qmf_broker_id, qmf_scope_id, qmf_object_id);
CREATE INDEX journal_statsPrevIndex ON journal (stats_prev_id);
@@ -426,6 +465,7 @@
record_depth_high BIGINT,
enqueues BIGINT,
dequeues BIGINT,
+ txn BIGINT,
txn_enqueues BIGINT,
txn_dequeues BIGINT,
txn_commits BIGINT,
@@ -676,7 +716,8 @@
client_connection_id INT,
detached_lifespan BIGINT,
attached BOOL,
- expire_time TIMESTAMP
+ expire_time TIMESTAMP,
+ max_client_rate BIGINT
);
CREATE UNIQUE INDEX session_qmfIdsUnique ON session (qmf_broker_id, qmf_scope_id, qmf_object_id);
CREATE INDEX session_statsCurrIndex ON session (stats_curr_id);
@@ -690,7 +731,8 @@
txn_starts BIGINT,
txn_commits BIGINT,
txn_rejects BIGINT,
- txn_count BIGINT
+ txn_count BIGINT,
+ client_credit BIGINT
);
CREATE TABLE slot (
@@ -975,10 +1017,6 @@
ALTER TABLE broker_registration ADD CONSTRAINT broker_id_exists FOREIGN KEY (broker_id) REFERENCES broker (id) ON DELETE SET NULL;
-ALTER TABLE broker_registration ADD CONSTRAINT cluster_id_exists FOREIGN KEY (cluster_id) REFERENCES broker_cluster (id) ON DELETE SET NULL;
-
-ALTER TABLE broker_registration ADD CONSTRAINT profile_id_exists FOREIGN KEY (profile_id) REFERENCES broker_profile (id) ON DELETE SET NULL;
-
ALTER TABLE subject_role_mapping ADD CONSTRAINT subject_id_exists FOREIGN KEY (subject_id) REFERENCES subject (id) ON DELETE CASCADE;
ALTER TABLE subject_role_mapping ADD CONSTRAINT role_id_exists FOREIGN KEY (role_id) REFERENCES role (id) ON DELETE CASCADE;
@@ -1059,6 +1097,12 @@
ALTER TABLE exchange_stats ADD CONSTRAINT exchange_id_exists FOREIGN KEY (exchange_id) REFERENCES exchange (id) ON DELETE SET NULL;
+ALTER TABLE grid ADD CONSTRAINT stats_curr_id_exists FOREIGN KEY (stats_curr_id) REFERENCES grid_stats (id) ON DELETE SET NULL;
+
+ALTER TABLE grid ADD CONSTRAINT stats_prev_id_exists FOREIGN KEY (stats_prev_id) REFERENCES grid_stats (id) ON DELETE SET NULL;
+
+ALTER TABLE grid_stats ADD CONSTRAINT grid_id_exists FOREIGN KEY (grid_id) REFERENCES grid (id) ON DELETE SET NULL;
+
ALTER TABLE job ADD CONSTRAINT stats_curr_id_exists FOREIGN KEY (stats_curr_id) REFERENCES job_stats (id) ON DELETE SET NULL;
ALTER TABLE job ADD CONSTRAINT stats_prev_id_exists FOREIGN KEY (stats_prev_id) REFERENCES job_stats (id) ON DELETE SET NULL;
Modified: mgmt/trunk/mint/sql/triggers.sql
===================================================================
--- mgmt/trunk/mint/sql/triggers.sql 2009-04-20 18:54:45 UTC (rev 3312)
+++ mgmt/trunk/mint/sql/triggers.sql 2009-04-20 18:55:47 UTC (rev 3313)
@@ -108,6 +108,19 @@
CREATE INDEX master_stats_update_time ON master_stats (qmf_update_time);
+CREATE OR REPLACE FUNCTION update_grid_stats() RETURNS trigger AS '
+BEGIN
+ UPDATE grid SET stats_prev_id = stats_curr_id, stats_curr_id = new.id WHERE id = new.grid_id;
+ RETURN new;
+END
+' LANGUAGE plpgsql;
+
+CREATE TRIGGER update_grid_stats AFTER INSERT ON grid_stats
+ FOR EACH ROW EXECUTE PROCEDURE update_grid_stats();
+
+CREATE INDEX grid_stats_update_time ON grid_stats (qmf_update_time);
+
+
CREATE OR REPLACE FUNCTION update_acl_stats() RETURNS trigger AS '
BEGIN
UPDATE acl SET stats_prev_id = stats_curr_id, stats_curr_id = new.id WHERE id = new.acl_id;
15 years, 2 months
rhmessaging commits: r3311 - in mgmt/trunk/cumin/python/cumin: grid and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-04-20 14:53:04 -0400 (Mon, 20 Apr 2009)
New Revision: 3311
Modified:
mgmt/trunk/cumin/python/cumin/grid/collector.py
mgmt/trunk/cumin/python/cumin/grid/collector.strings
mgmt/trunk/cumin/python/cumin/model.py
mgmt/trunk/cumin/python/cumin/stat.py
mgmt/trunk/cumin/python/cumin/stat.strings
mgmt/trunk/cumin/python/cumin/visualizations.strings
Log:
Use new collector stats in stacked graphs.
Added Jobs Running / Idle stacked graph
Modified: mgmt/trunk/cumin/python/cumin/grid/collector.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/collector.py 2009-04-20 14:14:01 UTC (rev 3310)
+++ mgmt/trunk/cumin/python/cumin/grid/collector.py 2009-04-20 18:53:04 UTC (rev 3311)
@@ -113,17 +113,25 @@
self.add_child(StatSet(app, "stats", "general"))
- chart = self.StackedChart(app, "utilization")
- chart.stats = ("HostsIdle", "HostsClaimed", "HostsUnclaimed")
+ chart = self.JobStackedChart(app, "jobs")
+ chart.stats = ("RunningJobs", "IdleJobs")
self.add_child(chart)
+ chart = self.SlotStackedChart(app, "slots")
+ chart.stats = ("HostsClaimed", "HostsUnclaimed", "HostsOwner")
+ self.add_child(chart)
+
def render_title(self, session):
return "Statistics"
- class StackedChart(StatStackedChart):
+ class JobStackedChart(StatStackedChart):
def render_title(self, session, *args):
- return "Slot Utilization"
+ return "Job Status"
+ class SlotStackedChart(StatStackedChart):
+ def render_title(self, session, *args):
+ return "Slot State"
+
class CollectorView(CuminView):
def __init__(self, app, name):
super(CollectorView, self).__init__(app, name)
Modified: mgmt/trunk/cumin/python/cumin/grid/collector.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/collector.strings 2009-04-20 14:14:01 UTC (rev 3310)
+++ mgmt/trunk/cumin/python/cumin/grid/collector.strings 2009-04-20 18:53:04 UTC (rev 3311)
@@ -47,7 +47,14 @@
<h2>Collector Stats</h2>
{stats}
</td>
- <td>{utilization}</td>
+ <td>
+ <div>
+ {jobs}
+ </div>
+ <div>
+ {slots}
+ </div>
+ </td>
</tr>
</tbody>
</table>
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2009-04-20 14:14:01 UTC (rev 3310)
+++ mgmt/trunk/cumin/python/cumin/model.py 2009-04-20 18:53:04 UTC (rev 3311)
@@ -2683,14 +2683,20 @@
action = GetStartedAction(self, "GetStarted")
action.navigable = False
+ stat = CuminStat(self, "RunningJobs")
+ stat.title = "Running Jobs"
+
+ stat = CuminStat(self, "IdleJobs")
+ stat.title = "Idle Jobs"
+
stat = CuminStat(self, "HostsClaimed")
stat.title = "Claimed Slots"
stat = CuminStat(self, "HostsUnclaimed")
stat.title = "Unclaimed Slots"
- stat = CuminStat(self, "HostsIdle")
- stat.title = "Idle Slots"
+ stat = CuminStat(self, "HostsOwner")
+ stat.title = "Owner Slots"
stat = CuminStat(self, "HostsTotal")
stat.title = "Total Slots"
Modified: mgmt/trunk/cumin/python/cumin/stat.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/stat.py 2009-04-20 14:14:01 UTC (rev 3310)
+++ mgmt/trunk/cumin/python/cumin/stat.py 2009-04-20 18:53:04 UTC (rev 3311)
@@ -471,14 +471,15 @@
duration = self.duration.get(session)
#XXX fake stats for now
- count = self.container_width.get(session) / 3
- t = datetime.now()
- seed(1)
+ #count = self.container_width.get(session) / 3
+ #t = datetime.now()
+ #seed(1)
+ #for stat in stats:
+ # samples[stat] = self.fake_samples(min(count, 200), t, 10)
+
for stat in stats:
- samples[stat] = self.fake_samples(min(count, 200), t, 10)
+ samples[stat] = stat.samples(object, duration)
- #samples[stat] = stat.samples(object, duration)
-
points = dict()
for stat in stats:
for sample in samples[stat]:
Modified: mgmt/trunk/cumin/python/cumin/stat.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/stat.strings 2009-04-20 14:14:01 UTC (rev 3310)
+++ mgmt/trunk/cumin/python/cumin/stat.strings 2009-04-20 18:53:04 UTC (rev 3311)
@@ -148,6 +148,22 @@
<span class="ph" statname="{stat_name}" statmode="{mode}">{stat_value}</span>
</li>
+[StatStackedChart.javascript]
+function stackedNotify(full, width, height, id) {
+ var oImg = document.images[id];
+ if (oImg) {
+ var src = oImg.src;
+ var branch = wooly.session.branch(src);
+ branch.width = Math.max(width - 100, 360);
+ branch.height = Math.max(height - 100, 100);
+ src = branch.marshal();
+
+ src = cumin.refreshTime(src);
+ oImg.style.visibility = "hidden";
+ oImg.src = src;
+ }
+}
+
[StatStackedChart.html]
<div class="StatValueChart fullpageable" id="{id}">
<h2>{title}</h2>
@@ -164,25 +180,12 @@
}
wooly.addPageUpdateListener(update);
-}())
-function stackedNotify(full, width, height) {
- var oImg = document.images['{id}'];
- if (oImg) {
- var src = oImg.src;
- var branch = wooly.session.branch(src);
- branch.width = Math.max(width - 100, 360);
- branch.height = Math.max(height - 100, 100);
- src = branch.marshal();
- src = cumin.refreshTime(src);
- oImg.style.visibility = "hidden";
- oImg.src = src;
- }
-}
- $('{id}').onfullpage = function (width, height) { stackedNotify(true, width, height); };
- $('{id}').onrestore = function () { stackedNotify(false, {width}, 100); };
+ $('{id}').onfullpage = function (width, height) { stackedNotify(true, width, height, '{id}'); };
+ $('{id}').onrestore = function () { stackedNotify(false, {width}, 100, '{id}'); };
var oImg = document.images['{id}'];
$(oImg).addEvent('load', function () { this.style.visibility = "visible" });
$(oImg).addEvent('dblclick', function () {fullpage(this.parentNode.parentNode.parentNode.getElementsByTagName('p')[0])});
+}())
//]]>
</script>
Modified: mgmt/trunk/cumin/python/cumin/visualizations.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/visualizations.strings 2009-04-20 14:14:01 UTC (rev 3310)
+++ mgmt/trunk/cumin/python/cumin/visualizations.strings 2009-04-20 18:53:04 UTC (rev 3311)
@@ -235,10 +235,10 @@
var oZooming = document.getElementById("slot_zooming");
if (oZooming) {
oZooming.style.display = "block";
- var oMap = document.getElementById(slot_current_id);
- if (oMap) {
- oZooming.style.width = oMap.offsetWidth + "px";
- }
+ //var oMap = document.getElementById(slot_current_id);
+ //if (oMap) {
+ // oZooming.style.width = oMap.offsetWidth + "px";
+ //}
}
var oImg = document.images[slot_current_id];
if (oImg) {
@@ -826,11 +826,13 @@
}
div#slot_zooming {
- width: 400px;
+/* width: 400px;
height: 400px;
position: absolute;
left:0;
- top:0;
+ top:0; */
+ margin: 3em auto;
+ padding: 1em;
z-index:200;
text-align: center;
background-color: white;
@@ -838,11 +840,12 @@
opacity: 0.5;
-moz-opacity: 0.5;
display: none;
+ border: 1px solid #000;
}
div#slot_zooming p {
margin: 0;
- padding: 140px 0 0 0;
+/* padding: 140px 0 0 0; */
}
div#slot_controls {
15 years, 2 months
rhmessaging commits: r3310 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-04-20 10:14:01 -0400 (Mon, 20 Apr 2009)
New Revision: 3310
Modified:
mgmt/trunk/cumin/python/cumin/widgets.py
Log:
Make TopTables auto-update
Modified: mgmt/trunk/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.py 2009-04-20 12:47:35 UTC (rev 3309)
+++ mgmt/trunk/cumin/python/cumin/widgets.py 2009-04-20 14:14:01 UTC (rev 3310)
@@ -673,6 +673,8 @@
col.alignment = "right"
self.add_column(col)
+ self.update_enabled = True;
+
self.count = Attribute(app, "count")
self.count.default = 1
self.add_attribute(self.count)
15 years, 2 months
rhmessaging commits: r3309 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-04-20 08:47:35 -0400 (Mon, 20 Apr 2009)
New Revision: 3309
Modified:
mgmt/trunk/cumin/python/cumin/widgets.strings
Log:
Add missing {id
Modified: mgmt/trunk/cumin/python/cumin/widgets.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.strings 2009-04-20 12:35:46 UTC (rev 3308)
+++ mgmt/trunk/cumin/python/cumin/widgets.strings 2009-04-20 12:47:35 UTC (rev 3309)
@@ -431,7 +431,7 @@
wooly.addPageUpdateListener( cumin.restoreTableCheckboxes );
[CuminTable.html]
-<table class="mobjects">
+<table id="{id}" class="mobjects">
<thead>
<tr>
<th class="setnav" colspan="{column_count}">
15 years, 2 months
rhmessaging commits: r3308 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-04-20 08:35:46 -0400 (Mon, 20 Apr 2009)
New Revision: 3308
Modified:
mgmt/trunk/cumin/python/cumin/visualizations.strings
Log:
Prevent pan arrows on zoom level 1
Modified: mgmt/trunk/cumin/python/cumin/visualizations.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/visualizations.strings 2009-04-17 20:13:06 UTC (rev 3307)
+++ mgmt/trunk/cumin/python/cumin/visualizations.strings 2009-04-20 12:35:46 UTC (rev 3308)
@@ -297,7 +297,7 @@
function set_pan(id, which, value, fn) {
var obj = document.getElementById(id);
if (obj) {
- if (value < slot_clip_size) {
+ if (value <= slot_clip_size) {
eval("obj.style." + which + " = '" + Math.min(value, slot_clip_size) + "px'");
obj.style.visibility = "hidden";
obj.onclick = null;
15 years, 2 months
rhmessaging commits: r3307 - in store/trunk/cpp: lib and 2 other directories.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-04-17 16:13:06 -0400 (Fri, 17 Apr 2009)
New Revision: 3307
Added:
store/trunk/cpp/tests/cluster/
store/trunk/cpp/tests/cluster/.valgrind.supp
store/trunk/cpp/tests/cluster/.valgrindrc
store/trunk/cpp/tests/cluster/Makefile.am
store/trunk/cpp/tests/cluster/_st_cluster_basic.cpp
store/trunk/cpp/tests/cluster/run_cluster_tests
Modified:
store/trunk/cpp/configure.ac
store/trunk/cpp/lib/MessageStoreImpl.cpp
store/trunk/cpp/lib/StorePlugin.cpp
store/trunk/cpp/lib/TxnCtxt.cpp
store/trunk/cpp/tests/Makefile.am
Log:
Initial cluster tests taken from qpid, but which makes all queues and messages durable. More to follow.
Modified: store/trunk/cpp/configure.ac
===================================================================
--- store/trunk/cpp/configure.ac 2009-04-17 17:16:10 UTC (rev 3306)
+++ store/trunk/cpp/configure.ac 2009-04-17 20:13:06 UTC (rev 3307)
@@ -87,8 +87,8 @@
AC_MSG_ERROR([$QPID_DIR does not appear to be a valid qpid checkout.])
test -d $QPID_DIR/python -a -d $QPID_DIR/specs || \
AC_MSG_ERROR([$QPID_DIR does not have python and specs directories.])
- QPID_LIBS="$QPID_SRC/libqpidbroker.la $QPID_SRC/libqpidcommon.la"
- QPID_CXXFLAGS="-I$QPID_SRC -I${QPID_SRC}/gen"
+ QPID_LIBS="$QPID_SRC/libqpidbroker.la $QPID_SRC/libqpidclient.la $QPID_SRC/libqpidcommon.la"
+ QPID_CXXFLAGS="-I$QPID_SRC -I${QPID_SRC}/gen -I${QPID_SRC}/tests"
else
fail=0
AC_CHECK_HEADERS([qpid/broker/MessageStore.h], , [fail=1])
@@ -179,12 +179,56 @@
AC_CHECK_PROG([RPMLINT], [rpmlint], [rpmlint])
AM_CONDITIONAL([HAS_RPMLINT], [test -n "$RPMLINT"])
+# Check for optional cluster requirements.
+tmp_LIBS=$LIBS
+LDFLAGS="$LDFLAGS -L/usr/lib/openais -L/usr/lib64/openais -L/usr/lib/corosync -L/usr/lib64/corosync"
+AC_CHECK_LIB([cpg],[cpg_local_get],[have_libcpg=yes],)
+AC_CHECK_HEADERS([openais/cpg.h corosync/cpg.h],[have_cpg_h=yes],)
+AC_ARG_WITH([cpg],
+ [AS_HELP_STRING([--with-cpg], [Build with CPG support for clustering.])],
+ [case "${withval}" in
+ yes) # yes - require dependencies
+ test x$have_libcpg = xyes || AC_MSG_ERROR([libcpg not found, install openais-devel or corosync-devel])
+ test x$have_cpg_h = xyes || AC_MSG_ERROR([cpg.h not found, install openais-devel or corosync-devel])
+ with_cpg=yes
+ ;;
+ no) with_cpg=no ;;
+ *) AC_MSG_ERROR([Bad value ${withval} for --with-cpg option]) ;;
+ esac],
+ [ # not specified - use if present
+ test x$have_libcpg = xyes -a x$have_cpg_h = xyes && with_cpg=yes
+ ]
+)
+AM_CONDITIONAL([HAVE_LIBCPG], [test x$with_cpg = xyes])
+
+AC_CHECK_LIB([cman],[cman_is_quorate],have_libcman=yes,)
+AC_CHECK_HEADERS([libcman.h],have_libcman_h=yes,)
+AC_ARG_WITH([libcman],
+ [AS_HELP_STRING([--with-libcman], [Integration with libcman quorum service.])],
+ [case "${withval}" in
+ yes) # yes - require dependencies
+ test x$have_libcman = xyes || AC_MSG_ERROR([libcman not found, install cman-devel or cmanlib-devel])
+ test x$have_libcman_h = xyes || AC_MSG_ERROR([libcman.h not found, install cman-devel or cmanlib-devel])
+ with_libcman=yes
+ ;;
+ no) with_libcman=no ;;
+ *) AC_MSG_ERROR([Bad value ${withval} for --with-libcman option]) ;;
+ esac],
+ [ # not specified - use if present and we're using with_cpg
+ test x$have_libcman = xyes -a x$have_libcman_h = xyes -a x$with_cpg = xyes && with_libcman=yes
+ ]
+)
+AM_CONDITIONAL([HAVE_LIBCMAN], [test x$with_libcman = xyes])
+
+LIBS=$tmp_LIBS
+
# Also doxygen for documentation...
AC_CHECK_PROG([do_doxygen], [doxygen], [yes])
AM_CONDITIONAL([DOXYGEN], [test x$do_doxygen = xyes])
AC_CONFIG_FILES([
Makefile
+ tests/cluster/Makefile
tests/Makefile
tests/jrnl/Makefile
tests/jrnl/jtt/Makefile
Modified: store/trunk/cpp/lib/MessageStoreImpl.cpp
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.cpp 2009-04-17 17:16:10 UTC (rev 3306)
+++ store/trunk/cpp/lib/MessageStoreImpl.cpp 2009-04-17 20:13:06 UTC (rev 3307)
@@ -293,8 +293,8 @@
TxnCtxt txn;
try {
// Databases are constructed here instead of the constructor so that the DB_RECOVER flag can be used
- // against the database enviroment. Recover can only be performed if no databases have been created
- // against the environmnet at the time of recovery, as recovery invalidates the environment.
+ // against the database environment. Recover can only be performed if no databases have been created
+ // against the environment at the time of recovery, as recovery invalidates the environment.
queueDb.reset(new Db(&env, 0));
configDb.reset(new Db(&env, 0));
exchangeDb.reset(new Db(&env, 0));
@@ -1130,7 +1130,7 @@
if (!tplStorePtr->is_ready())
recoverTplStore();
- // Abort unprepaired xids and populate the locked maps
+ // Abort unprepared xids and populate the locked maps
for (TplRecoverMapCitr i = tplRecoverMap.begin(); i != tplRecoverMap.end(); i++) {
LockedMappings::shared_ptr enq_ptr;
enq_ptr.reset(new LockedMappings);
@@ -1584,7 +1584,7 @@
try {
chkTplStoreInit(); // Late initialize (if needed)
- // This sync is requred to ensure multi-queue atomicity - ie all txn data
+ // This sync is required to ensure multi-queue atomicity - ie all txn data
// must hit the disk on *all* queues before the TPL prepare (enq) is written.
ctxt->sync();
Modified: store/trunk/cpp/lib/StorePlugin.cpp
===================================================================
--- store/trunk/cpp/lib/StorePlugin.cpp 2009-04-17 17:16:10 UTC (rev 3306)
+++ store/trunk/cpp/lib/StorePlugin.cpp 2009-04-17 20:13:06 UTC (rev 3307)
@@ -49,7 +49,7 @@
if (options.storeDir.empty ())
{
if (!dataDir.isEnabled ())
- throw Exception ("If --data-dir is blank or --no-data-dir is specified, --store-dir must be present.");
+ throw Exception ("msgstore: If --data-dir is blank or --no-data-dir is specified, --store-dir must be present.");
options.storeDir = dataDir.getPath ();
}
@@ -62,6 +62,8 @@
Broker* broker = dynamic_cast<Broker*>(&target);
((mrg::msgstore::MessageStoreImpl*) store)->initManagement (broker);
}
+
+ const char* id() {return "StorePlugin";}
};
static StorePlugin instance; // Static initialization.
Modified: store/trunk/cpp/lib/TxnCtxt.cpp
===================================================================
--- store/trunk/cpp/lib/TxnCtxt.cpp 2009-04-17 17:16:10 UTC (rev 3306)
+++ store/trunk/cpp/lib/TxnCtxt.cpp 2009-04-17 20:13:06 UTC (rev 3307)
@@ -38,7 +38,7 @@
}
}
-//static
+// static
uuid_t TxnCtxt::uuid;
// static
@@ -54,7 +54,7 @@
}
TxnCtxt::TxnCtxt(IdSequence* _loggedtx) : loggedtx(_loggedtx), dtokp(new DataTokenImpl), preparedXidStorePtr(0), txn(0) {
- if (loggedtx) {
+ if (loggedtx) {
// // Human-readable tid: 53 bytes
// // uuit_t is a char[16]
// tid.reserve(53);
Modified: store/trunk/cpp/tests/Makefile.am
===================================================================
--- store/trunk/cpp/tests/Makefile.am 2009-04-17 17:16:10 UTC (rev 3306)
+++ store/trunk/cpp/tests/Makefile.am 2009-04-17 20:13:06 UTC (rev 3307)
@@ -28,7 +28,7 @@
TMPDIR=$(abs_srcdir)/test_tmp
-SUBDIRS = jrnl .
+SUBDIRS = cluster jrnl .
TESTS = \
SimpleTest \
Added: store/trunk/cpp/tests/cluster/.valgrind.supp
===================================================================
--- store/trunk/cpp/tests/cluster/.valgrind.supp (rev 0)
+++ store/trunk/cpp/tests/cluster/.valgrind.supp 2009-04-17 20:13:06 UTC (rev 3307)
@@ -0,0 +1,32 @@
+{
+ Benign error in libcpg.
+ Memcheck:Param
+ socketcall.sendmsg(msg.msg_iov[i])
+ obj:*/libpthread-2.5.so
+ obj:*/libcpg.so.2.0.0
+}
+
+{
+ Uninitialised value problem in _dl_relocate (F7, F8)
+ Memcheck:Cond
+ fun:_dl_relocate_object
+ fun:*dl_*
+}
+
+{
+ False "possibly leaked" in boost program_options - global std::string var.
+ Memcheck:Leak
+ fun:_Znwj
+ fun:_ZNSs4_Rep9_S_createEjjRKSaIcE
+ obj:/usr/lib/libstdc++.so.6.0.8
+ fun:_ZNSsC1EPKcRKSaIcE
+ obj:/usr/lib/libboost_program_options.so.1.33.1
+}
+
+{
+ Bogus epoll_ctl error on i386
+ Memcheck:Param
+ epoll_ctl(event)
+ fun:epoll_ctl
+}
+
Added: store/trunk/cpp/tests/cluster/.valgrindrc
===================================================================
--- store/trunk/cpp/tests/cluster/.valgrindrc (rev 0)
+++ store/trunk/cpp/tests/cluster/.valgrindrc 2009-04-17 20:13:06 UTC (rev 3307)
@@ -0,0 +1,7 @@
+--gen-suppressions=all
+--leak-check=full
+--demangle=yes
+--suppressions=.valgrind.supp
+--num-callers=25
+--trace-children=yes
+
Added: store/trunk/cpp/tests/cluster/Makefile.am
===================================================================
--- store/trunk/cpp/tests/cluster/Makefile.am (rev 0)
+++ store/trunk/cpp/tests/cluster/Makefile.am 2009-04-17 20:13:06 UTC (rev 3307)
@@ -0,0 +1,70 @@
+# Copyright (c) 2007, 2008, 2009 Red Hat, Inc.
+#
+# This file is part of the Qpid async store library msgstore.so.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+# USA
+#
+# The GNU Lesser General Public License is available in the file COPYING.
+
+
+abs_builddir=@abs_builddir@
+abs_srcdir=@abs_srcdir@
+
+if HAVE_LIBCPG
+
+
+AM_CXXFLAGS = $(WARNING_CFLAGS) -pthread -DBOOST_TEST_DYN_LINK
+
+INCLUDES=-I$(top_srcdir)/lib $(QPID_CXXFLAGS)
+
+TMPDIR=$(abs_srcdir)/test_tmp
+
+QPID_TEST_DIR = $(QPID_DIR)/cpp/src/tests
+
+CLUSTER_TEST_LDADD = -L$(QPID_TEST_DIR)
+
+all-local: .valgrindrc .valgrind.supp
+.valgrindrc: $(top_srcdir)/tests/.valgrindrc
+ cp $^ .
+.valgrind.supp: $(top_srcdir)/tests/.valgrind.supp
+ cp $^ .
+
+TESTS = run_cluster_tests
+
+check_PROGRAMS = \
+ _st_cluster_basic
+
+UNIT_TEST_SRCS = ../unit_test.cpp
+UNIT_TEST_LDADD = -lboost_unit_test_framework ${top_builddir}/lib/msgstore.la \
+ $(QPID_TEST_DIR)/ClusterFixture.o \
+ $(QPID_TEST_DIR)/ForkedBroker.o
+
+_st_cluster_basic_SOURCES = _st_cluster_basic.cpp $(UNIT_TEST_SRCS)
+_st_cluster_basic_LDADD = $(UNIT_TEST_LDADD) $(CLUSTER_TEST_LDADD)
+
+TESTS_ENVIRONMENT = \
+ QPID_DIR=$(QPID_DIR) \
+ VALGRIND=$(VALGRIND) \
+ LIBCLUSTER=$(QPID_DIR)/cpp/src/.libs/cluster.so \
+ LIBSTORE=$(abs_builddir)/../../lib/.libs/msgstore.so \
+ QPID_FORKED_BROKER=$(QPID_DIR)/cpp/src/qpidd \
+ TMPDIR=$(TMPDIR) \
+ abs_srcdir=$(abs_srcdir)
+
+EXTRA_DIST = \
+ run_cluster_tests
+
+endif
\ No newline at end of file
Added: store/trunk/cpp/tests/cluster/_st_cluster_basic.cpp
===================================================================
--- store/trunk/cpp/tests/cluster/_st_cluster_basic.cpp (rev 0)
+++ store/trunk/cpp/tests/cluster/_st_cluster_basic.cpp 2009-04-17 20:13:06 UTC (rev 3307)
@@ -0,0 +1,199 @@
+/*
+ Copyright (c) 2007, 2008, 2009 Red Hat, Inc.
+
+ This file is part of the Qpid async store library msgstore.so.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+ USA
+
+ The GNU Lesser General Public License is available in the file COPYING.
+ */
+
+#include "../unit_test.h"
+#include <boost/assign.hpp>
+#include <cstdlib>
+#include "ClusterFixture.h"
+
+#define SET_LOG_LEVEL(level) \
+ qpid::log::Options opts(""); \
+ opts.selectors.clear(); \
+ opts.selectors.push_back(level); \
+ qpid::log::Logger::instance().configure(opts);
+
+QPID_AUTO_TEST_SUITE(SimpleTests)
+
+// Timeout for tests that wait for messages
+const sys::Duration TIMEOUT=sys::TIME_SEC/4;
+
+const string test_filename("_st_cluster_basic");
+
+std::string getLibPath(const char* envName)
+{
+ const char* p = std::getenv(envName);
+ assert(p);
+ return p;
+}
+
+Message ttlMessage(const string& data, const string& key, uint64_t ttl) {
+ Message m(data, key);
+ m.getDeliveryProperties().setTtl(ttl);
+ return m;
+}
+
+vector<string> browse(Client& c, const string& q, int n) {
+ SubscriptionSettings browseSettings(
+ FlowControl::unlimited(),
+ ACCEPT_MODE_NONE,
+ ACQUIRE_MODE_NOT_ACQUIRED,
+ 0 // No auto-ack.
+ );
+ LocalQueue lq;
+ c.subs.subscribe(lq, q, browseSettings);
+ vector<string> result;
+ for (int i = 0; i < n; ++i) {
+ Message m;
+ if (!lq.get(m, TIMEOUT))
+ break;
+ result.push_back(m.getData());
+ }
+ c.subs.getSubscription(q).cancel();
+ return result;
+}
+
+QPID_AUTO_TEST_CASE(TestMessageEnqueue)
+{
+ SET_LOG_LEVEL("error+"); // This only needs to be set once.
+
+ cout << test_filename << ".TestMessageEnqueue: " << flush;
+ ClusterFixture::Args args = boost::assign::list_of<std::string>
+ ("--load-module")(getLibPath("LIBSTORE"))
+ ("--auth")("no")
+ ("TMP_DATA_DIR");
+ ClusterFixture cluster(2, -1, args, getLibPath("LIBCLUSTER"));
+ Client c0(cluster[0]);
+ c0.session.queueDeclare("q", arg::durable=true);
+ c0.session.messageTransfer(arg::content=Message("foo", "q"), arg::durable=true);
+ c0.session.messageTransfer(arg::content=Message("bar", "q"), arg::durable=true);
+ c0.session.close();
+ Client c1(cluster[1]);
+ Message msg;
+ BOOST_CHECK(c1.subs.get(msg, "q", TIMEOUT));
+ BOOST_CHECK_EQUAL(string("foo"), msg.getData());
+ BOOST_CHECK(c1.subs.get(msg, "q", TIMEOUT));
+ BOOST_CHECK_EQUAL(string("bar"), msg.getData());
+ cout << " done" << endl << flush;
+}
+
+QPID_AUTO_TEST_CASE(testMessageDequeue) {
+ cout << test_filename << ".testMessageDequeue: " << flush;
+ ClusterFixture::Args args = boost::assign::list_of<std::string>
+ ("--load-module")(getLibPath("LIBSTORE"))
+ ("--auth")("no")
+ ("TMP_DATA_DIR");
+
+ // Enqueue on one broker, dequeue on two others.
+ ClusterFixture cluster(3, -1, args, getLibPath("LIBCLUSTER"));
+ Client c0(cluster[0], "c0");
+ c0.session.queueDeclare("q", arg::durable=true);
+ c0.session.messageTransfer(arg::content=Message("foo", "q"), arg::durable=true);
+ c0.session.messageTransfer(arg::content=Message("bar", "q"), arg::durable=true);
+
+ Message msg;
+
+ // Dequeue on 2 others, ensure correct order.
+ Client c1(cluster[1], "c1");
+ BOOST_CHECK(c1.subs.get(msg, "q"));
+ BOOST_CHECK_EQUAL("foo", msg.getData());
+
+ Client c2(cluster[2], "c2");
+ BOOST_CHECK(c1.subs.get(msg, "q"));
+ BOOST_CHECK_EQUAL("bar", msg.getData());
+
+ // Queue should be empty on all cluster members.
+ BOOST_CHECK_EQUAL(0u, c0.session.queueQuery("q").getMessageCount());
+ BOOST_CHECK_EQUAL(0u, c1.session.queueQuery("q").getMessageCount());
+ BOOST_CHECK_EQUAL(0u, c2.session.queueQuery("q").getMessageCount());
+ cout << " done" << endl << flush;
+}
+
+QPID_AUTO_TEST_CASE(testDequeueWaitingSubscription) {
+ cout << test_filename << ".testDequeueWaitingSubscription: " << flush;
+ ClusterFixture::Args args = boost::assign::list_of<std::string>
+ ("--load-module")(getLibPath("LIBSTORE"))
+ ("--auth")("no")
+ ("TMP_DATA_DIR");
+
+ ClusterFixture cluster(3, -1, args, getLibPath("LIBCLUSTER"));
+ Client c0(cluster[0]);
+ BOOST_REQUIRE_EQUAL(knownBrokerPorts(c0.connection, 3).size(), 3u); // Wait for brokers.
+
+ // First start a subscription.
+ c0.session.queueDeclare("q", arg::durable=true);
+ c0.subs.subscribe(c0.lq, "q", FlowControl::messageCredit(2));
+
+ // Now send messages
+ Client c1(cluster[1]);
+ c1.session.messageTransfer(arg::content=Message("foo", "q"), arg::durable=true);
+ c1.session.messageTransfer(arg::content=Message("bar", "q"), arg::durable=true);
+
+ // Check they arrived
+ Message m;
+ BOOST_CHECK(c0.lq.get(m, TIMEOUT));
+ BOOST_CHECK_EQUAL("foo", m.getData());
+ BOOST_CHECK(c0.lq.get(m, TIMEOUT));
+ BOOST_CHECK_EQUAL("bar", m.getData());
+
+ // Queue should be empty on all cluster members.
+ Client c2(cluster[2]);
+ BOOST_CHECK_EQUAL(0u, c0.session.queueQuery("q").getMessageCount());
+ BOOST_CHECK_EQUAL(0u, c1.session.queueQuery("q").getMessageCount());
+ BOOST_CHECK_EQUAL(0u, c2.session.queueQuery("q").getMessageCount());
+ cout << " done" << endl << flush;
+}
+
+QPID_AUTO_TEST_CASE(testMessageTimeToLive) {
+ cout << test_filename << ".testMessageTimeToLive: " << flush;
+ ClusterFixture::Args args = boost::assign::list_of<std::string>
+ ("--load-module")(getLibPath("LIBSTORE"))
+ ("--auth")("no")
+ ("TMP_DATA_DIR");
+
+ // Note: this doesn't actually test for cluster race conditions around TTL,
+ // it just verifies that basic TTL functionality works.
+ //
+ ClusterFixture cluster(2, -1, args, getLibPath("LIBCLUSTER"));
+ Client c0(cluster[0], "c0");
+ Client c1(cluster[1], "c1");
+ c0.session.queueDeclare("p", arg::durable=true);
+ c0.session.queueDeclare("q", arg::durable=true);
+ c0.session.messageTransfer(arg::content=ttlMessage("a", "q", 200), arg::durable=true);
+ c0.session.messageTransfer(arg::content=Message("b", "q"), arg::durable=true);
+ c0.session.messageTransfer(arg::content=ttlMessage("x", "p", 10000), arg::durable=true);
+ c0.session.messageTransfer(arg::content=Message("y", "p"), arg::durable=true);
+ cluster.add();
+ Client c2(cluster[1], "c2");
+
+ BOOST_CHECK_EQUAL(browse(c0, "p", 2), boost::assign::list_of<string>("x")("y"));
+ BOOST_CHECK_EQUAL(browse(c1, "p", 2), boost::assign::list_of<string>("x")("y"));
+ BOOST_CHECK_EQUAL(browse(c2, "p", 2), boost::assign::list_of<string>("x")("y"));
+
+ sys::usleep(200*1000);
+ BOOST_CHECK_EQUAL(browse(c0, "q", 1), boost::assign::list_of<string>("b"));
+ BOOST_CHECK_EQUAL(browse(c1, "q", 1), boost::assign::list_of<string>("b"));
+ BOOST_CHECK_EQUAL(browse(c2, "q", 1), boost::assign::list_of<string>("b"));
+ cout << " done" << endl << flush;
+}
+
+QPID_AUTO_TEST_SUITE_END()
Added: store/trunk/cpp/tests/cluster/run_cluster_tests
===================================================================
--- store/trunk/cpp/tests/cluster/run_cluster_tests (rev 0)
+++ store/trunk/cpp/tests/cluster/run_cluster_tests 2009-04-17 20:13:06 UTC (rev 3307)
@@ -0,0 +1,58 @@
+#!/bin/bash
+
+# Copyright (c) 2008, 2009 Red Hat, Inc.
+#
+# This file is part of the Qpid async store library msgstore.so.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+# USA
+#
+# The GNU Lesser General Public License is available in the file COPYING.
+
+srcdir=`dirname $0`
+
+# Check AIS requirements and run tests if found.
+id -nG | grep '\<ais\>' >/dev/null || \
+ NOGROUP="You are not a member of the ais group."
+ps -u root | grep 'aisexec\|corosync' >/dev/null || \
+ NOAISEXEC="The aisexec or corosync daemon is not running as root"
+
+if test -n "$NOGROUP" -o -n "$NOAISEXEC"; then
+ cat <<EOF
+
+ =========== WARNING: NOT RUNNING AIS TESTS ==============
+
+ Tests that depend on the openais library (used for clustering)
+ will not be run because:
+
+ $NOGROUP
+ $NOAISEXEC
+
+ ==========================================================
+
+EOF
+ exit 0; # A warning, not a failure.
+fi
+
+# Execute command with the ais group set.
+with_ais_group() {
+ id -nG | grep '\<ais\>' >/dev/null || { echo "You are not a member of the ais group."; exit 1; }
+ echo $* | newgrp ais
+}
+
+# Run the tests
+srcdir=`dirname $0`
+with_ais_group ./_st_cluster_basic || ERROR=1
+exit $ERROR
Property changes on: store/trunk/cpp/tests/cluster/run_cluster_tests
___________________________________________________________________
Name: svn:executable
+ *
15 years, 2 months
rhmessaging commits: r3306 - in mgmt/trunk/cumin/python/cumin: grid and 2 other directories.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-04-17 13:16:10 -0400 (Fri, 17 Apr 2009)
New Revision: 3306
Modified:
mgmt/trunk/cumin/python/cumin/grid/job.py
mgmt/trunk/cumin/python/cumin/grid/job.strings
mgmt/trunk/cumin/python/cumin/grid/limit.strings
mgmt/trunk/cumin/python/cumin/grid/scheduler.strings
mgmt/trunk/cumin/python/cumin/grid/submitter.strings
mgmt/trunk/cumin/python/cumin/inventory/system.strings
mgmt/trunk/cumin/python/cumin/messaging/exchange.py
mgmt/trunk/cumin/python/cumin/messaging/queue.py
mgmt/trunk/cumin/python/cumin/messaging/queue.strings
mgmt/trunk/cumin/python/cumin/page.strings
mgmt/trunk/cumin/python/cumin/widgets.py
mgmt/trunk/cumin/python/cumin/widgets.strings
Log:
Making all CuminTables auto-update.
Modified: mgmt/trunk/cumin/python/cumin/grid/job.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/job.py 2009-04-17 17:01:40 UTC (rev 3305)
+++ mgmt/trunk/cumin/python/cumin/grid/job.py 2009-04-17 17:16:10 UTC (rev 3306)
@@ -239,8 +239,6 @@
def __init__(self, app, name):
super(JobTab, self).__init__(app, name)
- self.update_enabled = True
-
self.__remove = JobRemoveButton(app, "remove")
self.add_child(self.__remove)
Modified: mgmt/trunk/cumin/python/cumin/grid/job.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/job.strings 2009-04-17 17:01:40 UTC (rev 3305)
+++ mgmt/trunk/cumin/python/cumin/grid/job.strings 2009-04-17 17:16:10 UTC (rev 3306)
@@ -130,11 +130,6 @@
</table>
<div>{hidden_inputs}</div>
</form>
-<script type="text/javascript">
-//<![CDATA[
- wooly.addPageUpdateListener( cumin.restoreTableCheckboxes );
-//]]>
-</script>
[JobSearch.html]
@@ -202,16 +197,16 @@
</form>
[JobGroupJobSet.html]
+<form id="{id}" method="post" action="?" update="{id}.table">
<div class="rfloat">{phase}</div>
-<form id="{id}" style="clear:right;" method="post" action="?">
- <div class="sactions">
+ <div class="sactions" style="clear:right;">
{job_search}
<h2>Act on Selected Jobs:</h2>
{hold} {release} {remove}
</div>
- <table class="mobjects">
+ <table id="{id}.table" class="mobjects">
<thead>
<tr>
<th class="setnav" colspan="{column_count}">
Modified: mgmt/trunk/cumin/python/cumin/grid/limit.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/limit.strings 2009-04-17 17:01:40 UTC (rev 3305)
+++ mgmt/trunk/cumin/python/cumin/grid/limit.strings 2009-04-17 17:16:10 UTC (rev 3306)
@@ -81,10 +81,10 @@
<ul class="errors"><li>{error}</li></ul>
[LimitsJobSet.html]
+<form id="{id}" method="post" action="?">
<div class="rfloat">{phase}</div>
-<form id="{id}" style="clear:right;" method="post" action="?">
- <div class="sactions">
+ <div class="sactions" style="clear:right;">
<h2>Act on Selected Jobs:</h2>
{hold} {release} {remove}
</div>
Modified: mgmt/trunk/cumin/python/cumin/grid/scheduler.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/scheduler.strings 2009-04-17 17:01:40 UTC (rev 3305)
+++ mgmt/trunk/cumin/python/cumin/grid/scheduler.strings 2009-04-17 17:16:10 UTC (rev 3306)
@@ -57,16 +57,15 @@
</table>
[SchedulerJobSet.html]
+<form id="{id}" method="post" action="?" update="{id}.table">
<div class="rfloat">{phase}</div>
-
-<form id="{id}" style="clear:right;" method="post" action="?">
- <div class="sactions">
+ <div class="sactions" style="clear:right;">
{job_search}
<h2>Act on Selected Jobs:</h2>
{hold} {release} {remove}
</div>
- <table class="mobjects">
+ <table id="{id}.table" class="mobjects">
<thead>
<tr>
<th class="setnav" colspan="{column_count}">
Modified: mgmt/trunk/cumin/python/cumin/grid/submitter.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/submitter.strings 2009-04-17 17:01:40 UTC (rev 3305)
+++ mgmt/trunk/cumin/python/cumin/grid/submitter.strings 2009-04-17 17:16:10 UTC (rev 3306)
@@ -29,16 +29,16 @@
</table>
[SubmitterJobSet.html]
-<div class="rfloat">{phase}</div>
-<form id="{id}" style="clear:right;" method="post" action="?">
+<form id="{id}" method="post" action="?" update="{id}.table">
- <div class="sactions">
+ <div class="rfloat">{phase}</div>
+ <div class="sactions" style="clear:right;">
{job_search}
<h2>Act on Selected Jobs:</h2>
{hold} {release} {remove}
</div>
- <table class="mobjects">
+ <table id="{id}.table" class="mobjects">
<thead>
<tr>
<th class="setnav" colspan="{column_count}">
Modified: mgmt/trunk/cumin/python/cumin/inventory/system.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/inventory/system.strings 2009-04-17 17:01:40 UTC (rev 3305)
+++ mgmt/trunk/cumin/python/cumin/inventory/system.strings 2009-04-17 17:16:10 UTC (rev 3306)
@@ -83,10 +83,9 @@
</script>
[SystemJobSet.html]
-<div class="rfloat">{phase}</div>
-
-<form id="{id}" style="clear:right;" method="post" action="?">
- <table class="mobjects">
+<form id="{id}" method="post" action="?">
+ <div class="rfloat">{phase}</div>
+ <table class="mobjects" style="clear:right;">
<thead>
<tr>
<th class="setnav" colspan="{column_count}">
Modified: mgmt/trunk/cumin/python/cumin/messaging/exchange.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/messaging/exchange.py 2009-04-17 17:01:40 UTC (rev 3305)
+++ mgmt/trunk/cumin/python/cumin/messaging/exchange.py 2009-04-17 17:16:10 UTC (rev 3306)
@@ -40,8 +40,6 @@
self.vhost = vhost
- self.update_enabled = True
-
self.ids = FilteredCheckboxIdColumn(app, "id", self, callback=self.disable_exchange)
self.add_column(self.ids)
Modified: mgmt/trunk/cumin/python/cumin/messaging/queue.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/messaging/queue.py 2009-04-17 17:01:40 UTC (rev 3305)
+++ mgmt/trunk/cumin/python/cumin/messaging/queue.py 2009-04-17 17:16:10 UTC (rev 3306)
@@ -26,8 +26,6 @@
self.vhost = vhost
- self.update_enabled = True
-
self.ids = CheckboxIdColumn(app, "id")
self.add_column(self.ids)
Modified: mgmt/trunk/cumin/python/cumin/messaging/queue.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/messaging/queue.strings 2009-04-17 17:01:40 UTC (rev 3305)
+++ mgmt/trunk/cumin/python/cumin/messaging/queue.strings 2009-04-17 17:16:10 UTC (rev 3306)
@@ -60,11 +60,6 @@
</table>
<div>{hidden_inputs}</div>
</form>
-<script type="text/javascript">
-//<![CDATA[
- wooly.addPageUpdateListener( cumin.restoreTableCheckboxes );
-//]]>
-</script>
[TopQueueSet.sql]
select
Modified: mgmt/trunk/cumin/python/cumin/page.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/page.strings 2009-04-17 17:01:40 UTC (rev 3305)
+++ mgmt/trunk/cumin/python/cumin/page.strings 2009-04-17 17:16:10 UTC (rev 3306)
@@ -190,11 +190,11 @@
</div>
[MyGridJobs.html]
+<form id="{id}" method="post" action="?">
<div class="rfloat">{phase}</div>
Jobs submitted by {user}
-<form id="{id}" style="clear:right;" method="post" action="?">
- <div class="sactions">
+ <div class="sactions" style="clear:right;">
<h2>Act on Selected Jobs:</h2>
{hold} {release} {remove}
</div>
Modified: mgmt/trunk/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.py 2009-04-17 17:01:40 UTC (rev 3305)
+++ mgmt/trunk/cumin/python/cumin/widgets.py 2009-04-17 17:16:10 UTC (rev 3306)
@@ -676,7 +676,6 @@
self.count = Attribute(app, "count")
self.count.default = 1
self.add_attribute(self.count)
- self.update_enabled = True
def get_connection(self, session):
return sqlhub.getConnection().getConnection()
@@ -694,6 +693,8 @@
self.paginator = Paginator(app, "page")
self.add_child(self.paginator)
+ self.update_enabled = True
+
def get_connection(self, session):
return sqlhub.getConnection().getConnection()
Modified: mgmt/trunk/cumin/python/cumin/widgets.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.strings 2009-04-17 17:01:40 UTC (rev 3305)
+++ mgmt/trunk/cumin/python/cumin/widgets.strings 2009-04-17 17:16:10 UTC (rev 3306)
@@ -427,6 +427,9 @@
font-size: 0.9em;
}
+[CuminTable.javascript]
+ wooly.addPageUpdateListener( cumin.restoreTableCheckboxes );
+
[CuminTable.html]
<table class="mobjects">
<thead>
15 years, 2 months
rhmessaging commits: r3305 - mgmt/trunk/wooly/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-04-17 13:01:40 -0400 (Fri, 17 Apr 2009)
New Revision: 3305
Modified:
mgmt/trunk/wooly/python/wooly/pages.py
Log:
Set user_session and background in session used for background updates
Modified: mgmt/trunk/wooly/python/wooly/pages.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/pages.py 2009-04-17 15:00:03 UTC (rev 3304)
+++ mgmt/trunk/wooly/python/wooly/pages.py 2009-04-17 17:01:40 UTC (rev 3305)
@@ -168,6 +168,7 @@
def render_widgets(self, session):
writer = Writer()
sess = self.session.get(session)
+
widgets = self.widgets.get(session)
for widget in widgets:
@@ -188,6 +189,12 @@
def do_unmarshal(self, string):
return Session.unmarshal(self.app, string)
+ def get(self, session):
+ sess = super(UpdatePage.SessionParameter, self).get(session)
+ sess.user_session = session.user_session
+ sess.background = True
+ return sess
+
class WidgetParameter(Parameter):
def __init__(self, app, name, page):
self.page = page
15 years, 2 months
rhmessaging commits: r3304 - store/branches/java/0.5-release/etc/scripts.
by rhmessaging-commits@lists.jboss.org
Author: ritchiem
Date: 2009-04-17 11:00:03 -0400 (Fri, 17 Apr 2009)
New Revision: 3304
Modified:
store/branches/java/0.5-release/etc/scripts/bdbtest.sh
Log:
Added systest dependency to bdbtest.sh
merged from trunk r3303
Modified: store/branches/java/0.5-release/etc/scripts/bdbtest.sh
===================================================================
--- store/branches/java/0.5-release/etc/scripts/bdbtest.sh 2009-04-17 14:58:15 UTC (rev 3303)
+++ store/branches/java/0.5-release/etc/scripts/bdbtest.sh 2009-04-17 15:00:03 UTC (rev 3304)
@@ -35,7 +35,7 @@
VERSION=0.5
# Set classpath to include Qpid jar with all required jars in manifest
-QPID_LIBS=$QPID_HOME/lib/qpid-all.jar:$QPID_HOME/lib/qpid-junit-toolkit-$VERSION.jar:$QPID_HOME/lib/junit-3.8.1.jar:$QPID_HOME/lib/log4j-1.2.12.jar:$QPID_HOME/lib/qpid-perftests-$VERSION.jar:$QPID_HOME/lib/slf4j-log4j12-1.4.0.jar
+QPID_LIBS=$QPID_HOME/lib/qpid-all.jar:$QPID_HOME/lib/qpid-junit-toolkit-$VERSION.jar:$QPID_HOME/lib/junit-3.8.1.jar:$QPID_HOME/lib/log4j-1.2.12.jar:$QPID_HOME/lib/qpid-systests-$VERSION.jar:$QPID_HOME/lib/qpid-perftests-$VERSION.jar:$QPID_HOME/lib/slf4j-log4j12-1.4.0.jar
# Set other variables used by the qpid-run script before calling
export JAVA=java JAVA_MEM=-Xmx256m QPID_CLASSPATH=$QPID_LIBS
15 years, 2 months