r5351 - trunk/cumin/resources
by croberts@fedoraproject.org
Author: croberts
Date: 2012-04-27 16:46:08 +0000 (Fri, 27 Apr 2012)
New Revision: 5351
Modified:
trunk/cumin/resources/app.js
Log:
Eliminating a bit of code duplication.
Modified: trunk/cumin/resources/app.js
===================================================================
--- trunk/cumin/resources/app.js 2012-04-27 16:03:46 UTC (rev 5350)
+++ trunk/cumin/resources/app.js 2012-04-27 16:46:08 UTC (rev 5351)
@@ -484,10 +484,7 @@
chartParams = wooly.session.branch(jsonurl);
// for long-duration charts, updating is not particularly useful
if(chartParams.duration <= MAX_UPDATE_CHART_DURATION) {
- var jsonurl = $(id).getParent().getElements('a')[chart_href].get('href');
- var passback = "";
- allCharts['chartNowTime'] = new Date();
- wooly.setIntervalUpdate(jsonurl, stathandler, 0, passback, true);
+ drawSingleChart(id);
}
}
}
@@ -519,7 +516,7 @@
}
/*
- The parseJson function takes the output from cumin and massages it into// maybe there needs to be updatesinglechart that will check duration, etc
+ The parseJson function takes the output from cumin and massages it into
something that is useful for the charting library in use (currently jqplot).
It is most definitely easier to tweak this function as needed than it is to
make significant (and possibly temporary) adjustments to the cumin output
12 years
r5350 - trunk/cumin/resources
by croberts@fedoraproject.org
Author: croberts
Date: 2012-04-27 16:03:46 +0000 (Fri, 27 Apr 2012)
New Revision: 5350
Modified:
trunk/cumin/resources/app.js
Log:
Removed extraneous code block.
Modified: trunk/cumin/resources/app.js
===================================================================
--- trunk/cumin/resources/app.js 2012-04-27 15:59:46 UTC (rev 5349)
+++ trunk/cumin/resources/app.js 2012-04-27 16:03:46 UTC (rev 5350)
@@ -489,7 +489,7 @@
allCharts['chartNowTime'] = new Date();
wooly.setIntervalUpdate(jsonurl, stathandler, 0, passback, true);
}
- }3600
+ }
}
/*
12 years
r5349 - trunk/cumin/resources
by croberts@fedoraproject.org
Author: croberts
Date: 2012-04-27 15:59:46 +0000 (Fri, 27 Apr 2012)
New Revision: 5349
Modified:
trunk/cumin/resources/app.js
Log:
Cleaning-up some commented-out code and a few changes for code readability.
Modified: trunk/cumin/resources/app.js
===================================================================
--- trunk/cumin/resources/app.js 2012-04-27 15:44:40 UTC (rev 5348)
+++ trunk/cumin/resources/app.js 2012-04-27 15:59:46 UTC (rev 5349)
@@ -427,11 +427,15 @@
return false;
}
-
+var ONE_MINUTE = 60;
+var TEN_MINUTES = 600;
var ONE_HOUR = 3600;
var ONE_DAY = 86400;
var ONE_MONTH = 2592000;
+var ONE_YEAR = 31557600;
var MAX_UPDATE_CHART_DURATION = ONE_DAY;
+
+var CHART_UPDATE_INTERVAL_MS = 10000;
/*
This block of code sets up the allCharts object which is where all of the
charts will be stored. If a given chart already exists in the allCharts
@@ -485,20 +489,20 @@
allCharts['chartNowTime'] = new Date();
wooly.setIntervalUpdate(jsonurl, stathandler, 0, passback, true);
}
- }
+ }3600
}
/*
This function sets up the timer that will trigger the updating of each chart
*/
startChartMonitor = function(id) {
- allCharts[id].intervalId = setInterval(function() {updateSingleChart(id)}, 10000); // maybe there needs to be updatesinglechart that will check duration, etc
+ allCharts[id].intervalId = setInterval(function() {updateSingleChart(id)}, CHART_UPDATE_INTERVAL_MS);
}
/*
This function is meant to take the JSON response from cumin and do some basic work on it (determine max/min).
A lot of the dirtier work is done in the parseJson function.
- After getting the data into the dataContainer object, the drawChart function is called
+ After getting the data into the dataContainer object, the drawChart funct// maybe there needs to be updatesinglechart that will check duration, etcion is called
*/
stathandler = function(response) {
try {
@@ -515,7 +519,7 @@
}
/*
- The parseJson function takes the output from cumin and massages it into
+ The parseJson function takes the output from cumin and massages it into// maybe there needs to be updatesinglechart that will check duration, etc
something that is useful for the charting library in use (currently jqplot).
It is most definitely easier to tweak this function as needed than it is to
make significant (and possibly temporary) adjustments to the cumin output
@@ -528,24 +532,24 @@
dataContainer['duration'] = json['duration'];
switch(json['duration']) {
- case 600:
- dataContainer['x_axis_normalizer'] = 60;
+ case TEN_MINUTES:
+ dataContainer['x_axis_normalizer'] = ONE_MINUTE;
dataContainer['x_axis_unit_label'] = "min";
break;
- case 3600:
- dataContainer['x_axis_normalizer'] = 60;
+ case ONE_HOUR:
+ dataContainer['x_axis_normalizer'] = ONE_MINUTE;
dataContainer['x_axis_unit_label'] = "min";
break;
- case 86400:
- dataContainer['x_axis_normalizer'] = 3600;
+ case ONE_DAY:
+ dataContainer['x_axis_normalizer'] = ONE_HOUR;
dataContainer['x_axis_unit_label'] = "hr";
break;
- case 2592000:
- dataContainer['x_axis_normalizer'] = 86400;
+ case ONE_MONTH:
+ dataContainer['x_axis_normalizer'] = ONE_DAY;
dataContainer['x_axis_unit_label'] = "day";
break;
- case 31557600:
- dataContainer['x_axis_normalizer'] = 2592000;
+ case ONE_YEAR:
+ dataContainer['x_axis_normalizer'] = ONE_MONTH;
dataContainer['x_axis_unit_label'] = "mo";
break;
}
@@ -561,7 +565,6 @@
for ( var j = 0; j < json.elements[i].values.length; j++) {
dataContainer['x_coordinate_values'][i]
.append([ json.elements[i].values[j].dt / dataContainer['x_axis_normalizer'] ]);
- //console.log("X-coordinate value of: " + json.elements[i].values[j].dt + " going to divide by " + dataContainer['x_axis_normalizer']);
}
}
@@ -584,11 +587,6 @@
dataContainer['x_axis_values'] = dataContainer['x_axis_values']
.append([ json.x_axis.labels.labels[i].text ]);
}
-
-// console.log("end_secs: " + dataContainer['end_secs'] + " tnow: " + dataContainer['tnow']);
-// console.log("x-axis vals: " + dataContainer['x_axis_values']);
-// console.log("x_coord_vals: " + dataContainer['x_coordinate_values']);
-// console.log("y_coord_vals: " + dataContainer['y_coordinate_values']);
return dataContainer;
}
@@ -727,9 +725,6 @@
// when called to render a popup tooltip, the caller is named "g"...not sure why. Whattup, g?
if(arguments.callee.caller.getName() == 'g') {
var tempTime = allCharts['chartNowTime'].clone();
- //console.log("Using tempTime (chartNowTime) of: " + tempTime);
- //console.log("Input offset timestamp of: "+ val);
- //console.log("Subtract offset in months from temptime: " + tempTime.increment('month', val));
timeFormat = "%b %e, %T";
if(format.search(/min/) > -1) {
modifier = 60 * val;
12 years
r5348 - trunk/cumin/resources
by croberts@fedoraproject.org
Author: croberts
Date: 2012-04-27 15:44:40 +0000 (Fri, 27 Apr 2012)
New Revision: 5348
Modified:
trunk/cumin/resources/app.js
Log:
Turning off automatic updates for charts where the duration is greater than 1 day. The updates are unnecessary when looking at very long durations.
Modified: trunk/cumin/resources/app.js
===================================================================
--- trunk/cumin/resources/app.js 2012-04-25 16:45:29 UTC (rev 5347)
+++ trunk/cumin/resources/app.js 2012-04-27 15:44:40 UTC (rev 5348)
@@ -427,6 +427,11 @@
return false;
}
+
+var ONE_HOUR = 3600;
+var ONE_DAY = 86400;
+var ONE_MONTH = 2592000;
+var MAX_UPDATE_CHART_DURATION = ONE_DAY;
/*
This block of code sets up the allCharts object which is where all of the
charts will be stored. If a given chart already exists in the allCharts
@@ -457,12 +462,29 @@
function after that data is fetched
*/
drawSingleChart = function(id) {
+ var jsonurl = $(id).getParent().getElements('a')[chart_href].get('href');
+ var passback = "";
+ allCharts['chartNowTime'] = new Date();
+ wooly.setIntervalUpdate(jsonurl, stathandler, 0, passback, true);
+}
+
+/*
+ * This function handles the automatic updates for each chart. Updates will only happen
+ * for charts that have a duration <= MAX_UPDATE_CHART_DURATION (1 day). Updates will also only happen
+ * when the "resume updates" button is not showing.
+ */
+updateSingleChart = function(id) {
// if the "resume updates" is displayed, we don't want to do updates.
if($('shock').style.display != "undefined" && $('shock').style.display != "block") {
var jsonurl = $(id).getParent().getElements('a')[chart_href].get('href');
- var passback = "";
- allCharts['chartNowTime'] = new Date();
- wooly.setIntervalUpdate(jsonurl, stathandler, 0, passback, true);
+ chartParams = wooly.session.branch(jsonurl);
+ // for long-duration charts, updating is not particularly useful
+ if(chartParams.duration <= MAX_UPDATE_CHART_DURATION) {
+ var jsonurl = $(id).getParent().getElements('a')[chart_href].get('href');
+ var passback = "";
+ allCharts['chartNowTime'] = new Date();
+ wooly.setIntervalUpdate(jsonurl, stathandler, 0, passback, true);
+ }
}
}
@@ -470,7 +492,7 @@
This function sets up the timer that will trigger the updating of each chart
*/
startChartMonitor = function(id) {
- setInterval(function() {drawSingleChart(id)}, 10000);
+ allCharts[id].intervalId = setInterval(function() {updateSingleChart(id)}, 10000); // maybe there needs to be updatesinglechart that will check duration, etc
}
/*
@@ -492,7 +514,6 @@
return true;
}
-
/*
The parseJson function takes the output from cumin and massages it into
something that is useful for the charting library in use (currently jqplot).
12 years
r5347 - trunk/wooly/python/wooly
by croberts@fedoraproject.org
Author: croberts
Date: 2012-04-25 16:45:29 +0000 (Wed, 25 Apr 2012)
New Revision: 5347
Modified:
trunk/wooly/python/wooly/table.py
trunk/wooly/python/wooly/table.strings
Log:
BZ 802698. Now respecting the max-qmf-table-sort config parameter by making all column headers static for tables that have > max-qmf-table-sort rows.
Modified: trunk/wooly/python/wooly/table.py
===================================================================
--- trunk/wooly/python/wooly/table.py 2012-04-24 15:50:15 UTC (rev 5346)
+++ trunk/wooly/python/wooly/table.py 2012-04-25 16:45:29 UTC (rev 5347)
@@ -214,7 +214,7 @@
self.static_tmpl = WidgetTemplate(self, "static_html")
def do_render(self, session, *args):
- if self.parent.static_header:
+ if self.parent.static_header or self.table.count.get(session) > self.app.max_qmf_table_sort:
writer = Writer()
self.static_tmpl.render(writer, session)
return writer.to_string()
Modified: trunk/wooly/python/wooly/table.strings
===================================================================
--- trunk/wooly/python/wooly/table.strings 2012-04-24 15:50:15 UTC (rev 5346)
+++ trunk/wooly/python/wooly/table.strings 2012-04-25 16:45:29 UTC (rev 5347)
@@ -92,6 +92,11 @@
};
}())
+[CheckboxColumnHeader.static_html]
+<th class="{class}"><input id="{id}" type="checkbox"
+ onclick="wooly.clickTableCheckboxes(this, '{name}')"
+/></th>
+
[CheckboxColumnHeader.html]
<th class="{class}"><input id="{id}" type="checkbox"
onclick="wooly.clickTableCheckboxes(this, '{name}')"
12 years
r5346 - in trunk/cumin/python/cumin: . grid
by croberts@fedoraproject.org
Author: croberts
Date: 2012-04-24 15:50:15 +0000 (Tue, 24 Apr 2012)
New Revision: 5346
Modified:
trunk/cumin/python/cumin/grid/dashboard.py
trunk/cumin/python/cumin/stat.py
Log:
Additional tweaks to use the on-the-fly computed interval and setting max_samples to 250 for the utilization chart.
Modified: trunk/cumin/python/cumin/grid/dashboard.py
===================================================================
--- trunk/cumin/python/cumin/grid/dashboard.py 2012-04-24 15:27:23 UTC (rev 5345)
+++ trunk/cumin/python/cumin/grid/dashboard.py 2012-04-24 15:50:15 UTC (rev 5346)
@@ -96,7 +96,7 @@
chart = self.UtilChart(app, "util", app.model.com_redhat_grid_plumage.OSUtil)
chart.stats = ["total", "unused", "owner", "used"]
- chart.max_samples = 200
+ chart.max_samples = 250
chart.duration.param.default = "3600"
self.add_child(chart)
Modified: trunk/cumin/python/cumin/stat.py
===================================================================
--- trunk/cumin/python/cumin/stat.py 2012-04-24 15:27:23 UTC (rev 5345)
+++ trunk/cumin/python/cumin/stat.py 2012-04-24 15:50:15 UTC (rev 5346)
@@ -209,7 +209,7 @@
self.cls = cls
self.duration.add_state("2592000", "1 month")
self.duration.add_state("31557600", "1 year")
- self.max_samples = 100
+ self.max_samples = 0
def get_href_params(self, session):
params = list()
@@ -226,7 +226,6 @@
if self.mode:
params.append("mode=%s" % self.mode)
- params.append("interval=60") #may need to experiment on computing this on the fly or use a value that matches the plumage sample rate
params.append("maxsamp=%s" % self.max_samples)
return params
12 years
r5345 - in trunk/cumin/python/cumin: . grid
by croberts@fedoraproject.org
Author: croberts
Date: 2012-04-24 15:27:23 +0000 (Tue, 24 Apr 2012)
New Revision: 5345
Modified:
trunk/cumin/python/cumin/grid/dashboard.py
trunk/cumin/python/cumin/model.py
trunk/cumin/python/cumin/stat.py
Log:
Implementing a way to limit the clutter that can happen for long-duration charts.
Modified: trunk/cumin/python/cumin/grid/dashboard.py
===================================================================
--- trunk/cumin/python/cumin/grid/dashboard.py 2012-04-24 14:59:24 UTC (rev 5344)
+++ trunk/cumin/python/cumin/grid/dashboard.py 2012-04-24 15:27:23 UTC (rev 5345)
@@ -96,6 +96,7 @@
chart = self.UtilChart(app, "util", app.model.com_redhat_grid_plumage.OSUtil)
chart.stats = ["total", "unused", "owner", "used"]
+ chart.max_samples = 200
chart.duration.param.default = "3600"
self.add_child(chart)
Modified: trunk/cumin/python/cumin/model.py
===================================================================
--- trunk/cumin/python/cumin/model.py 2012-04-24 14:59:24 UTC (rev 5344)
+++ trunk/cumin/python/cumin/model.py 2012-04-24 15:27:23 UTC (rev 5345)
@@ -318,7 +318,7 @@
return retval
class SamplesSqlAdapter(SqlAdapter):
- def __init__(self, app, cls, sig):
+ def __init__(self, app, cls, sig, session):
super(SamplesSqlAdapter, self).__init__(app, cls.sql_samples_table)
filters = cls.get_sample_filters_by_signature(sig)
@@ -326,6 +326,8 @@
self.query.add_filter(f)
self.update_col = cls.get_timestamp_col()
+
+ self.session = session
def get_sql_options(self, options):
return options
@@ -365,6 +367,16 @@
# reset the filters in case we need to re-run the query in this same request
del self.query.filters[:]
self.query.filters = org_filters
+
+ #Too many samples will result in a horribly cluttered chart, lets max_samples (parameter)
+ max_samples = self.session.get("maxsamp")
+
+ reduced_samples = None
+ if max_samples is not None and max_samples > 0 and len(samples) > max_samples:
+ reduced_interval = int(len(samples) / max_samples)
+ # show every N samples + we always want the first and last
+ reduced_samples = [sample for i, sample in enumerate(samples) if i % reduced_interval == 0 or i == 0 or i == len(samples) -1]
+ samples = reduced_samples
return samples
Modified: trunk/cumin/python/cumin/stat.py
===================================================================
--- trunk/cumin/python/cumin/stat.py 2012-04-24 14:59:24 UTC (rev 5344)
+++ trunk/cumin/python/cumin/stat.py 2012-04-24 15:27:23 UTC (rev 5345)
@@ -209,6 +209,7 @@
self.cls = cls
self.duration.add_state("2592000", "1 month")
self.duration.add_state("31557600", "1 year")
+ self.max_samples = 100
def get_href_params(self, session):
params = list()
@@ -225,7 +226,8 @@
if self.mode:
params.append("mode=%s" % self.mode)
- params.append("interval=60") #may need to experiment on computing this on the fly or use a value that matches the plumage sample rate
+ params.append("interval=60") #may need to experiment on computing this on the fly or use a value that matches the plumage sample rate
+ params.append("maxsamp=%s" % self.max_samples)
return params
@@ -441,6 +443,10 @@
self.type = Parameter(app, "type")
self.add_parameter(self.type)
+
+ self.maxsamp = IntegerParameter(app, "maxsamp")
+ self.maxsamp.default = 0
+ self.add_parameter(self.maxsamp)
self.cache = ImageCache()
@@ -467,7 +473,7 @@
signature = self.object_signature.get(session)
- adapter = SamplesSqlAdapter(self.app, rosemary_class, signature)
+ adapter = SamplesSqlAdapter(self.app, rosemary_class, signature, session)
stats = [getattr(rosemary_class, x) for x in self.stats.get(session)]
return (adapter, stats)
12 years
r5344 - trunk/cumin/python/cumin
by croberts@fedoraproject.org
Author: croberts
Date: 2012-04-24 14:59:24 +0000 (Tue, 24 Apr 2012)
New Revision: 5344
Modified:
trunk/cumin/python/cumin/widgets.py
Log:
Updating the supported browser list per BZ 768298
Modified: trunk/cumin/python/cumin/widgets.py
===================================================================
--- trunk/cumin/python/cumin/widgets.py 2012-04-23 20:41:09 UTC (rev 5343)
+++ trunk/cumin/python/cumin/widgets.py 2012-04-24 14:59:24 UTC (rev 5344)
@@ -1687,10 +1687,9 @@
def __init__(self, app, name):
super(AboutSupportedBrowsers, self).__init__(app, name)
- self.browsers = ["Firefox 3.6+", \
- "Internet Explorer 7+", \
- "Chrome 5.0+", \
- "Safari 5+"]
+ self.browsers = ["Firefox 10", \
+ "Internet Explorer 8", \
+ "Safari 5"]
def render_browser_list(self, session):
browser_list_items = ""
12 years
r5343 - trunk/mint/python/mint
by tmckay@fedoraproject.org
Author: tmckay
Date: 2012-04-23 20:41:09 +0000 (Mon, 23 Apr 2012)
New Revision: 5343
Modified:
trunk/mint/python/mint/expire.py
Log:
Fix typo in expiration thread.
Modified: trunk/mint/python/mint/expire.py
===================================================================
--- trunk/mint/python/mint/expire.py 2012-04-23 18:06:48 UTC (rev 5342)
+++ trunk/mint/python/mint/expire.py 2012-04-23 20:41:09 UTC (rev 5343)
@@ -51,7 +51,7 @@
# For timestamp persistent classes, we get rid of the
# objects in additoin to the samples
if hasattr(cls, "sql_timestamp_delete") and \
- cls.sql_timestamp.delete is not None:
+ cls.sql_timestamp_delete is not None:
cls.sql_timestamp_delete.execute(cursor, values)
log.debug("Deleted %i objects %s", cursor.rowcount, cls)
count += cursor.rowcount
12 years
r5342 - trunk/cumin/python/cumin
by tmckay@fedoraproject.org
Author: tmckay
Date: 2012-04-23 18:06:48 +0000 (Mon, 23 Apr 2012)
New Revision: 5342
Modified:
trunk/cumin/python/cumin/authenticator.py
Log:
Correctly handle non-existent user with no external authentication defined.
BZ815316
Modified: trunk/cumin/python/cumin/authenticator.py
===================================================================
--- trunk/cumin/python/cumin/authenticator.py 2012-04-23 16:34:12 UTC (rev 5341)
+++ trunk/cumin/python/cumin/authenticator.py 2012-04-23 18:06:48 UTC (rev 5342)
@@ -328,6 +328,7 @@
cls = self.app.model.com_redhat_cumin.User
user = cls.get_object(cursor, name=username)
if user is None or len(user.password) == 0:
+ res = False
log.debug("Authenticator: authenticating external user")
for authenticator in self.authenticators:
log.debug("Authenticator: authenticate, try %s", authenticator)
12 years