r4851 - branches
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-06-24 12:42:17 +0000 (Fri, 24 Jun 2011)
New Revision: 4851
Added:
branches/sage_addition/
Log:
Create a branch to hold work on the sage module before merging to trunk
12 years, 11 months
r4850 - trunk/cumin/python/cumin
by croberts@fedoraproject.org
Author: croberts
Date: 2011-06-23 18:58:35 +0000 (Thu, 23 Jun 2011)
New Revision: 4850
Modified:
trunk/cumin/python/cumin/widgets.strings
Log:
Addressing BZ https://bugzilla.redhat.com/show_bug.cgi?id=715973 . Editing one attribute should no longer result in 15 other edits being reported.
Modified: trunk/cumin/python/cumin/widgets.strings
===================================================================
--- trunk/cumin/python/cumin/widgets.strings 2011-06-23 17:37:46 UTC (rev 4849)
+++ trunk/cumin/python/cumin/widgets.strings 2011-06-23 18:58:35 UTC (rev 4850)
@@ -489,8 +489,8 @@
</tr>
[EditablePropertyRenderer.bool_html]
-<input class="edit_bool" id="{pname}.true" type="radio" name="{pname}" value="TRUE" {true_selected} /> <label for="{pname}.true">True</label>
-<input class="edit_bool" id="{pname}.false" type="radio" name="{pname}" value="FALSE" {false_selected} /> <label for="{pname}.false">False</label>
+<input class="edit_bool" id="{pname}.true" type="radio" name="{pname}" value="true" {true_selected} /> <label for="{pname}.true">True</label>
+<input class="edit_bool" id="{pname}.false" type="radio" name="{pname}" value="false" {false_selected} /> <label for="{pname}.false">False</label>
<input type="hidden" name="{ptype_name}" value="{ptype_value}"/>
{orig_value}
12 years, 11 months
r4849 - trunk/cumin/python/cumin/grid
by croberts@fedoraproject.org
Author: croberts
Date: 2011-06-23 17:37:46 +0000 (Thu, 23 Jun 2011)
New Revision: 4849
Modified:
trunk/cumin/python/cumin/grid/job.py
Log:
Addressing BZ https://bugzilla.redhat.com/show_bug.cgi?id=715956 by setting the JobAdsEditor to not have update_enabled.
Modified: trunk/cumin/python/cumin/grid/job.py
===================================================================
--- trunk/cumin/python/cumin/grid/job.py 2011-06-22 18:39:04 UTC (rev 4848)
+++ trunk/cumin/python/cumin/grid/job.py 2011-06-23 17:37:46 UTC (rev 4849)
@@ -707,6 +707,8 @@
self.add_parameter(self.ads)
self.item_renderer = EditablePropertyRenderer(self, "property_html")
+
+ self.update_enabled = False
def do_get_items(self, session):
ads = self.ads.get(session)
12 years, 11 months
r4848 - trunk/notes
by croberts@fedoraproject.org
Author: croberts
Date: 2011-06-22 18:39:04 +0000 (Wed, 22 Jun 2011)
New Revision: 4848
Modified:
trunk/notes/open-flash-chart notes.txt
Log:
More notes on the open flash chart functionality.
Modified: trunk/notes/open-flash-chart notes.txt
===================================================================
--- trunk/notes/open-flash-chart notes.txt 2011-06-22 12:05:19 UTC (rev 4847)
+++ trunk/notes/open-flash-chart notes.txt 2011-06-22 18:39:04 UTC (rev 4848)
@@ -1,4 +1,4 @@
-Open-Flash-Chart integration in Cumin.
+Open-Flash-Chart integration in Cumin.
Source code location and compilation:
@@ -10,4 +10,44 @@
+So, how does cumin use the charts?
+In the python code, when you have the need to draw a chart, you might use the code below.
+ chart = StatFlashChart(app, "submitted", scheduler)
+ chart.title = "Job totals"
+ chart.duration.param.default = "3600"
+ chart.stats = ("JobsSubmitted", "JobsStarted", "JobsCompleted")
+ charts.add_child(chart)
+This code sets up a StatFlashChart that will have the display title of “Job totals”, an initial duration off 1 hour (3600 seconds) and will be charting the stats (See rosemary.xml) JobsSubmitted, JobsStarted and JobsCompleted.
+When that page is rendered, you will see a block of JavaScript like the one below...
+
+ var flashversion = swfobject.getFlashPlayerVersion();
+ if (flashversion.major < 9) {
+ wooly.addPageUpdateListener(function () {if (document.images["main.grid.scheduler.view.body.overview.cycle.charts.submitted"].className == "Loading") return; cumin.updateChart("main.grid.scheduler.view.body.overview.cycle.charts.submitted");});
+ cumin.setupChart('main.grid.scheduler.view.body.overview.cycle.charts.submitted', 360);
+ } else {
+ swfobject.embedSWF("resource?name=open-flash-chart.swf", "main.grid.scheduler.view.body.overview.cycle.charts.submitted_chart", "360", "120", "9.0.0", "",
+ {"data-file":"chart.json?agent=com.redhat.grid|scheduler|croberts.redhat.com;object_id=croberts.redhat.com;chart_id=main.grid.scheduler.view.body.overview.cycle.charts.submitted;duration=3600;rpkg=com.redhat.grid;rcls=Scheduler;stat=JobsSubmitted;stat=JobsStarted;stat=JobsCompleted", "id":"main.grid.scheduler.view.body.overview.cycle.charts.submitted"}, {wmode: "opaque"});
+
+ wooly.addPageUpdateListener(function () { cumin.updateFlashChart('main.grid.scheduler.view.body.overview.cycle.charts.submitted'); });
+ window.addEvent('domready',function () {
+ cumin.setFullpageHandler('main.grid.scheduler.view.body.overview.cycle.charts.submitted', 'flashpage.html?agent=com.redhat.grid|scheduler|croberts.redhat.com;object_id=croberts.redhat.com;chart_id=main.grid.scheduler.view.body.overview.cycle.charts.submitted;duration=3600;rpkg=com.redhat.grid;rcls=Scheduler;stat=JobsSubmitted;stat=JobsStarted;stat=JobsCompleted');
+ });
+ }
+
+
+The code checks to be sure that the client has at least Flash 9 installed. Assuming that the check passes, the swfobject.embedSWF call is made to embed the flash object on the screen. You will also note that addPageUpdateListener gets called with the cumin.updateFlashChart (found in app.js) function with the chart id as the parameter. When the pageUPdateListener fires, it results in the cumin.updateFlashChart being called, which will make a call to the chart.get_ymax function...this function is actually in the ActionScript code. The mechanism for the callback is setup in main.as: ExternalInterface.addCallback("get_ymax", getYmax);
+That maps the external name “get_ymax” to the internal function getYmax. The getYmax() function eventually makes a call back to the JavaScript like this: ExternalInterface.call("got_ymax", id, this.URL, String(yaxis_max), String(yvals_max), String(control_min), String(control_max));
+
+The “got_ymax” javaScript function will cause the chart to be reloaded via a call to “chart.reload()”, which is another callback defined in main.as.
+
+Here is the flow of what happens when the chart is initialized:
+main() calls find_data() which looks for the 'data-file' parameter that was passed to the chart when it was embedded. In our case data-file is actually a URL that goes back into Cumin and fetches the JSON-formatted data. It then calls load_external_file with the URL specified in the 'data-file' parameter.
+
+load_external_file gets the URL and gets the content. It sets up a couple of eventListeners on the loader (IO_ERROR and COMPLETE) and then calls loader.load(). , when it completes, the COMPLETE eventListener will fire (the xmlLoaded function). XmlLoaded() calls parse_json.
+
+parse_json takes all of the data and goes through all of the values, building the structure required for all of the data points and then calls “build_chart(json)” to generate the actual chart.
+
+build_chart, first determines whether we are appending values to the current data set or not. If we are appending, it takes care of the appending and then calls resize(). If not either case, it continues on adding various Sprites as necessary depending on the chart type (radar, pie, “regular”). It then calls “resize()”, which will trigger the redrawing of the chart.
+
+For additional notes and examples, please see the json.help.txt file in <root>cumin/resources.
\ No newline at end of file
12 years, 11 months
r4847 - trunk/notes
by croberts@fedoraproject.org
Author: croberts
Date: 2011-06-22 12:05:19 +0000 (Wed, 22 Jun 2011)
New Revision: 4847
Added:
trunk/notes/open-flash-chart notes.txt
Log:
Initial set of notes for building and developing with the open-flash-chart library.
Added: trunk/notes/open-flash-chart notes.txt
===================================================================
--- trunk/notes/open-flash-chart notes.txt (rev 0)
+++ trunk/notes/open-flash-chart notes.txt 2011-06-22 12:05:19 UTC (rev 4847)
@@ -0,0 +1,13 @@
+Open-Flash-Chart integration in Cumin.
+
+Source code location and compilation:
+
+The home page for the open-flash-chart library is http://teethgrinder.co.uk/open-flash-chart-2/ . We are not using the stock library, but rather a Red Hat-modified version that has some customizations for use in cumin.
+
+The ActionScript 3 source code for our library is located in the <root>/cumin/open-flash-chart directory in the repository. It should be noted that the actual compiled .swf file that gets used at runtime does NOT live in the same directory as the source. The open-flash-chart.swf file lives in <root>/cumin/resources.
+
+Historically, we have used FlashDevelop to develop and compile the library. The homepage for FlashDevelop is: http://www.flashdevelop.org (currently only available on Windows). It is possible, with a few tweaks to compile the source on linux using the build.xml file in the source tree (it will require you installing the Open Source version of the Flex SDK). The required tweaks to build on Linux are: 1) comment out references to the FlashConnect utilities and 2) change the reference to the Arial font to a font that exists on the system you're working on (Bitstream Charter is what I've used).
+
+
+
+
12 years, 11 months
r4846 - in trunk/cumin: python/cumin resources
by croberts@fedoraproject.org
Author: croberts
Date: 2011-06-21 20:03:25 +0000 (Tue, 21 Jun 2011)
New Revision: 4846
Modified:
trunk/cumin/python/cumin/stat.py
trunk/cumin/resources/open-flash-chart.swf
Log:
Addressing BZ: https://bugzilla.redhat.com/show_bug.cgi?id=703621 The y-axis for charts is now computed based on the visible data points.
Modified: trunk/cumin/python/cumin/stat.py
===================================================================
--- trunk/cumin/python/cumin/stat.py 2011-06-21 18:05:08 UTC (rev 4845)
+++ trunk/cumin/python/cumin/stat.py 2011-06-21 20:03:25 UTC (rev 4846)
@@ -903,7 +903,7 @@
self.fix_method(method, mode),
mode, delta, stats,
end_seconds_ago=end_seconds_ago)
- max_value, min_value = self.get_max_min(session, stats, samples)
+ max_value, min_value = self.get_max_min(session, stats, samples, time_span, end_seconds_ago)
append = False
# if we should append the new samples, see if the y-axis has changed
@@ -920,7 +920,7 @@
self.fix_method(method, mode),
mode, False, stats,
end_seconds_ago=end_seconds_ago)
- max_value, min_value = self.get_max_min(session, stats, samples)
+ max_value, min_value = self.get_max_min(session, stats, samples, time_span, end_seconds_ago)
else:
append = True
@@ -1026,18 +1026,27 @@
return samples
- def get_max_min(self, session, stats, samples):
+ def get_max_min(self, session, stats, samples, time_span=99999, end_seconds_ago=0):
# take stddev into account for max and min y values
max_value = 0
min_value = 0
for stat in stats:
for x in samples[stat]:
- devmax = nvl(x[1], 0) + float(nvl(x[2], 0))
- devmin = nvl(x[1], 0) - float(nvl(x[2], 0))
- max_value = max(max_value, devmax)
- min_value = min(min_value, devmin)
+ try:
+ # Only compute the y-axis based on visible data
+ # be sure to factor-in end_seconds_ago and time_span
+ time_change = timedelta(seconds=end_seconds_ago)
+ window_adjusted_time = datetime.now() - time_change
+ if( (window_adjusted_time - x[0]).seconds <= int(time_span)):
+ devmax = nvl(x[1], 0) + float(nvl(x[2], 0))
+ devmin = nvl(x[1], 0) - float(nvl(x[2], 0))
+ max_value = max(max_value, devmax)
+ min_value = min(min_value, devmin)
+ except Exception, err:
+ log.debug(err)
+
max_value = round(max_value * 1.1 + 1)
if min_value < 0:
min_value = round(min_value * 1.1 - 1)
Modified: trunk/cumin/resources/open-flash-chart.swf
===================================================================
(Binary files differ)
12 years, 11 months
r4845 - trunk/cumin/open-flash-chart/elements/labels
by croberts@fedoraproject.org
Author: croberts
Date: 2011-06-21 18:05:08 +0000 (Tue, 21 Jun 2011)
New Revision: 4845
Modified:
trunk/cumin/open-flash-chart/elements/labels/Keys.as
Log:
Cosmetic fix, adjusting the background (white) of the key above a stat chart.
Modified: trunk/cumin/open-flash-chart/elements/labels/Keys.as
===================================================================
--- trunk/cumin/open-flash-chart/elements/labels/Keys.as 2011-06-21 18:04:34 UTC (rev 4844)
+++ trunk/cumin/open-flash-chart/elements/labels/Keys.as 2011-06-21 18:05:08 UTC (rev 4845)
@@ -202,7 +202,7 @@
// adding a white background rectangle to "clip" the tops off of any stray data points
this.graphics.beginFill(0xffffff);
- this.graphics.drawRect(this.x-2, this.y-10, this.stage.width - 80,26);
+ this.graphics.drawRect(this.x-2, this.y-10, this.stage.width - 100,25);
this.graphics.endFill();
12 years, 11 months
r4844 - trunk/cumin/open-flash-chart/elements/axis
by croberts@fedoraproject.org
Author: croberts
Date: 2011-06-21 18:04:34 +0000 (Tue, 21 Jun 2011)
New Revision: 4844
Modified:
trunk/cumin/open-flash-chart/elements/axis/XAxisLabels.as
Log:
Fix for proper compilation on the latest version of FlashDevelop/AS3.
Modified: trunk/cumin/open-flash-chart/elements/axis/XAxisLabels.as
===================================================================
--- trunk/cumin/open-flash-chart/elements/axis/XAxisLabels.as 2011-06-20 20:21:44 UTC (rev 4843)
+++ trunk/cumin/open-flash-chart/elements/axis/XAxisLabels.as 2011-06-21 18:04:34 UTC (rev 4844)
@@ -25,7 +25,7 @@
//[Embed(systemFont = 'Arial', fontName = 'spArial', mimeType = 'application/x-font'
// ,unicodeRange = 'ofcRange')
//]
- [Embed(systemFont = 'Arial', fontName = 'spArial', mimeType = 'application/x-font')]
+ [Embed(systemFont = 'Arial', embedAsCFF='false', advancedAntiAliasing='true', fontName = 'spArial', mimeType = 'application/x-font')]
public static var ArialFont__:Class;
12 years, 11 months
r4843 - in trunk/cumin/open-flash-chart: . elements/labels
by croberts@fedoraproject.org
Author: croberts
Date: 2011-06-20 20:21:44 +0000 (Mon, 20 Jun 2011)
New Revision: 4843
Modified:
trunk/cumin/open-flash-chart/elements/labels/Keys.as
trunk/cumin/open-flash-chart/main.as
trunk/cumin/open-flash-chart/tr.as
Log:
Addressing BZ: https://bugzilla.redhat.com/show_bug.cgi?id=703621 The key above each graph now has a white background rectangle that will serve to clip any data lines that might creep above the y-max value (since we "draw" one off-chart line and the y-axis scale is now only considering data that is in the current view.
Modified: trunk/cumin/open-flash-chart/elements/labels/Keys.as
===================================================================
--- trunk/cumin/open-flash-chart/elements/labels/Keys.as 2011-06-17 21:32:16 UTC (rev 4842)
+++ trunk/cumin/open-flash-chart/elements/labels/Keys.as 2011-06-20 20:21:44 UTC (rev 4843)
@@ -7,6 +7,7 @@
import flash.display.Sprite;
import flash.text.TextField;
import flash.text.TextFormat;
+ import flash.display.Shape;
import flash.filters.DropShadowFilter;
@@ -199,6 +200,12 @@
this.graphics.clear();
+ // adding a white background rectangle to "clip" the tops off of any stray data points
+ this.graphics.beginFill(0xffffff);
+ this.graphics.drawRect(this.x-2, this.y-10, this.stage.width - 80,26);
+ this.graphics.endFill();
+
+
for( var i:Number=0; i<this.numChildren; i++ )
{
var width:Number = this.getChildAt(i).width;
Modified: trunk/cumin/open-flash-chart/main.as
===================================================================
--- trunk/cumin/open-flash-chart/main.as 2011-06-17 21:32:16 UTC (rev 4842)
+++ trunk/cumin/open-flash-chart/main.as 2011-06-20 20:21:44 UTC (rev 4843)
@@ -850,9 +850,7 @@
this.radar_axis = new RadarAxis( json.radar_axis );
this.keys = new Keys( this.obs, json.legend );
- this.addChild( this.radar_axis );
- this.addChild( this.keys );
-
+ this.addChild( this.radar_axis );
}
else if ( !JsonInspector.has_pie_chart( json ) )
{
@@ -868,13 +866,13 @@
this.tooltip.set_tip_style( Tooltip.NORMAL );
this.keys = new Keys( this.obs, json.legend );
- this.addChild( this.keys );
}
// these are added in the Flash Z Axis order
this.addChild( this.title );
for each( var set:Sprite in this.obs.sets )
this.addChild( set );
+ this.addChild( this.keys ); // done here since we are using the background rectangle to "clip" stray data
this.addChild( this.tooltip );
if (json['menu'] != null) {
@@ -932,7 +930,6 @@
this.addChild( this.y_axis );
this.addChild( this.y_axis_right );
this.addChild( this.x_axis );
- this.addChild( this.keys );
// now these children have access to the stage,
// tell them to init
Modified: trunk/cumin/open-flash-chart/tr.as
===================================================================
--- trunk/cumin/open-flash-chart/tr.as 2011-06-17 21:32:16 UTC (rev 4842)
+++ trunk/cumin/open-flash-chart/tr.as 2011-06-20 20:21:44 UTC (rev 4843)
@@ -1,20 +1,28 @@
package {
- import org.flashdevelop.utils.FlashConnect;
+ //import org.flashdevelop.utils.FlashConnect;
import com.serialization.json.JSON;
+ import flash.external.ExternalInterface;
public class tr {
public static function ace( o:Object ):void {
- if ( o == null )
- FlashConnect.trace( 'null' );
- else
- FlashConnect.trace( o.toString() );
if ( false )
tr.trace_full();
}
//
+ // Log to the browser console, if available
+ //
+ public static function log(message:String):void {
+ if (ExternalInterface.available) {
+ message = "function(){if (window.console) console.log('" + message;
+ message += "');}";
+ ExternalInterface.call(message);
+ }
+ }
+
+ //
// e.g: tr.aces( 'my val', val );
//
public static function aces( ... optionalArgs ):void {
@@ -29,7 +37,7 @@
tmp.push( o.toString() );
}
- FlashConnect.trace( tmp.join(', ') );
+ // FlashConnect.trace( tmp.join(', ') );
}
// this doesn't work cos I don't know how to set 'permit debugging' yet
@@ -68,13 +76,13 @@
if (str == null) // means we aren't on the Debug player
{
- FlashConnect.trace( "(!debug) " );
+ //FlashConnect.trace( "(!debug) " );
}
else
{
var stacks:Array = str.split("\n"); // split into each line
var caller:String = tr.gimme_caller(stacks[snum]); // get the caller for just one specific line in the stack trace
- FlashConnect.trace( caller );
+ //FlashConnect.trace( caller );
}
}
12 years, 11 months
r4842 - trunk/cumin/etc
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-06-17 21:32:16 +0000 (Fri, 17 Jun 2011)
New Revision: 4842
Modified:
trunk/cumin/etc/sysvinit-cumin
Log:
Move additional sanity checks inside start command, start and status really
depend on nothing in the cumin install environment.
Modified: trunk/cumin/etc/sysvinit-cumin
===================================================================
--- trunk/cumin/etc/sysvinit-cumin 2011-06-17 16:54:24 UTC (rev 4841)
+++ trunk/cumin/etc/sysvinit-cumin 2011-06-17 21:32:16 UTC (rev 4842)
@@ -7,17 +7,6 @@
# pidfile: /var/run/cumin.pid
#
-# Sanity checks.
-test -x /usr/bin/cumin || {
- echo "/usr/bin/cumin has been removed"
- exit 1
-}
-
-test -x /usr/bin/cumin-database || {
- echo "/usr/bin/cumin-database has been removed"
- exit 1
-}
-
SYSCONFIG="/etc/sysconfig/cumin"
[ -r "$SYSCONFIG" ] && source "$SYSCONFIG"
@@ -39,6 +28,19 @@
exit 1
fi
+ # Sanity checks.
+ test -x /usr/bin/cumin || {
+ echo_failure; echo
+ echo "/usr/bin/cumin has been removed"
+ exit 1
+ }
+
+ test -x /usr/bin/cumin-database || {
+ echo_failure; echo
+ echo "/usr/bin/cumin-database has been removed"
+ exit 1
+ }
+
# Initial checks for the start case
cumin-database check-started &> /dev/null || {
echo_failure; echo
12 years, 11 months