r4646 - trunk/cumin/python/cumin/grid
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-03-21 13:33:14 +0000 (Mon, 21 Mar 2011)
New Revision: 4646
Modified:
trunk/cumin/python/cumin/grid/limit.py
Log:
Change Max allowance table value to render as float, values
above 1000000 display as "unlimited"
BZ635197
Modified: trunk/cumin/python/cumin/grid/limit.py
===================================================================
--- trunk/cumin/python/cumin/grid/limit.py 2011-03-21 13:01:20 UTC (rev 4645)
+++ trunk/cumin/python/cumin/grid/limit.py 2011-03-21 13:33:14 UTC (rev 4646)
@@ -103,7 +103,9 @@
def render_cell_content(self, session, data):
limit_max = super(LimitTable.MaxColumn, self).render_cell_content(session, data)
try:
- limit_max = int(limit_max)
+ limit_max = float(limit_max)
+ if limit_max > 1000000.0:
+ limit_max = "Unlimited"
except:
limit_max = 0
return limit_max
13 years, 2 months
r4645 - in trunk: cumin/python/cumin/grid wooly/python/wooly
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-03-21 13:01:20 +0000 (Mon, 21 Mar 2011)
New Revision: 4645
Modified:
trunk/cumin/python/cumin/grid/limit.py
trunk/wooly/python/wooly/forms.py
Log:
Change Max Allowance field to allow float in addition to integer.
BZ679672
Modified: trunk/cumin/python/cumin/grid/limit.py
===================================================================
--- trunk/cumin/python/cumin/grid/limit.py 2011-03-21 12:15:05 UTC (rev 4644)
+++ trunk/cumin/python/cumin/grid/limit.py 2011-03-21 13:01:20 UTC (rev 4645)
@@ -9,7 +9,7 @@
from cumin.qmfadapter import ObjectQmfAdapter
from cumin.widgets import CuminView
-from wooly.forms import StringField, StringInput, IntegerField
+from wooly.forms import StringField, StringInput, IntegerField, RealField
from wooly.util import StringCatalog
from wooly.widgets import TabbedModeSet
@@ -204,7 +204,7 @@
# used to override html and css
pass
- class LimitMax(IntegerField):
+ class LimitMax(RealField):
def render_title(self, session):
return "Max Allowance"
Modified: trunk/wooly/python/wooly/forms.py
===================================================================
--- trunk/wooly/python/wooly/forms.py 2011-03-21 12:15:05 UTC (rev 4644)
+++ trunk/wooly/python/wooly/forms.py 2011-03-21 13:01:20 UTC (rev 4645)
@@ -197,6 +197,15 @@
self.size = 15
+class FloatInput(ScalarInput):
+ def __init__(self, app, name):
+ super(FloatInput, self).__init__(app, name, None)
+
+ self.param = FloatParameter(app, "param")
+ self.add_parameter(self.param)
+
+ self.size = 15
+
class CheckboxInput(FormInput):
def __init__(self, app, name, param=None):
super(CheckboxInput, self).__init__(app, name, param)
@@ -471,6 +480,26 @@
message = "The '%s' field must be an integer" % title
self.form.errors.add(session, FormError(message))
+class RealField(ScalarField):
+ def __init__(self, app, name):
+ super(RealField, self).__init__(app, name, None)
+
+ self.input = FloatInput(app, "input")
+ self.add_child(self.input)
+
+ def validate(self, session):
+ super(RealField, self).validate(session)
+
+ value = self.get(session)
+
+ if value:
+ try:
+ value = float(value)
+ except:
+ title = self.render_title(session)
+ message = "The '%s' field must be an integer or float" % title
+ self.form.errors.add(session, FormError(message))
+
# XXX make this use a RadioInputSet instead?
class RadioField(FormField):
def __init__(self, app, name, param):
13 years, 2 months
r4644 - branches/scale_testing/mint/python/mint
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-03-21 12:15:05 +0000 (Mon, 21 Mar 2011)
New Revision: 4644
Modified:
branches/scale_testing/mint/python/mint/update.py
Log:
Include sample count for latency numbers
Modified: branches/scale_testing/mint/python/mint/update.py
===================================================================
--- branches/scale_testing/mint/python/mint/update.py 2011-03-18 21:27:10 UTC (rev 4643)
+++ branches/scale_testing/mint/python/mint/update.py 2011-03-21 12:15:05 UTC (rev 4644)
@@ -297,7 +297,7 @@
created, updated, deleted, dropped))
def write_latency_by_class(self, mint, localtime_):
- names = ("Time", "Latency")
+ names = ("Time", "Latency", "Samples")
if self.now.init_update_flag:
self.init_update_times(self.now)
for name, latency in self.now.objects_latency_by_class.iteritems():
@@ -310,7 +310,7 @@
db = csv.writer(open(fname, "a+"))
if write_header:
db.writerow(names)
- db.writerow((time.strftime("%H:%M:%S",localtime_),val))
+ db.writerow((time.strftime("%H:%M:%S",localtime_),val,latency[0]))
def get_update_durations(self):
if self.now.init_update_flag:
13 years, 2 months
r4642 - trunk/cumin/flash-slots/flare.slots/src/flare/demos
by eallen@fedoraproject.org
Author: eallen
Date: 2011-03-18 21:25:14 +0000 (Fri, 18 Mar 2011)
New Revision: 4642
Modified:
trunk/cumin/flash-slots/flare.slots/src/flare/demos/Layouts.as
trunk/cumin/flash-slots/flare.slots/src/flare/demos/SlotLayout.as
trunk/cumin/flash-slots/flare.slots/src/flare/demos/SlotRenderer.as
Log:
Changes to the actionscript to support:
- 4 column display
- scroll to top after expand
- change tooltip
Removed some unused code that was used for tree-mapped legends
Modified: trunk/cumin/flash-slots/flare.slots/src/flare/demos/Layouts.as
===================================================================
--- trunk/cumin/flash-slots/flare.slots/src/flare/demos/Layouts.as 2011-03-18 20:39:12 UTC (rev 4641)
+++ trunk/cumin/flash-slots/flare.slots/src/flare/demos/Layouts.as 2011-03-18 21:25:14 UTC (rev 4642)
@@ -1,6 +1,5 @@
package flare.demos
{
- import flare.animate.Transitioner;
import flare.data.DataSet;
import flare.data.DataSource;
import flare.display.TextSprite;
@@ -23,33 +22,27 @@
import flare.vis.operator.OperatorSwitch;
import flare.vis.operator.encoder.PropertyEncoder;
import flare.vis.operator.label.Labeler;
- import flare.vis.operator.layout.TreeMapLayout;
import flash.events.Event;
import flash.external.ExternalInterface;
import flash.geom.Rectangle;
import flash.net.URLLoader;
- import flash.text.TextFormat;
- import flash.utils.Dictionary;
+ import mx.controls.scrollClasses.ScrollBar;
+
/**
* Demo showcasing a number of tree and graph layout algorithms.
*/
public class Layouts extends Demo
{
private var vis:Visualization;
- private var vis1:Visualization;
- private var vis2:Visualization;
- private var vis1Label:TextSprite;
- private var vis2Label:TextSprite;
- private var visLabelSize:Number = 18;
private var os:OperatorSwitch;
private var shape:String = null;
+ private var sb:ScrollBar = null;
+ private var lastSequence:Number = -1;
private var opt:Array;
private var idx:int = -1;
- private var lastUrl:String = null;
- private var anim:Boolean = true;
private var tipControl:TooltipControl = null;
private var tipControl1:TooltipControl = null;
private var tipControl2:TooltipControl = null;
@@ -79,14 +72,16 @@
"<b>Value</b> {1}<br/>" +
"<b>Slots</b> {2}";
private static const _slotTipText:String =
+ "<b><i>{5} - {6}</i></b><br/>" +
+ "--------------------------<br/>" +
"<b>Slot</b> {0}<br/>" +
"<b>Job</b>: {1}<br/>" +
"<b>Activity</b>: {2}<br/>" +
"<b>State</b>: {3}<br/>" +
"<b>Load</b>: {4}";
private static const _slotInfoTipText:String =
- "<b>Activity:State</b> {0}<br/>" +
- "<b>Slots</b> {1}<br/>" +
+ "<b>{0}</b><br/><br/>" +
+ "Slots: <b>{1}</b><br/>" +
"Click to expand";
public override function start():void
{
@@ -153,133 +148,27 @@
}
}
- private function reload(url:String, animate:Boolean):void
+ private function reload(url:String, seq:Number):void
{
if (highlighting)
return;
- do_load(url, animate);
+ do_load(url, seq);
return;
-
- var ds:DataSource = new DataSource(url, "json");
- var loader:URLLoader = ds.load();
- loader.addEventListener(Event.COMPLETE, function(evt:Event):void {
- var ds:DataSet = loader.data as DataSet;
- var data:Data = Data.fromDataSet(ds);
-
- var tree:Tree = new Tree();
- var root:NodeSprite = data.nodes[0];
- var old_tree:Tree;
- var old_root:NodeSprite;
- var _t:Transitioner = new Transitioner();
- if (root) {
- if (root.data.vis == "slots") {
- root.fillAlpha = 0;
- root.lineAlpha = 0;
- root.shape = Shapes.SQUARE;
- root.size = 1;
- tree.root = root;
- make_tree(tree, root, root.data);
- if (tree.back) {
- backButton.show();
- } else {
- backButton.hide();
- }
-
- old_tree = vis.data as Tree;
- old_root = old_tree.root;
- if (updateTree(root, old_root, root.data.vis)) {
- vis.data = tree;
- sizeMatters(tree);
- nodeEncoder.operate();
- edgeEncoder.operate();
- vis.update(_t).play();
- }
-
- } else {
- var tree1:Tree = new Tree();
- var root1:NodeSprite = tree1.addRoot();
- root1.fillAlpha = 0;
- root1.lineAlpha = 0;
- var tree2:Tree = new Tree();
- var root2:NodeSprite = tree2.addRoot();
- root2.fillAlpha = 0;
- root2.lineAlpha = 0;
- make_tree1(tree1, root1, tree2, root2, root.data);
- old_tree = vis2.data as Tree;
- old_root = old_tree.root;
- var trans1:Transitioner = Transitioner.instance(null);
- //var trans1:Transitioner = new Transitioner(1);
- if (updateTree(root1, old_root, root.data.vis)) {
- vis2.data = tree1;
- vis2.data.edges.setProperty("visible", false);
- vis2.update(trans1).play();
- }
- old_tree = vis1.data as Tree;
- old_root = old_tree.root;
- var trans2:Transitioner = Transitioner.instance(null);
- //var trans2:Transitioner = new Transitioner(1);
- if (updateTree(root2, old_root, root.data.vis)) {
- vis1.data = tree2;
- vis1.data.edges.setProperty("visible", false);
- vis1.update(trans2).play();
- }
- }
- }
- });
}
- private function updateTree(n:NodeSprite, o:NodeSprite, vis:String):Boolean
+ private function load(url:String, seq:Number):void
{
- var ret:Boolean = true;
- n.visitTreeBreadthFirst( function (x:NodeSprite):Boolean {
- var c:NodeSprite = findNode(x, o);
- if (c) {
- x.x = c.x;
- x.y = c.y;
- x.size = c.size;
- if (vis != "slots")
- if (c.props.hasOwnProperty("label")) {
- x.props["label"] = c.props["label"];
- }
- } else {
- if (x.parentNode.firstChildNode == x) {
- x.x = x.parentNode.x;
- x.y = x.parentNode.y;
- } else {
- x.x = x.parentNode.firstChildNode.x;
- x.y = x.parentNode.firstChildNode.y;
- }
- }
- return false;
- });
- return ret;
+ do_load(url, seq);
+ if (vis) {
+ vis.y = 0;
+ }
}
- private function findNode(x:NodeSprite, o:NodeSprite):NodeSprite
- {
- var oc:NodeSprite = null;
- o.visitTreeBreadthFirst( function (c:NodeSprite):Boolean {
- if (x.data.value == c.data.value) {
- if (x.data.name == c.data.name) {
- oc = c;
- return true;
- }
- }
- return false;
- });
- return oc;
- }
- private function load(url:String, animate:Boolean):void
- {
- do_load(url, animate);
- vis.y = 0;
- }
- private function do_load(url:String, animate:Boolean):void
+ private function do_load(url:String, seq:Number):void
{
- lastUrl = url;
- anim = animate;
- var ds:DataSource = new DataSource(url, "json");
- var loader:URLLoader = ds.load();
+ var dsrc:DataSource = new DataSource(url, "json");
+ var loader:URLLoader = dsrc.load();
+ lastSequence = seq;
loader.addEventListener(Event.COMPLETE, function(evt:Event):void {
var ds:DataSet = loader.data as DataSet;
var data:Data = Data.fromDataSet(ds);
@@ -289,24 +178,19 @@
if (root) {
ExternalInterface.call("vis_loaded", "1");
if (root.data.vis == "slots") {
+ // we received a new request before we received the response from the last one
+ if (root.data.hasOwnProperty("seq")) {
+ if (root.data.seq != lastSequence) {
+ return;
+ }
+ }
root.fillAlpha = 0;
root.lineAlpha = 0;
root.renderer = rootRenderer;
- root.shape = Shapes.SQUARE;
tree.root = root;
make_tree(tree, root, root.data);
+ root.shape = Shapes.SQUARE;
do_init(tree, null, root.data.vis);
- } else {
- var tree1:Tree = new Tree();
- var root1:NodeSprite = tree1.addRoot();
- root1.fillAlpha = 0;
- root1.lineAlpha = 0;
- var tree2:Tree = new Tree();
- var root2:NodeSprite = tree2.addRoot();
- root2.fillAlpha = 0;
- root2.lineAlpha = 0;
- make_tree1(tree1, root1, tree2, root2, root.data);
- do_init(tree1, tree2, root.data.vis);
}
} else {
ExternalInterface.call("vis_loaded", "0");
@@ -314,69 +198,11 @@
});
}
- private function make_tree1(tree:Tree, n:NodeSprite, tree2:Tree, n2:NodeSprite, rootData:Object):void
- {
- var a:Array = rootData.tree;
- var children:Data = Data.fromArray(a);
- var actd:Dictionary = new Dictionary();
- var stated:Dictionary = new Dictionary();
- var act:String;
- var state:String;
- children.visit( function (cn:NodeSprite):Boolean {
- var grand:Data = Data.fromArray(cn.data.tree);
- grand.visit( function (gc:NodeSprite):Boolean {
- act = gc.data.activity;
- state = gc.data.state;
- if ((state == "Matched") || (state == "Preempting"))
- state = "Preempting/Matched";
- if (!(act in actd))
- actd[act] = 1;
- else
- actd[act] += 1;
- if (!(state in stated))
- stated[state] = 1;
- else
- stated[state] += 1;
- return false;
- });
- return false;
- });
- var c:NodeSprite;
- var colors:Object = rootData.activity_colors;
- for (act in actd) {
- c = new NodeSprite();
- c.size = actd[act];
- c.shape = Shapes.BLOCK; // needed for treemap squares
- c.fillColor = Colors.rgba(colors[act][0]*255, colors[act][1]*255, colors[act][2]*255)
- c.lineColor = 0;
- c.fillAlpha = 0.7;
- c.lineAlpha = 1;
- c.lineWidth = 1;
- c.data.value = act;
- c.data.type = "activity";
- tree.addChild(n, c);
- }
- for (state in stated) {
- c = new NodeSprite();
- c.size = stated[state];
- c.shape = Shapes.BLOCK;
- c.fillColor = 0xff888888;
- c.lineColor = 0;
- c.fillAlpha = 0.7;
- c.lineAlpha = 1;
- c.lineWidth = 1;
- c.data.value = state;
- c.data.state = state;
- c.data.type = "state";
- c.renderer = slotRenderer;
- tree2.addChild(n2, c);
- }
- }
private function make_tree(tree:Tree, n:NodeSprite, rootData:Object):void
{
if (n.data.hasOwnProperty("tree")) {
var children:Data = Data.fromArray(n.data.tree);
- var colors:Object = rootData.activity_colors;
+ var shape_info:Object = rootData.shape_info;
children.visit( function (cn:NodeSprite):Boolean {
if (cn.data.hasOwnProperty("back")) {
if (cn.data.back) {
@@ -384,26 +210,32 @@
}
}
tree.addChild(n, cn);
- cn.shape = cn.data.shape;
- if (cn.data.hasOwnProperty("state")) {
- cn.renderer = slotRenderer;
- cn.fillColor = Colors.rgba(colors[cn.data.activity][0]*255, colors[cn.data.activity][1]*255, colors[cn.data.activity][2]*255);
+ if (cn.data.hasOwnProperty("category")) {
+ cn.shape = shape_info[cn.data.category]["shape"];
+ try {
+ cn.fillColor = Colors.rgba(shape_info[cn.data.category]["color"][0]*255,
+ shape_info[cn.data.category]["color"][1]*255,
+ shape_info[cn.data.category]["color"][2]*255);
+ } catch (e:Error) {
+ cn.fillColor = Colors.rgba(shape_info["Unknown"]["color"][0]*255,
+ shape_info["Unknown"]["color"][1]*255,
+ shape_info["Unknown"]["color"][2]*255);
+ }
cn.lineColor = cn.fillColor;
- cn.lineAlpha = 1;
+ cn.data.orgLineColor = cn.lineColor;
cn.fillAlpha = 1;
- } else if (cn.data.hasOwnProperty("count")) {
- var activityState:Array = cn.data.a_s.split(":");
+ cn.lineAlpha = 1;
+ }
+ if (cn.data.hasOwnProperty("count")) {
cn.renderer = summaryRenderer;
- cn.data.activity = activityState[0];
- cn.data.state = activityState[1];
cn.data.percent = cn.data.count / cn.parentNode.data.slots;
- cn.fillColor = Colors.rgba(colors[cn.data.activity][0]*255, colors[cn.data.activity][1]*255, colors[cn.data.activity][2]*255);
- cn.lineColor = cn.fillColor;
- cn.fillAlpha = 1;
- cn.lineAlpha = 1;
cn.lineWidth = 1;
+ } else if (cn.data.hasOwnProperty("state")) {
+ cn.renderer = slotRenderer;
} else if (cn.data.level == 1) {
cn.renderer = groupRenderer;
+ } else {
+ cn.shape = null;
}
make_tree(tree, cn, rootData);
return false
@@ -470,10 +302,10 @@
var s:String = new String("");
var data:Object = d.data;
if (d.data.name == "slot") {
- s = Strings.format(_slotTipText, data.value, data.job_id, data.activity, data.state, data.load_avg);
+ s = Strings.format(_slotTipText, data.value, data.job_id, data.activity, data.state, data.load_avg, data.category_group, data.category);
TextSprite(evt.tooltip).htmlText = s;
} else {
- s = Strings.format(_slotInfoTipText, data.a_s, data.count);
+ s = Strings.format(_slotInfoTipText, data.category, data.count);
TextSprite(evt.tooltip).htmlText = s;
}
}
@@ -530,51 +362,21 @@
edgeEncoder.operate();
vis.update();
- } else {
- if (!vis1) {
- var tf:TextFormat = new TextFormat("slotvis", 10, 0);
- labelerOperator = new SlotTreeLabeler("data.value", "nodes", tf, null, Labeler.LAYER);
- labelerOperator.textMode = TextSprite.EMBED;
- vis1 = new Visualization();
- vis1.operators.add(new TreeMapLayout());
- vis1.operators.add(labelerOperator);
- if (!tipControl2)
- tipControl2 = new TooltipControl(NodeSprite, null, tipOver);
- vis1.controls.add(tipControl2);
- if (!treeHover1)
- treeHover1 = new HoverControl(NodeSprite, HoverControl.MOVE_AND_RETURN, rollOver, rollOut);
- vis1.controls.add(treeHover1);
- vis1Label = new TextSprite("State", new TextFormat("Arial", visLabelSize-4, 0, true));
- vis1.bounds = treeBounds2(bounds);
- vis1Label.x = vis1.bounds.left;
- vis1Label.y = 0;
- addChild(vis1Label);
- addChild(vis1);
+ if (!sb) {
+ sb = new ScrollBar();
+ sb.width = 40;
+ sb.height = this.stage.stageHeight;
+ sb.x = this.stage.stageWidth - 40;
+ sb.y = 0;
+ sb.pageSize = 400;
+ sb.minScrollPosition = 0;
+ sb.maxScrollPosition = this.stage.stageHeight;
+ sb.pageScrollSize = 0;
+ sb.visible = true;
+ sb.enabled = true;
+ this.stage.addChild(sb);
}
- vis1.data = data1;
- vis1.data.edges.setProperty("visible", false);
- vis1.update();
-
- if (!vis2) {
- vis2 = new Visualization();
- vis2.operators.add(new TreeMapLayout());
- vis2.operators.add(labelerOperator);
- if (!tipControl1)
- tipControl1 = new TooltipControl(NodeSprite, null, tipOver);
- vis2.controls.add(tipControl1);
- if (!treeHover2)
- treeHover2 = new HoverControl(NodeSprite, HoverControl.MOVE_AND_RETURN, rollOver, rollOut);
- vis2.controls.add(treeHover2);
- vis2Label = new TextSprite("Activity", new TextFormat("Arial", visLabelSize-4, 0, true));
- vis2.bounds = treeBounds1(bounds);
- vis2Label.x = vis2.bounds.left;
- vis2Label.y = 0;
- addChild(vis2Label);
- addChild(vis2);
- }
- vis2.data = data;
- vis2.data.edges.setProperty("visible", false);
- vis2.update();
+
}
}
private function tipOver(evt:ToolTipEvent):void {
@@ -589,49 +391,18 @@
"{0} slot{3} with {1} {2}", d.size, data.type, data.value, plural);
}
}
- private function rollOver(evt:SelectionEvent):void {
- var n:NodeSprite = evt.node;
- n.lineColor = 0xffFF0000;
- n.lineWidth = 1;
- n.fillAlpha = 1;
- ExternalInterface.call("vis_treemap_over", n.data.type, n.data.value);
- }
-
- private function rollOut(evt:SelectionEvent):void {
- var n:NodeSprite = evt.node;
- n.lineColor = 0xff000000;
- n.lineWidth = 1;
- n.fillAlpha = 0.7;
- ExternalInterface.call("vis_treemap_out", n.data.type, n.data.value);
- }
-
-
+
private function mainBounds(b:Rectangle):Rectangle
{
return new Rectangle(b.x, b.y, b.width, b.height);
}
- private function treeBounds1(b:Rectangle):Rectangle
- {
- return new Rectangle(b.x, b.y+visLabelSize, (b.width / 2) - 10, b.height-visLabelSize);
- }
- private function treeBounds2(b:Rectangle):Rectangle
- {
- return new Rectangle(b.width / 2 + 10, b.y+visLabelSize, (b.width / 2) - 10, b.height-visLabelSize);
- }
+
public override function resize():void
{
if (vis) {
vis.bounds = mainBounds(bounds);
vis.update();
}
- if (vis1) {
- vis1.bounds = treeBounds2(bounds);
- vis1.update();
- }
- if (vis2) {
- vis2.bounds = treeBounds1(bounds);
- vis2.update();
- }
}
public override function play():void
Modified: trunk/cumin/flash-slots/flare.slots/src/flare/demos/SlotLayout.as
===================================================================
--- trunk/cumin/flash-slots/flare.slots/src/flare/demos/SlotLayout.as 2011-03-18 20:39:12 UTC (rev 4641)
+++ trunk/cumin/flash-slots/flare.slots/src/flare/demos/SlotLayout.as 2011-03-18 21:25:14 UTC (rev 4642)
@@ -108,6 +108,7 @@
cn.x = 0; cn.y = 0;
shiftTree(root, cn.x, cn.y);
+ _anchor.y = backButtonHeight;
layoutHelper(root, _anchor.x, _anchor.y, scale);
updateEdgePoints(_t);
showLabels = true;
@@ -170,6 +171,9 @@
}
list.push(c);
}
+ if (list.length > 2) {
+ var z:Number = 1;
+ }
// now sort the child list and perform packing
//if (_sort) _sort.sort(list);
for (i=0; i<list.length; ++i) {
@@ -186,6 +190,7 @@
_order = 0;
var rows:Number, cols:Number;
+ var expandable:Boolean = false;
if (!showLabels) {
cols = Math.floor(Math.sqrt(N));
rows = Math.floor(N/cols);
@@ -210,7 +215,8 @@
if (maxLeaves == 0) {
cols = Math.floor(Math.sqrt(N));
} else {
- cols = Math.min(2, N);
+ cols = Math.min(4, N);
+ expandable = true;
}
rows = Math.floor(N/cols);
if (N % cols > 0)
@@ -268,14 +274,10 @@
if (i < N) {
cn = nodes[i];
cn.x = colX;
- if (cols == 2) {
+ if (expandable && (cols == 4)) {
fitInBounds = false;
cn.w = 180;
- if (curCol == 0) {
- cn.x = 0;
- } else {
- cn.x = 200;
- }
+ cn.x = 200 * curCol;
}
cn.y = rowY;
updateBounds(cn, _b);
Modified: trunk/cumin/flash-slots/flare.slots/src/flare/demos/SlotRenderer.as
===================================================================
--- trunk/cumin/flash-slots/flare.slots/src/flare/demos/SlotRenderer.as 2011-03-18 20:39:12 UTC (rev 4641)
+++ trunk/cumin/flash-slots/flare.slots/src/flare/demos/SlotRenderer.as 2011-03-18 21:25:14 UTC (rev 4642)
@@ -45,38 +45,26 @@
var x:Number, y:Number, w:Number, h:Number;
- // for the state treemap
- if (d.shape == Shapes.BLOCK) {
- g.lineStyle(1, lineColor, 1);
- x = d.u-d.x;
- y = d.v-d.y;
- w = d.w;
- h = d.h;
- } else {
- // a normal slot
- x = 0;
- y = 0;
- w = size * 2;
- h = size * 2;
- }
+ x = 0;
+ y = 0;
+ w = size * 2;
+ h = size * 2;
g.drawRect(x, y, w, h);
- var state:String = d.data.state;
- switch (state) {
- case "Unclaimed": // hollow
+ var shape:String = d.shape;
+ switch (shape) {
+ case "box": // hollow
default:
break;
- case "Claimed": // solid
+ case "solid": // solid
g.beginFill(baseColor, 1);
g.drawRect(x, y, w, h);
break;
- case "Owner": // upper right to bottom left line
+ case "diagonal": // upper right to bottom left line
g.moveTo(x, y);
g.lineTo(x + w, y + h);
break;
- case "Matched":
- case "Preempting":
- case "Preempting/Matched": // triangle in bottom right corner
+ case "filled_triangle": // triangle in bottom right corner
g.lineStyle(1, baseColor);
var x1:Number = x-1;
var y1:Number = y;
13 years, 2 months
r4641 - trunk/cumin/python/cumin/grid
by eallen@fedoraproject.org
Author: eallen
Date: 2011-03-18 20:39:12 +0000 (Fri, 18 Mar 2011)
New Revision: 4641
Modified:
trunk/cumin/python/cumin/grid/dashboard.py
Log:
Fix typo
Modified: trunk/cumin/python/cumin/grid/dashboard.py
===================================================================
--- trunk/cumin/python/cumin/grid/dashboard.py 2011-03-18 20:29:05 UTC (rev 4640)
+++ trunk/cumin/python/cumin/grid/dashboard.py 2011-03-18 20:39:12 UTC (rev 4641)
@@ -714,7 +714,7 @@
def do_render(self, session):
obj = self.object.get(session)
if obj:
- return super(NegotiatorJobThroughput.ThroughputChart, self)._do_render(session)
+ return super(NegotiatorJobThroughput.ThroughputChart, self).do_render(session)
def render_title(self, session):
return "Recent negotiator job throughput"
13 years, 2 months
r4640 - trunk/wooly/python/wooly
by eallen@fedoraproject.org
Author: eallen
Date: 2011-03-18 20:29:05 +0000 (Fri, 18 Mar 2011)
New Revision: 4640
Modified:
trunk/wooly/python/wooly/datatable.py
Log:
Change page navigation arrows to text
Change to text to Initial caps
Modified: trunk/wooly/python/wooly/datatable.py
===================================================================
--- trunk/wooly/python/wooly/datatable.py 2011-03-18 19:42:25 UTC (rev 4639)
+++ trunk/wooly/python/wooly/datatable.py 2011-03-18 20:29:05 UTC (rev 4640)
@@ -276,7 +276,7 @@
limit = self.table.header.limit.get(session)
# info for each possible page of results
- options = [(x[1], x[0] + 1, "Goto Page %i" % (x[0] + 1, )) for x in enumerate(range(0, count, limit))]
+ options = [(x[1], x[0] + 1, "Goto page %i" % (x[0] + 1, )) for x in enumerate(range(0, count, limit))]
# the starting item on the current page
selection = self.selection.get(session)
@@ -296,18 +296,18 @@
first_page = max(last_page - self.max_page_links, 0)
if first_page:
- pages.append((0, "«", "First Page"))
+ pages.append((0, "first", "First page"))
prev = max(selection - limit, 0)
- pages.append((prev, "‹", "Previous Page"))
+ pages.append((prev, "prev", "Previous page"))
pages.extend(options[first_page : last_page])
if last_page < len(options):
next = options[cur_page + 1][0]
- pages.append((next, "›", "Next Page"))
+ pages.append((next, "next", "Next page"))
last = options[len(options) - 1][0]
- pages.append((last, "»", "Last Page"))
+ pages.append((last, "last", "Last page"))
return pages
13 years, 2 months
r4639 - trunk/cumin/python/cumin/grid
by eallen@fedoraproject.org
Author: eallen
Date: 2011-03-18 19:42:25 +0000 (Fri, 18 Mar 2011)
New Revision: 4639
Modified:
trunk/cumin/python/cumin/grid/dashboard.py
Log:
Don't try to display the negotiator throughput chart without a negotiator
Modified: trunk/cumin/python/cumin/grid/dashboard.py
===================================================================
--- trunk/cumin/python/cumin/grid/dashboard.py 2011-03-18 19:25:55 UTC (rev 4638)
+++ trunk/cumin/python/cumin/grid/dashboard.py 2011-03-18 19:42:25 UTC (rev 4639)
@@ -711,6 +711,11 @@
self.add_child(chart)
class ThroughputChart(StatFlashChart):
+ def do_render(self, session):
+ obj = self.object.get(session)
+ if obj:
+ return super(NegotiatorJobThroughput.ThroughputChart, self)._do_render(session)
+
def render_title(self, session):
return "Recent negotiator job throughput"
13 years, 2 months
r4638 - in trunk/cumin: python/cumin/grid python/cumin/inventory resources
by eallen@fedoraproject.org
Author: eallen
Date: 2011-03-18 19:25:55 +0000 (Fri, 18 Mar 2011)
New Revision: 4638
Modified:
trunk/cumin/python/cumin/grid/dashboard.py
trunk/cumin/python/cumin/grid/dashboard.strings
trunk/cumin/python/cumin/grid/slot.py
trunk/cumin/python/cumin/grid/slotvis.py
trunk/cumin/python/cumin/grid/slotvis.strings
trunk/cumin/python/cumin/inventory/system.strings
trunk/cumin/resources/app.js
trunk/cumin/resources/slots.swf
Log:
Make slot visualization four columns wide.
Scroll vis back to top when expanded.
Attempt to prevent vis from reverting to previous state after user changes grouping or expands/collapses.
Remove group by None
Modified: trunk/cumin/python/cumin/grid/dashboard.py
===================================================================
--- trunk/cumin/python/cumin/grid/dashboard.py 2011-03-18 17:06:19 UTC (rev 4637)
+++ trunk/cumin/python/cumin/grid/dashboard.py 2011-03-18 19:25:55 UTC (rev 4638)
@@ -201,9 +201,6 @@
return [self.get_item_value(session, x) or 0 for x in items if not self.is_total(x)]
class DefinitionSetPopup(Widget):
- def __init__(self, app, name):
- super(PieStatSet.DefinitionSetPopup, self).__init__(app, name)
-
def render_chart_href(self, session):
return self.page.get_popup_url(session, self.parent.chart_link)
Modified: trunk/cumin/python/cumin/grid/dashboard.strings
===================================================================
--- trunk/cumin/python/cumin/grid/dashboard.strings 2011-03-18 17:06:19 UTC (rev 4637)
+++ trunk/cumin/python/cumin/grid/dashboard.strings 2011-03-18 19:25:55 UTC (rev 4638)
@@ -148,7 +148,7 @@
margin-bottom: 1em;
height: 1em;
padding: 0.5em;
- background-color: #F0F0F0;
+ background-color: #F7F7F7;
clear: right;
}
Modified: trunk/cumin/python/cumin/grid/slot.py
===================================================================
--- trunk/cumin/python/cumin/grid/slot.py 2011-03-18 17:06:19 UTC (rev 4637)
+++ trunk/cumin/python/cumin/grid/slot.py 2011-03-18 19:25:55 UTC (rev 4638)
@@ -171,6 +171,10 @@
self.json = Parameter(app, "json")
self.add_parameter(self.json)
+ self.sequence = IntegerParameter(app, "seq")
+ self.sequence.default = 0
+ self.add_parameter(self.sequence)
+
self.expanded = Parameter(app, "expanded")
self.expanded.default = ""
self.expanded.all = "all"
@@ -303,7 +307,9 @@
root.value = self.object_param.get(session)._id
root.slots = slot_count
json = self.json.get(session)
+ sequence = self.sequence.get(session)
root.vis = json
+ root.seq = sequence
root.shape_info = self.shapes
root.activity_colors = self.interiors
expanded = self.expanded.get(session)
Modified: trunk/cumin/python/cumin/grid/slotvis.py
===================================================================
--- trunk/cumin/python/cumin/grid/slotvis.py 2011-03-18 17:06:19 UTC (rev 4637)
+++ trunk/cumin/python/cumin/grid/slotvis.py 2011-03-18 19:25:55 UTC (rev 4638)
@@ -89,6 +89,7 @@
return sess.marshal()
def render_slot_chart_width(self, session):
+ return 800
return self.render_slot_clip_size(session)
def render_slot_chart_height(self, session):
@@ -96,7 +97,12 @@
data = cursor.fetchall()
# allow 44 px per machine up to 8100
- return max(min((len(data) / 2) * 44, 8100), self.render_slot_clip_size(session))
+ rows = len(data) / 4
+ if rows % 4:
+ rows += 1
+ total_height = rows * 43.6
+ at_least = max(total_height, self.slot_clip_size)
+ return min(at_least, 8100)
def render_fullpageable(self, session):
return self.fullpageable and "fullpageable" or ""
@@ -117,7 +123,7 @@
self.add_state("System", "By system")
self.add_state("AccountingGroup", "By accounting group")
- self.add_state("None", "No Grouping")
+ #self.add_state("OpSys", "By opsys")
def get_click(self, session, state):
href = self.parent.render_slots_href(session)
Modified: trunk/cumin/python/cumin/grid/slotvis.strings
===================================================================
--- trunk/cumin/python/cumin/grid/slotvis.strings 2011-03-18 17:06:19 UTC (rev 4637)
+++ trunk/cumin/python/cumin/grid/slotvis.strings 2011-03-18 19:25:55 UTC (rev 4638)
@@ -10,6 +10,9 @@
div#PoolSlotFlashVis div.slot_legend {
float: left;
}
+div#PoolSlotFlashVis div.SlotLegend {
+ margin: 4em 0 0 2em;
+}
div#PoolSlotFlashVis div.slot_visualization {
float: left;
}
@@ -22,26 +25,36 @@
<div class="slot_visualization">
<div class="duration">{group_by}</div>
<div id="{id}_chart"></div>
- <div>Click and drag up and down to scroll</div>
+ <div>Click and drag up and down within the list of slots to scroll</div>
</div>
<div class="slot_legend">{slot_legend}</div><div style="clear:both;"></div>
</div>
</div>
<script type="text/javascript">
//<![CDATA[
+ // called every time the page is updated (currently 10 secs) and
+ // when the user expands/collapses the flash chart
function updatePoolSlotVis(id, loadType) {
var chart = cumin.getFlashChart(id);
if (typeof loadType == "undefined")
loadType = "load";
if ((chart != null) && (typeof chart.src != "undefined")) {
- if ((loadType == "reload") && (typeof chart.reload != "undefined"))
- chart.reload(chart.src, false);
- else if ((loadType == "load") && (typeof chart.load != "undefined"))
- chart.load(chart.src, false);
- else
+
+ var seq = incrementChartSequence(chart);
+ if ((loadType == "reload") && (typeof chart.reload != "undefined")) {
+ chart.reload(chart.src, seq);
+ wooly.log("reloaded chart " + chart.src);
+ }
+ else if ((loadType == "load") && (typeof chart.load != "undefined")) {
+ chart.load(chart.src, seq);
+ wooly.log("loaded chart " + chart.src);
+ }
+ else {
wooly.log("load not defined for " + id);
+ }
}
}
+
function vis_loaded(data) {
if (data == "1") {
$('PoolSlotFlashVis').style.visibility = "visible";
@@ -64,6 +77,7 @@
branch['expanded'] = parent;
chart.src = branch.marshal();
updatePoolSlotVis("{id}", "load");
+ var myFx = new Fx.Scroll(window).toTop();
}
function vis_back() {
var chart = cumin.getFlashChart("{id}");
@@ -116,7 +130,7 @@
var fsm = document.getElementById('flashSlotMap');
if (fsm)
fsm.style.display = "block";
-
+
var params = {menu: "false", scale: "noScale", allowFullscreen: "true", allowScriptAccess: "always", bgcolor: "#FFFFFF"};
var branch = wooly.session.branch();
if (branch.formBackground) {
@@ -125,7 +139,7 @@
}
swfobject.embedSWF("resource?name=slots.swf", "{id}_chart", "{slot_chart_width}", "{slot_chart_height}", "9.0.0", "", {vis:"slots"}, params);
-
+
wooly.addPageUpdateListener(function () { updatePoolSlotVis('{id}', "reload"); });
window.addEvent('domready',function () {
cumin.setFullpageHandler('{id}', '{fullpage_href}');
Modified: trunk/cumin/python/cumin/inventory/system.strings
===================================================================
--- trunk/cumin/python/cumin/inventory/system.strings 2011-03-18 17:06:19 UTC (rev 4637)
+++ trunk/cumin/python/cumin/inventory/system.strings 2011-03-18 19:25:55 UTC (rev 4638)
@@ -62,12 +62,13 @@
function updateSystemSlotVis(id, loadType) {
var chart = cumin.getFlashChart(id);
if ((chart != null) && (typeof chart.src != "undefined")) {
+ var seq = incrementChartSequence(chart);
if (typeof loadType != "undefined") {
if (typeof chart.reload != "undefined")
- chart.reload(chart.src, false);
+ chart.reload(chart.src, seq);
} else {
if (typeof chart.load != "undefined")
- chart.load(chart.src, false);
+ chart.load(chart.src, seq);
else
wooly.log("load not defined for " + id);
}
Modified: trunk/cumin/resources/app.js
===================================================================
--- trunk/cumin/resources/app.js 2011-03-18 17:06:19 UTC (rev 4637)
+++ trunk/cumin/resources/app.js 2011-03-18 19:25:55 UTC (rev 4638)
@@ -416,6 +416,18 @@
wooly.log("reload not definded for " + id);
}
+function incrementChartSequence(chart) {
+ var src = chart.src;
+ var branch = wooly.session.branch(src);
+ if (typeof branch['seq'] == "undefined")
+ branch['seq'] = '0';
+ var seq = parseInt(branch['seq']) + 1;
+ branch['seq'] = seq;
+ chart.src = branch.marshal();
+ return seq;
+}
+
+
/*
function ofc_ready(id) {
if (typeof id != "undefined") {
Modified: trunk/cumin/resources/slots.swf
===================================================================
(Binary files differ)
13 years, 2 months
r4637 - branches/scale_testing/mint/python/mint
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-03-18 17:06:19 +0000 (Fri, 18 Mar 2011)
New Revision: 4637
Modified:
branches/scale_testing/mint/python/mint/update.py
Log:
Fix exception handler for Python 2.4
Modified: branches/scale_testing/mint/python/mint/update.py
===================================================================
--- branches/scale_testing/mint/python/mint/update.py 2011-03-18 17:02:56 UTC (rev 4636)
+++ branches/scale_testing/mint/python/mint/update.py 2011-03-18 17:06:19 UTC (rev 4637)
@@ -369,9 +369,8 @@
db.writerow(stats_headings)
db.writerow(values)
- except Exception as inst:
- print "exception in write values"
- print inst
+ except Exception:
+ print_exc()
class UpdateCursor(Cursor):
def execute(self, sql, args=None):
13 years, 2 months
r4636 - in branches/scale_testing: mint/python/mint wooly/python/wooly/wsgiserver
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-03-18 17:02:56 +0000 (Fri, 18 Mar 2011)
New Revision: 4636
Modified:
branches/scale_testing/mint/python/mint/update.py
branches/scale_testing/wooly/python/wooly/wsgiserver/__init__.py
Log:
Fix up qmf object latency stats, turn off creation of profilig directory
Modified: branches/scale_testing/mint/python/mint/update.py
===================================================================
--- branches/scale_testing/mint/python/mint/update.py 2011-03-17 20:17:28 UTC (rev 4635)
+++ branches/scale_testing/mint/python/mint/update.py 2011-03-18 17:02:56 UTC (rev 4636)
@@ -98,6 +98,9 @@
then = None
now = None
+ def latency_tuple(self):
+ return [0,0]
+
def __init__(self, app, binMod = 0, myBin = 0, binClass = ""):
self.enqueued = 0
self.dequeued = 0
@@ -118,24 +121,16 @@
self.objects_deleted_by_class = defaultdict(int)
self.objects_dropped_by_class = defaultdict(int)
- self.objects_latency_by_class = defaultdict(int)
+ # [cnt, cum_total]
+ self.objects_latency_by_class = defaultdict(self.latency_tuple)
- for pkg in app.model._packages:
- for cls in pkg._classes:
- self.objects_created_by_class[cls] = 0
- self.objects_updated_by_class[cls] = 0
- self.objects_deleted_by_class[cls] = 0
- self.objects_dropped_by_class[cls] = 0
-
- self.objects_latency_by_class[cls._name] = 0
-
self.sql_ops = 0
self.errors = 0
self.time = None
self.cpu = 0
self.memory = 0
- self.init_update_times()
+ self.init_update_times(self)
self.slot_create_bins = defaultdict(int)
self.slot_update_bins = defaultdict(int)
@@ -143,27 +138,26 @@
self.binMod = binMod
self.binClass = binClass
- def init_update_times(self):
+ def init_update_times(self,stats):
# Track average time of update from arrival to
# processing complete. Refreshed per interval.
- self.update_queue_duration = 0
- self.update_process_duration = 0
- self.queue_time = 0
- self.initial_process_time = 0
- self.commit_time = 0
- self.record_samples = 0
- self.latency_samples = 0
- self.depth = 0
+ stats.update_queue_duration = 0
+ stats.update_process_duration = 0
+ stats.queue_time = 0
+ stats.initial_process_time = 0
+ stats.commit_time = 0
+ stats.record_samples = 0
+ stats.depth = 0
- for k, v in self.objects_latency_by_class.iteritems():
- self.objects_latency_by_class[k] = 0
+ for k, v in stats.objects_latency_by_class.iteritems():
+ stats.objects_latency_by_class[k] = [0,0]
- self.init_update_flag = False
+ stats.init_update_flag = False
def record_update_times(self,update):
try:
if self.init_update_flag:
- self.init_update_times()
+ self.init_update_times(self)
self.record_samples += 1
self.update_queue_duration += \
update.start_process - update.create_time
@@ -179,8 +173,8 @@
self.enqueued - self.dequeued
if update.latency_cls != None:
- self.latency_samples += 1
- self.objects_latency_by_class[update.latency_cls] += \
+ self.objects_latency_by_class[update.latency_cls][0] += 1
+ self.objects_latency_by_class[update.latency_cls][1] += \
update.object_latency
except:
@@ -304,19 +298,23 @@
def write_latency_by_class(self, mint, localtime_):
names = ("Time", "Latency")
- if self.now.latency_samples == 0:
- return
-
- for name, latency in self.objects_latency_by_class.iteritems():
- latency /= self.now.latency_samples
+ if self.now.init_update_flag:
+ self.init_update_times(self.now)
+ for name, latency in self.now.objects_latency_by_class.iteritems():
+ if latency[0] == 0:
+ val = 0
+ else:
+ val = latency[1] / latency[0]
fname = self.latency_stats[name]
write_header = not os.path.isfile(fname)
db = csv.writer(open(fname, "a+"))
if write_header:
db.writerow(names)
- db.writerow((time.strftime("%H:%M:%S",localtime_),latency))
+ db.writerow((time.strftime("%H:%M:%S",localtime_),val))
def get_update_durations(self):
+ if self.now.init_update_flag:
+ self.init_update_times(self.now)
total = self.now.record_samples
if total == 0 or self.now.dequeued == self.then.dequeued:
create_dur = proc_dur = que_dur = init_proc_time = \
@@ -528,8 +526,16 @@
bin_time = create_time / 1000000000
self.latency_cls = cls._name
- self.object_latency = time.time() - update_time / 1000000000
+ t = time.time()
+ self.object_latency = t - update_time / 1000000000
+# if cls._name == "Slot" or cls._name == "Submission":
+# print "I created a " + cls._name
+# print ("update time equals createtime", str(update_time == create_time), str((update_time - create_time)/1000000000))
+# print ("local time ", time.ctime(t))
+# print ("update time", time.ctime(update_time / 1000000000))
+# print ("create time", time.ctime(create_time / 1000000000))
+# print ("latency", self.object_latency)
# experimental binning code
if stats.binMod > 0 and cls._name == stats.binClass:
@@ -611,8 +617,16 @@
bin_time = create_time / 1000000000
self.latency_cls = obj._class._name
- self.object_latency = time.time() - update_time / 1000000000
+ t = time.time()
+ self.object_latency = t - update_time / 1000000000
+# if obj._class._name == "Slot" or obj._class._name == "Submission":
+# print "I updated a " + obj._class._name
+# print ("update time equals createtime", str(update_time == create_time), str((update_time - create_time)/1000000000))
+# print ("local time ", time.ctime(t))
+# print ("update time", time.ctime(update_time / 1000000000))
+# print ("latency", self.object_latency)
+
# experimental binning code
if stats.binMod > 0 and obj._class._name == stats.binClass:
bin_time = int(floor(bin_time))
@@ -672,8 +686,15 @@
def delete_object(self, cursor, stats, obj, delete_time):
self.latency_cls = obj._class._name
- self.object_latency = time.time() - delete_time / 1000000000
+ t = time.time()
+ self.object_latency = t - delete_time / 1000000000
+# if obj._class._name == "Slot" or obj._class._name == "Submission":
+# print "I deleted a " + obj._class._name
+# print ("local time ", time.ctime(t))
+# print ("delete time", time.ctime(delete_time / 1000000000))
+# print ("latency", self.object_latency)
+
obj.delete(cursor)
self.model.print_event(3, "Deleted %s", obj)
Modified: branches/scale_testing/wooly/python/wooly/wsgiserver/__init__.py
===================================================================
--- branches/scale_testing/wooly/python/wooly/wsgiserver/__init__.py 2011-03-17 20:17:28 UTC (rev 4635)
+++ branches/scale_testing/wooly/python/wooly/wsgiserver/__init__.py 2011-03-18 17:02:56 UTC (rev 4636)
@@ -1363,16 +1363,16 @@
def run(self):
# put profile results in a subdirectory
- ds = time.strftime("%m%d%y_%H%M%S",time.localtime())
- p = os.path.join("./", \
- "prof_"+ time.strftime("%m%d%y_%H%M%S",time.localtime()))
+# ds = time.strftime("%m%d%y_%H%M%S",time.localtime())
+# p = os.path.join("./", \
+# "prof_"+ time.strftime("%m%d%y_%H%M%S",time.localtime()))
- if not os.path.exists(p):
- try:
- os.makedirs(p)
- except:
- pass
- p = os.path.join(p, self.getName())
+# if not os.path.exists(p):
+# try:
+# os.makedirs(p)
+# except:
+# pass
+# p = os.path.join(p, self.getName())
def profWrapper():
try:
13 years, 2 months