r5557 - in trunk/cumin: python/cumin resources
by croberts@fedoraproject.org
Author: croberts
Date: 2012-11-30 19:15:55 +0000 (Fri, 30 Nov 2012)
New Revision: 5557
Modified:
trunk/cumin/python/cumin/stat.py
trunk/cumin/resources/app.js
Log:
BZ 880675: Fixing charts for older versions of python. Older version of python would put True/False in the charts json output which isn't ideal for JavaScript to pickup. Our solution is to send 0/1 in the output which will be interpreted by the JS as false/true. This will work for all supported systems.
Modified: trunk/cumin/python/cumin/stat.py
===================================================================
--- trunk/cumin/python/cumin/stat.py 2012-11-30 16:14:16 UTC (rev 5556)
+++ trunk/cumin/python/cumin/stat.py 2012-11-30 19:15:55 UTC (rev 5557)
@@ -922,7 +922,11 @@
chart = self.get_chart(session, adapter, stats, samples, time_span, max_value, min_value, append, end_seconds_ago)
#print "**********\n"+chart.create()
chart.graph_div = "%s_chart" % chart.id.replace(".", "_")
- chart.stackSeries = self.stackSeries
+ # doing this the ugly way for python 2.4
+ if self.stackSeries == True:
+ chart.stackSeries = 1
+ else:
+ chart.stackSeries = 0
return chart.create()
def get_y_labels(self, absy, intervals, step):
Modified: trunk/cumin/resources/app.js
===================================================================
--- trunk/cumin/resources/app.js 2012-11-30 16:14:16 UTC (rev 5556)
+++ trunk/cumin/resources/app.js 2012-11-30 19:15:55 UTC (rev 5557)
@@ -587,7 +587,7 @@
dataContainer['x_axis_values'] = dataContainer['x_axis_values']
.append([ json.x_axis.labels.labels[i].text ]);
}
- dataContainer['stackSeries'] = json.stackSeries;
+ dataContainer['stackSeries'] = json.stackSeries == 1 ? true:false;
return dataContainer;
}
11 years, 5 months
r5556 - trunk/cumin/python/cumin
by croberts@fedoraproject.org
Author: croberts
Date: 2012-11-30 16:14:16 +0000 (Fri, 30 Nov 2012)
New Revision: 5556
Modified:
trunk/cumin/python/cumin/objectselector.py
Log:
Fix for BZ:879263 We are now xml_escaping the search string when presenting the yellow notification box message that the input could not be parsed. Previously, the text was rendered without xml-escaping which could allow injected script tags to have their code executed.
Modified: trunk/cumin/python/cumin/objectselector.py
===================================================================
--- trunk/cumin/python/cumin/objectselector.py 2012-11-29 17:23:56 UTC (rev 5555)
+++ trunk/cumin/python/cumin/objectselector.py 2012-11-30 16:14:16 UTC (rev 5556)
@@ -391,20 +391,20 @@
searchvalue = parse_date_from_string(customvalue)
except Exception, e:
self.error_in_query = True
- session.add_unique_notice(Notice("Error parsing valid timestamp from '%s', search results not updated" % customvalue, preamble=""))
+ session.add_unique_notice(Notice("Error parsing valid timestamp from '%s', search results not updated" % xml_escape(customvalue), preamble=""))
if sql_column.type.literal == "int8":
if sql_column.name in self.special_columns:
try:
searchvalue = fmt_ddhhmm_timestamp(customvalue)
except:
self.error_in_query = True
- session.add_unique_notice(Notice("Error parsing valid dd:hh:mm from '%s', search results not updated" % customvalue, preamble=""))
+ session.add_unique_notice(Notice("Error parsing valid dd:hh:mm from '%s', search results not updated" % xml_escape(customvalue), preamble=""))
else:
try:
int(customvalue)
except:
self.error_in_query = True
- session.add_unique_notice(Notice("Error parsing valid integer from '%s', search results not updated" % customvalue, preamble=""))
+ session.add_unique_notice(Notice("Error parsing valid integer from '%s', search results not updated" % xml_escape(customvalue), preamble=""))
def get_data_values(self, session):
11 years, 5 months
r5555 - branches/croberts/cumin/python/cumin/grid
by croberts@fedoraproject.org
Author: croberts
Date: 2012-11-29 17:23:56 +0000 (Thu, 29 Nov 2012)
New Revision: 5555
Modified:
branches/croberts/cumin/python/cumin/grid/dashboard.py
Log:
Changed size of accounting group use chart.
Modified: branches/croberts/cumin/python/cumin/grid/dashboard.py
===================================================================
--- branches/croberts/cumin/python/cumin/grid/dashboard.py 2012-11-26 21:48:16 UTC (rev 5554)
+++ branches/croberts/cumin/python/cumin/grid/dashboard.py 2012-11-29 17:23:56 UTC (rev 5555)
@@ -52,41 +52,10 @@
charts = WidgetSet(app, "charts")
self.add_child(charts)
-
-# chart = self.PoolEfficiencyChart(app, "eff", app.model.com_redhat_grid_plumage.OSUtil)
-# chart.stats = ["efficiency"]
-# chart.max_samples = 250
-# chart.duration.param.default = "86400"
-# charts.add_child(chart)
-#
-# chart = self.PoolMemoryChart(app, "fmem", app.model.com_redhat_grid_plumage.OSUtil)
-# chart.stats = ["usedmem", "freemem"]
-# chart.max_samples = 250
-# chart.duration.param.default = "86400"
-# chart.chart_type = "stacked"
-# charts.add_child(chart)
-#
-# chart = self.PoolCpuChart(app, "fcpu", app.model.com_redhat_grid_plumage.OSUtil)
-# chart.stats = [ "usedcpu", "freecpu"]
-# chart.max_samples = 250
-# chart.duration.param.default = "86400"
-# chart.chart_type = "stacked"
-# charts.add_child(chart)
-
-# chart = self.UserUsageChart(app, "useruse", app.model.com_redhat_grid_plumage.Accountant)
-# chart.stats = ["resused"]
-# chart.max_samples = 250
-# filter = ReportingChart.FilterInput(app, "namefilter", app.model.com_redhat_grid_plumage.Accountant, app.model.com_redhat_grid_plumage.Accountant.user.name, "userc", "Filter user")
-# chart.filters.append(filter)
-# chart.add_child(filter)
-# chart.duration.param.default= "86400"
-# charts.add_child(chart)
-
+
chartholder = AccountingChartWidget(app, "accchart")
charts.add_child(chartholder)
-
-
def render_title(self, session):
return "Accounting"
@@ -118,8 +87,8 @@
chart.chart_type = "genusechart"
chart.duration.param.default = "86400"
chart.leftlegend = False
- chart.height = 150
- chart.width = 400
+ chart.height = 165
+ chart.width = 440
self.add_child(chart)
class AccountingChartControl(Widget):
11 years, 5 months
r5554 - trunk/cumin/python/cumin/messaging
by eallen@fedoraproject.org
Author: eallen
Date: 2012-11-26 21:48:16 +0000 (Mon, 26 Nov 2012)
New Revision: 5554
Modified:
trunk/cumin/python/cumin/messaging/queue.py
Log:
Bug 872218 - Messaging:Queue:Journal key error. Fix for queue journal stats list.
Modified: trunk/cumin/python/cumin/messaging/queue.py
===================================================================
--- trunk/cumin/python/cumin/messaging/queue.py 2012-11-20 17:44:29 UTC (rev 5553)
+++ trunk/cumin/python/cumin/messaging/queue.py 2012-11-26 21:48:16 UTC (rev 5554)
@@ -493,7 +493,7 @@
self.add_attribute(self.journal)
self.attrs = ("initialFileCount", "dataFileSize",
- "recordDepth", "recordEnqueues",
+ "recordDepth", "enqueues",
"outstandingAIOs", "freeFileCount",
"availableFileCount", "writeWaitFailures",
"writeBusyFailures", "readRecordCount",
@@ -505,11 +505,10 @@
queue = self.widget.object.get(session)
cls = self.app.model.com_redhat_rhm_store.Journal
- journals = cls.get_selection(session.cursor,
+ journal = cls.get_object(session.cursor,
_queueRef_id=queue._id)
+ return journal
- return len(journals)
-
def render_title(self, session):
return "Journal"
@@ -521,6 +520,25 @@
else:
return "<div class=\"iblock\">%s</div>" % fmt_none()
+ def do_get_items(self, session):
+ """ override do_get_items since the object is actually the journal attr
+ and the attr list is mixed stats and props """
+
+ object = self.journal.get(session)
+ if not object:
+ return []
+
+ stats = list()
+ for field in self.get_fields(session):
+ # Some of the entries in the attrs list are properties and not statistics
+ if field in object._class._statistics_by_name:
+ cls = object._class._statistics_by_name[field]
+ else:
+ cls = object._class._properties_by_name[field]
+
+ stats.append((cls, getattr(object, cls.name, None)))
+ return stats
+
class QueueTxnStatSet(StatSet):
def __init__(self, app, name, queue):
super(QueueTxnStatSet, self).__init__(app, name, queue)
11 years, 5 months
r5553 - branches/croberts/cumin/python/cumin
by croberts@fedoraproject.org
Author: croberts
Date: 2012-11-20 17:44:29 +0000 (Tue, 20 Nov 2012)
New Revision: 5553
Modified:
branches/croberts/cumin/python/cumin/stat.py
Log:
Another set of colors for the accounting chart.
Modified: branches/croberts/cumin/python/cumin/stat.py
===================================================================
--- branches/croberts/cumin/python/cumin/stat.py 2012-11-20 15:02:26 UTC (rev 5552)
+++ branches/croberts/cumin/python/cumin/stat.py 2012-11-20 17:44:29 UTC (rev 5553)
@@ -1182,10 +1182,14 @@
# "#5500FF","#5500AA","#550055","#55FF00","#55FFFF","#55FFAA","#55FF55","#55AA00","#55AAFF","#55AAAA","#55AA55","#555500",\
# "#5555FF","#5555AA","#555555")
- colors = ("#663300", "#336600", "#660000", "#e07000", "#660033", "#0052a3",\
- "#660066", "#000066", "#666600", "#006600", "#a35200",\
- "#006633", "#0070e0", "#006666", "#330066", "#003366",\
- "#e0e000", "#0000e0", "#663366", "#4d6633", "#334d66")
+# colors = ("#663300", "#336600", "#660000", "#e07000", "#660033", "#0052a3",\
+# "#660066", "#000066", "#666600", "#006600", "#a35200",\
+# "#006633", "#0070e0", "#006666", "#330066", "#003366",\
+# "#e0e000", "#0000e0", "#663366", "#4d6633", "#334d66")
+
+ colors = ("#7eb5d6", "#ad7460", "#397249", "#88382d", "#628b61", "#644436",\
+ "#2a75a9", "#dfc184", "#a84a5c", "#9cb770", "#ec633f", "#2f2f2f",\
+ "#274257", "#8f6048", "#d6a354", "#ccb647", "#f9d654", "#4d4e24")
def __init__(self, app, name, page):
super(GeneralUseChart, self).__init__(app, name, page)
11 years, 5 months
r5552 - branches/croberts/cumin/python/cumin
by croberts@fedoraproject.org
Author: croberts
Date: 2012-11-20 15:02:26 +0000 (Tue, 20 Nov 2012)
New Revision: 5552
Modified:
branches/croberts/cumin/python/cumin/stat.py
Log:
Changing color palette for accounting group chart.
Modified: branches/croberts/cumin/python/cumin/stat.py
===================================================================
--- branches/croberts/cumin/python/cumin/stat.py 2012-11-19 22:07:45 UTC (rev 5551)
+++ branches/croberts/cumin/python/cumin/stat.py 2012-11-20 15:02:26 UTC (rev 5552)
@@ -1175,13 +1175,18 @@
# '#0000ff', '#00ff00', '#00ffff', '#ff00ff', '#000000', '#666600', \
# '#6633cc', '#33ccb3', '#cc6633', '#4dcc33', '#cc334d')
- colors = ("#0000FF","#00FF00","#00FFFF","#FF0000","#FF00FF","#FFFF00","#0000AA","#00FFAA","#00AA00","#00AAFF","#00AAAA",\
- "#FF00AA","#FFFFAA","#FFAA00","#FFAAFF","#FFAAAA","#AA0000","#AA00FF","#AA00AA","#AAFF00","#AAFFFF","#AAFFAA","#AAAA00",\
- "#AAAAFF","#AAAAAA","#000055","#00FF55","#00AA55","#005500","#0055FF","#0055AA","#005555","#FF0055","#FFFF55","#FFAA55",\
- "#FF5500","#FF55FF","#FF55AA","#FF5555","#AA0055","#AAFF55","#AAAA55","#AA5500","#AA55FF","#AA55AA","#AA5555","#550000",\
- "#5500FF","#5500AA","#550055","#55FF00","#55FFFF","#55FFAA","#55FF55","#55AA00","#55AAFF","#55AAAA","#55AA55","#555500",\
- "#5555FF","#5555AA","#555555")
+# colors = ("#0000FF","#00FF00","#00FFFF","#FF0000","#FF00FF","#FFFF00","#0000AA","#00FFAA","#00AA00","#00AAFF","#00AAAA",\
+# "#FF00AA","#FFFFAA","#FFAA00","#FFAAFF","#FFAAAA","#AA0000","#AA00FF","#AA00AA","#AAFF00","#AAFFFF","#AAFFAA","#AAAA00",\
+# "#AAAAFF","#AAAAAA","#000055","#00FF55","#00AA55","#005500","#0055FF","#0055AA","#005555","#FF0055","#FFFF55","#FFAA55",\
+# "#FF5500","#FF55FF","#FF55AA","#FF5555","#AA0055","#AAFF55","#AAAA55","#AA5500","#AA55FF","#AA55AA","#AA5555","#550000",\
+# "#5500FF","#5500AA","#550055","#55FF00","#55FFFF","#55FFAA","#55FF55","#55AA00","#55AAFF","#55AAAA","#55AA55","#555500",\
+# "#5555FF","#5555AA","#555555")
+ colors = ("#663300", "#336600", "#660000", "#e07000", "#660033", "#0052a3",\
+ "#660066", "#000066", "#666600", "#006600", "#a35200",\
+ "#006633", "#0070e0", "#006666", "#330066", "#003366",\
+ "#e0e000", "#0000e0", "#663366", "#4d6633", "#334d66")
+
def __init__(self, app, name, page):
super(GeneralUseChart, self).__init__(app, name, page)
self.stackSeries = True
11 years, 5 months
r5551 - branches/croberts/cumin/python/cumin
by croberts@fedoraproject.org
Author: croberts
Date: 2012-11-19 22:07:45 +0000 (Mon, 19 Nov 2012)
New Revision: 5551
Modified:
branches/croberts/cumin/python/cumin/stat.py
Log:
Cumin accounting group colors...now with more stability.
Modified: branches/croberts/cumin/python/cumin/stat.py
===================================================================
--- branches/croberts/cumin/python/cumin/stat.py 2012-11-19 20:40:36 UTC (rev 5550)
+++ branches/croberts/cumin/python/cumin/stat.py 2012-11-19 22:07:45 UTC (rev 5551)
@@ -1175,7 +1175,7 @@
# '#0000ff', '#00ff00', '#00ffff', '#ff00ff', '#000000', '#666600', \
# '#6633cc', '#33ccb3', '#cc6633', '#4dcc33', '#cc334d')
- colors = ("#0000FF","#00FF00","#00FFFF","#FF0000","#FF00FF","#FFFF00","#FFFFFF","#0000AA","#00FFAA","#00AA00","#00AAFF","#00AAAA",\
+ colors = ("#0000FF","#00FF00","#00FFFF","#FF0000","#FF00FF","#FFFF00","#0000AA","#00FFAA","#00AA00","#00AAFF","#00AAAA",\
"#FF00AA","#FFFFAA","#FFAA00","#FFAAFF","#FFAAAA","#AA0000","#AA00FF","#AA00AA","#AAFF00","#AAFFFF","#AAFFAA","#AAAA00",\
"#AAAAFF","#AAAAAA","#000055","#00FF55","#00AA55","#005500","#0055FF","#0055AA","#005555","#FF0055","#FFFF55","#FFAA55",\
"#FF5500","#FF55FF","#FF55AA","#FF5555","#AA0055","#AAFF55","#AAAA55","#AA5500","#AA55FF","#AA55AA","#AA5555","#550000",\
@@ -1240,8 +1240,9 @@
for i, group in enumerate(all_groups):
color_map[group] = self.colors[i]
- # For all displayed stats, pull the mapped color into the array
- for stat in sorted(samples):
+ # For all displayed stats, pull the mapped color into the array
+ sample_keys = samples.keys()
+ for stat in sorted(sample_keys):
colors.append(color_map[stat])
return colors
@@ -1278,13 +1279,11 @@
chart.elements = list()
self.fix_samples(samples)
- for stat, color in reversed(zip(samples, self.colors)):
+ for stat in sorted(samples):
line = Element()
line.type = line_type
- line.fill = color
line.fill_alpha = self.alpha
-
- line.colour = color
+
line.width = line_width
tip_title = stat
line.text = mode == "rate" and "%s / sec" % tip_title or self.get_line_title(stat)
11 years, 5 months
r5550 - branches/croberts/cumin/python/cumin
by croberts@fedoraproject.org
Author: croberts
Date: 2012-11-19 20:40:36 +0000 (Mon, 19 Nov 2012)
New Revision: 5550
Modified:
branches/croberts/cumin/python/cumin/stat.py
Log:
Attempt at stabilizing chart colors for dynamic hierarchical accounting groups.
Modified: branches/croberts/cumin/python/cumin/stat.py
===================================================================
--- branches/croberts/cumin/python/cumin/stat.py 2012-11-16 20:29:45 UTC (rev 5549)
+++ branches/croberts/cumin/python/cumin/stat.py 2012-11-19 20:40:36 UTC (rev 5550)
@@ -942,7 +942,7 @@
chart.graph_div = "%s_chart" % chart.id.replace(".", "_")
chart.stackSeries = self.stackSeries
chart.legendLocation = self.legendLocation
- chart.colors = self.colors
+ chart.colors = self.get_colors(samples)
chart.legendCols = self.legendCols
chart.fillAndStroke = self.fillAndStroke
chart.gridPadding = self.gridPadding
@@ -1164,13 +1164,24 @@
new_samples.append((dt, value, dev))
samples[stat] = new_samples
+ def get_colors(self, samples):
+ return self.colors
+
class ReportAreaChart(AreaChart):
pass
class GeneralUseChart(AreaChart):
- colors = ('#009926','#992600','#0036d6','#ffc414','730099','#ff00cc', '#ff0000', \
- '#0000ff', '#00ff00', '#00ffff', '#ff00ff', '#000000', '#666600', \
- '6633cc', '33ccb3', 'cc6633', '4dcc33', 'cc334d')
+# colors = ('#009926','#992600','#0036d6','#ffc414','#730099','#ff00cc', '#ff0000', \
+# '#0000ff', '#00ff00', '#00ffff', '#ff00ff', '#000000', '#666600', \
+# '#6633cc', '#33ccb3', '#cc6633', '#4dcc33', '#cc334d')
+
+ colors = ("#0000FF","#00FF00","#00FFFF","#FF0000","#FF00FF","#FFFF00","#FFFFFF","#0000AA","#00FFAA","#00AA00","#00AAFF","#00AAAA",\
+ "#FF00AA","#FFFFAA","#FFAA00","#FFAAFF","#FFAAAA","#AA0000","#AA00FF","#AA00AA","#AAFF00","#AAFFFF","#AAFFAA","#AAAA00",\
+ "#AAAAFF","#AAAAAA","#000055","#00FF55","#00AA55","#005500","#0055FF","#0055AA","#005555","#FF0055","#FFFF55","#FFAA55",\
+ "#FF5500","#FF55FF","#FF55AA","#FF5555","#AA0055","#AAFF55","#AAAA55","#AA5500","#AA55FF","#AA55AA","#AA5555","#550000",\
+ "#5500FF","#5500AA","#550055","#55FF00","#55FFFF","#55FFAA","#55FF55","#55AA00","#55AAFF","#55AAAA","#55AA55","#555500",\
+ "#5555FF","#5555AA","#555555")
+
def __init__(self, app, name, page):
super(GeneralUseChart, self).__init__(app, name, page)
self.stackSeries = True
@@ -1184,10 +1195,11 @@
def fetch_samples(self, session, adapter, dur, interval, method, mode, delta, stats, end_seconds_ago=0):
samples = dict()
-
+
groups_expanded = self.page.group_expand.get(session)
#use groups from url, if present, otherwise grab "all" form database
groups = groups_expanded if len(groups_expanded) > 0 else self.getTopLevelGroups(self.accGroups.execute(self.app.session).fetchall())
+ groups = sorted(groups)
for group in groups:
group_name = group if isinstance(group, unicode) or isinstance(group, str) else group[0]
result = self.accUse.execute(self.app.session, group_name, dur, interval).fetchall()
@@ -1199,12 +1211,50 @@
def getTopLevelGroups(self, groups):
topLevelGroups = []
for group in groups:
- group = group if isinstance(group, unicode) else group[0]
+ group = group if isinstance(group, unicode) or isinstance(group, str) else group[0]
split_name = group.split(".",1)
if split_name[0] not in topLevelGroups:
topLevelGroups.append(split_name[0])
return topLevelGroups
+
+ def get_colors(self, samples):
+ ''' takes the chart's default set of colors and maps them
+ to a stat name (group name) to provide persistent colors
+ in the resultant chart even when switching groups around
+ '''
+ colors = []
+ trees = {}
+ color_map = {}
+ all_groups = []
+
+ # figure out what all of our groups are
+ groups = self.accGroups.execute(self.app.session).fetchall()
+ groups = [g[0] for g in groups]
+ top_groups = self.getTopLevelGroups(groups)
+ for t_group in top_groups:
+ trees[t_group] = self.build_tree(groups, t_group)
+ self.flatten_tree(trees, all_groups)
+ all_groups = sorted(all_groups)
+
+ # create a designated color for each group
+ for i, group in enumerate(all_groups):
+ color_map[group] = self.colors[i]
+
+ # For all displayed stats, pull the mapped color into the array
+ for stat in sorted(samples):
+ colors.append(color_map[stat])
+
+ return colors
+ def flatten_tree(self, dictIn, listOut):
+ for key, value in dictIn.iteritems():
+ if isinstance(value, dict) and len(value) > 0: # If value itself is dictionary
+ if key not in listOut:
+ listOut.append(key)
+ self.flatten_tree(value, listOut)
+ else:
+ listOut.append(key)
+
def get_line_title(self, stat):
return stat.replace("<", "").replace(">", "")
@@ -1255,8 +1305,25 @@
break
vals.sort(key=lambda stat: stat["dt"], reverse=False) #here, we sort by dt to be sure that our graphs are valid
- return vals
+ return vals
+
+ def build_tree(self, nodes, topNode):
+ tree = {}
+ self.build_tree_recursive(tree, topNode, nodes)
+ return tree
+
+ def build_tree_recursive(self, tree, parent, nodes):
+ children = []
+ for n in nodes:
+ (nparent, sep, leaf) = n.rpartition(".")
+ if nparent == parent:
+ children.append(n)
+
+ for child in children:
+ tree[child] = {}
+ self.build_tree_recursive(tree[child], child, nodes)
+
class AccGroupUseSqlOperation(SqlOperation):
def __init__(self, app, chart):
super(GeneralUseChart.AccGroupUseSqlOperation, self).__init__(app)
11 years, 5 months
r5549 - in branches/croberts: cumin/resources wooly/resources
by croberts@fedoraproject.org
Author: croberts
Date: 2012-11-16 20:29:45 +0000 (Fri, 16 Nov 2012)
New Revision: 5549
Modified:
branches/croberts/cumin/resources/app.css
branches/croberts/wooly/resources/mootree.js
Log:
Additional style adjustments for accounting group usage tree. Also, fixing problem with tree where elements with no children were subject to being "closed" symantically (not visually) in the tree via a phantom open/close link.
Modified: branches/croberts/cumin/resources/app.css
===================================================================
--- branches/croberts/cumin/resources/app.css 2012-11-16 19:27:38 UTC (rev 5548)
+++ branches/croberts/cumin/resources/app.css 2012-11-16 20:29:45 UTC (rev 5549)
@@ -827,15 +827,14 @@
.mooTree_node {
- font-family: Verdana, Arial, Helvetica;
- font-size: 10px;
+ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-size: 12px;
white-space: nowrap;
}
.mooTree_text {
padding-top: 3px;
- height: 15px;
- cursor: pointer;
+ height: 15px;
}
.mooTree_img {
@@ -846,7 +845,5 @@
}
.mooTree_selected {
- background-color: #e0f0ff;
- font-weight: bold;
-}
+}
Modified: branches/croberts/wooly/resources/mootree.js
===================================================================
--- branches/croberts/wooly/resources/mootree.js 2012-11-16 19:27:38 UTC (rev 5548)
+++ branches/croberts/wooly/resources/mootree.js 2012-11-16 20:29:45 UTC (rev 5549)
@@ -40,6 +40,9 @@
rev.18:
- migrated to MooTools 1.2 (previous versions no longer supported)
+ rev.18.unofficial.1 (croberts)
+ - Added option for no folder display and short-circuited toggle action when a node has no children
+
*/
var MooTreeIcon = ['I','L','Lminus','Lplus','Rminus','Rplus','T','Tminus','Tplus','_closed','_doc','_open','minus','plus'];
@@ -577,7 +580,11 @@
*/
toggle: function(recursive, state) {
-
+ if (this.nodes.length == 0) {
+ // if there are no child nodes for the given node
+ // we just bail out since it doesn't make sense to toggle it
+ return;
+ }
this.open = (state === undefined ? !this.open : state);
this.update();
11 years, 5 months
r5548 - in branches/elephant/cumin: model python/cumin/grid-hadoop
by croberts@fedoraproject.org
Author: croberts
Date: 2012-11-16 19:27:38 +0000 (Fri, 16 Nov 2012)
New Revision: 5548
Modified:
branches/elephant/cumin/model/cumin.xml
branches/elephant/cumin/model/rosemary.xml
branches/elephant/cumin/python/cumin/grid-hadoop/hadoop.py
branches/elephant/cumin/python/cumin/grid-hadoop/main.py
Log:
Skeleton for jobtracker and tasktracker
Modified: branches/elephant/cumin/model/cumin.xml
===================================================================
--- branches/elephant/cumin/model/cumin.xml 2012-11-16 16:17:51 UTC (rev 5547)
+++ branches/elephant/cumin/model/cumin.xml 2012-11-16 19:27:38 UTC (rev 5548)
@@ -47,7 +47,6 @@
<package name="com.redhat.cumin.grid.hadoop">
<class name="NameNode" storage="none">
- <property name="Name" type="sstr"/>
<property name="ID" type="sstr"/>
<property name="Submitted" type="sstr"/>
<property name="Status" type="sstr"/>
@@ -56,7 +55,6 @@
<property name="Location" type="sstr"/>
</class>
<class name="DataNode" storage="none">
- <property name="Name" type="sstr"/>
<property name="ID" type="sstr"/>
<property name="Submitted" type="sstr"/>
<property name="Status" type="sstr"/>
@@ -65,10 +63,20 @@
<property name="NameNode" type="sstr"/>
</class>
<class name="TaskTracker" storage="none">
- <property name="Name" type="sstr"/>
+ <property name="ID" type="sstr"/>
+ <property name="Submitted" type="sstr"/>
+ <property name="Status" type="sstr"/>
+ <property name="Uptime" type="sstr"/>
+ <property name="Owner" type="sstr"/>
+ <property name="JobTracker" type="sstr"/>
</class>
<class name="JobTracker" storage="none">
- <property name="Name" type="sstr"/>
+ <property name="ID" type="sstr"/>
+ <property name="Submitted" type="sstr"/>
+ <property name="Status" type="sstr"/>
+ <property name="Uptime" type="sstr"/>
+ <property name="Owner" type="sstr"/>
+ <property name="Location" type="sstr"/>
</class>
</package>
</model>
Modified: branches/elephant/cumin/model/rosemary.xml
===================================================================
--- branches/elephant/cumin/model/rosemary.xml 2012-11-16 16:17:51 UTC (rev 5547)
+++ branches/elephant/cumin/model/rosemary.xml 2012-11-16 19:27:38 UTC (rev 5548)
@@ -37,9 +37,6 @@
<package name="com.redhat.cumin.grid.hadoop">
<class name="NameNode">
- <property name="Name">
- <title>Name</title>
- </property>
<property name="ID">
<title>Id</title>
</property>
@@ -61,9 +58,6 @@
</class>
<class name="DataNode">
- <property name="Name">
- <title>Name</title>
- </property>
<property name="ID">
<title>Id</title>
</property>
@@ -85,15 +79,45 @@
</class>
<class name="TaskTracker">
- <property name="Name">
- <title>Name</title>
+ <property name="ID">
+ <title>Id</title>
</property>
+ <property name="Submitted">
+ <title>Submitted</title>
+ </property>
+ <property name="Status">
+ <title>Status</title>
+ </property>
+ <property name="Uptime">
+ <title>Uptime</title>
+ </property>
+ <property name="Owner">
+ <title>Owner</title>
+ </property>
+ <property name="JobTracker">
+ <title>Job tracker</title>
+ </property>
</class>
<class name="JobTracker">
- <property name="Name">
- <title>Name</title>
+ <property name="ID">
+ <title>Id</title>
</property>
+ <property name="Submitted">
+ <title>Submitted</title>
+ </property>
+ <property name="Status">
+ <title>Status</title>
+ </property>
+ <property name="Uptime">
+ <title>Uptime</title>
+ </property>
+ <property name="Owner">
+ <title>Owner</title>
+ </property>
+ <property name="Location">
+ <title>Location</title>
+ </property>
</class>
</package>
Modified: branches/elephant/cumin/python/cumin/grid-hadoop/hadoop.py
===================================================================
--- branches/elephant/cumin/python/cumin/grid-hadoop/hadoop.py 2012-11-16 16:17:51 UTC (rev 5547)
+++ branches/elephant/cumin/python/cumin/grid-hadoop/hadoop.py 2012-11-16 19:27:38 UTC (rev 5548)
@@ -75,7 +75,7 @@
super(TaskTrackerSelector, self).__init__(app, name, cls)
- self.add_search_filter(self.table.name_col)
+ self.add_search_filter(self.table.jt_col)
self.table.adapter = HadoopAdapter(app, cls, None)
self.enable_csv_export()
@@ -96,7 +96,7 @@
super(JobTrackerSelector, self).__init__(app, name, cls)
- self.add_search_filter(self.table.name_col)
+ self.add_search_filter(self.table.loc_col)
self.table.adapter = HadoopAdapter(app, cls, None)
self.enable_csv_export()
@@ -134,7 +134,8 @@
"Uptime":"2+00:54:56", \
"Owner":"croberts", \
"Location":"http://mrg7.lab.bos.redhat.com:40222",\
- "NameNode":"796210 @ http://mrg16.lab.bos.redhat.com:50061"}, \
+ "NameNode":"796210 @ http://mrg16.lab.bos.redhat.com:50061",\
+ "JobTracker":"799639 @ http://mrg44.lab.bos.redhat.com:57339"}, \
"node2":{"Name":"node2.lab.bos.redhat.com",\
"ID":"56789", \
"Submitted":"11/15/2012", \
@@ -142,7 +143,8 @@
"Uptime":"1+00:24:56", \
"Owner":"croberts", \
"Location":"http://mrg8.lab.bos.redhat.com:40222",\
- "NameNode":"720565 @ http://mrg14.lab.bos.redhat.com:44594"}}
+ "NameNode":"720565 @ http://mrg14.lab.bos.redhat.com:44594",\
+ "JobTracker":"799639 @ http://mrg44.lab.bos.redhat.com:57339"}}
return results
@@ -161,6 +163,7 @@
super(NameNodeTable, self).__init__(app, name, cls)
self.loc_col = ObjectTableColumn(app, "loccol", cls.Location)
+ self.loc_col.width = "20%"
self.id_col = ObjectTableColumn(app, "idcol", cls.ID)
self.sub_col = ObjectTableColumn(app, "sub", cls.Submitted)
self.status_col = ObjectTableColumn(app, "statuscol", cls.Status)
@@ -174,12 +177,7 @@
self.add_column(self.uptime_col)
self.add_column(self.owner_col)
-
- class NameColumn(ObjectTableColumn):
- def render_text_align(self, session):
- return "left"
-
class DataNodeTable(ObjectQmfTable):
def __init__(self, app, name, cls):
super(DataNodeTable, self).__init__(app, name, cls)
@@ -199,29 +197,43 @@
self.add_column(self.uptime_col)
self.add_column(self.owner_col)
-
- class NameColumn(ObjectTableColumn):
- def render_text_align(self, session):
- return "left"
class TaskTrackerTable(ObjectQmfTable):
def __init__(self, app, name, cls):
super(TaskTrackerTable, self).__init__(app, name, cls)
- self.name_col = self.NameColumn(app, "name", cls.Name)
- self.add_column(self.name_col)
-
- class NameColumn(ObjectTableColumn):
- def render_text_align(self, session):
- return "left"
+ self.jt_col = ObjectTableColumn(app, "jtcol", cls.JobTracker)
+ self.jt_col.width="20%"
+ self.id_col = ObjectTableColumn(app, "idcol", cls.ID)
+ self.sub_col = ObjectTableColumn(app, "sub", cls.Submitted)
+ self.status_col = ObjectTableColumn(app, "statuscol", cls.Status)
+ self.uptime_col = ObjectTableColumn(app, "uptimecol", cls.Uptime)
+ self.owner_col = ObjectTableColumn(app, "ownercol", cls.Owner)
+ self.add_column(self.jt_col)
+ self.add_column(self.id_col)
+ self.add_column(self.sub_col)
+ self.add_column(self.status_col)
+ self.add_column(self.uptime_col)
+ self.add_column(self.owner_col)
+
+
class JobTrackerTable(ObjectQmfTable):
def __init__(self, app, name, cls):
super(JobTrackerTable, self).__init__(app, name, cls)
- self.name_col = self.NameColumn(app, "name", cls.Name)
- self.add_column(self.name_col)
-
- class NameColumn(ObjectTableColumn):
- def render_text_align(self, session):
- return "left"
\ No newline at end of file
+ self.loc_col = ObjectTableColumn(app, "loccol", cls.Location)
+ self.loc_col.width = "20%"
+ self.id_col = ObjectTableColumn(app, "idcol", cls.ID)
+ self.sub_col = ObjectTableColumn(app, "sub", cls.Submitted)
+ self.status_col = ObjectTableColumn(app, "statuscol", cls.Status)
+ self.uptime_col = ObjectTableColumn(app, "uptimecol", cls.Uptime)
+ self.owner_col = ObjectTableColumn(app, "ownercol", cls.Owner)
+
+ self.add_column(self.loc_col)
+ self.add_column(self.id_col)
+ self.add_column(self.sub_col)
+ self.add_column(self.status_col)
+ self.add_column(self.uptime_col)
+ self.add_column(self.owner_col)
+
\ No newline at end of file
Modified: branches/elephant/cumin/python/cumin/grid-hadoop/main.py
===================================================================
--- branches/elephant/cumin/python/cumin/grid-hadoop/main.py 2012-11-16 16:17:51 UTC (rev 5547)
+++ branches/elephant/cumin/python/cumin/grid-hadoop/main.py 2012-11-16 19:27:38 UTC (rev 5548)
@@ -44,6 +44,6 @@
self.tabs.add_tab(NameNodeSelector(app, "namenodes"))
self.tabs.add_tab(DataNodeSelector(app, "datanodes"))
+ self.tabs.add_tab(JobTrackerSelector(app, "jobtrackers"))
self.tabs.add_tab(TaskTrackerSelector(app, "tasktrackers"))
- self.tabs.add_tab(JobTrackerSelector(app, "jobtrackers"))
\ No newline at end of file
11 years, 5 months