geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ecr...@apache.org
Subject svn commit: r612294 - in /geronimo/server/trunk: applications/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/ applications/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/ plugins/dojo/geronimo-dojo/
Date Tue, 15 Jan 2008 23:07:10 GMT
Author: ecraig
Date: Tue Jan 15 15:07:09 2008
New Revision: 612294

URL: http://svn.apache.org/viewvc?rev=612294&view=rev
Log:
GERONIMO-3684

Upgrade Monitoring Client to use Dojo 1.0.2

Updated the dojo plugin so that all necessary files are included.
Made changes to the monitoring application so that graphs are drawn
using dojo 1.0.2, which is completely different from 0.4.3


Modified:
    geronimo/server/trunk/applications/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/GraphsBuilder.java
    geronimo/server/trunk/applications/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/StatsGraph.java
    geronimo/server/trunk/applications/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringPage.jsp
    geronimo/server/trunk/plugins/dojo/geronimo-dojo/pom.xml

Modified: geronimo/server/trunk/applications/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/GraphsBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/GraphsBuilder.java?rev=612294&r1=612293&r2=612294&view=diff
==============================================================================
--- geronimo/server/trunk/applications/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/GraphsBuilder.java
(original)
+++ geronimo/server/trunk/applications/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/GraphsBuilder.java
Tue Jan 15 15:07:09 2008
@@ -134,23 +134,18 @@
 
                 int skipCount = (int) ((timeFrame / (mrc.getSnapshotDuration() / 60000)))
                         / (snapCount - 2);
-                // ensure that we are at least looking at each snapshot (i.e. skipCount <-
1)
-                if(skipCount == 0) {
-                    skipCount = 1;
-                }
                 snapCount = snapCount + 2;
                 TreeMap<Long, Long> snapshotList1 = mrc
                         .getSpecificStatistics(mBeanName, dataName1, snapCount,
                                 skipCount, showArchive);
-                TreeMap<Long, Long> snapshotList2 = new TreeMap<Long, Long>();
-                // get the statistics for dataName2 if this graph has one
-                if(dataName2 != null && !dataName2.equals("null")) {
-                    mrc.getSpecificStatistics(mBeanName, dataName2, snapCount, skipCount,
showArchive);
+                TreeMap<Long, Long> snapshotList2 = new TreeMap<Long,Long>();
+                if ((dataName2 != null) && !dataName2.equals("time") && !dataName2.equals("null")
&& !dataName2.equals(""))
+                {
+                	snapshotList2 = mrc.getSpecificStatistics(mBeanName, dataName2, snapCount,
skipCount, showArchive);
                 }
                 // Check if snapshotList is empty
                 if (snapshotList1.size() == 0) {
                     snapshotList1.put(System.currentTimeMillis(), new Long(0));
-                    snapshotList2.put(System.currentTimeMillis(), new Long(0));
                     /*
                      * If there are not enough snapshots available to fill the
                      * requested number, insert some with values of 0 and the
@@ -165,6 +160,13 @@
                         // that to the tempMap
                         snapshotList1.put(
                                 (timeFix - (mrc.getSnapshotDuration() * skipCount)), new
Long(0));
+                    }
+                }
+                if (snapshotList2.size() == 0){
+                	snapshotList2.put(System.currentTimeMillis(), new Long(0));
+                	while (snapshotList2.size() < snapCount) {
+                        // Temporary, always is first element (oldest)
+                        Long timeFix = snapshotList2.firstKey();
                         snapshotList2.put(
                                 (timeFix - (mrc.getSnapshotDuration() * skipCount)), new
Long(0));
                     }
@@ -208,7 +210,7 @@
                             color, warninglevel1, warninglevel1));
                 } else if (dataName2 == null || dataName2.equals("null")
                         || dataName2.equals("")) {
-                    graph = (new StatsGraph(graph_id, ip + " - " + xlabel
+                     graph = (new StatsGraph(graph_id, ip + " - " + xlabel
                             + " - " + prettyTimeFrame, description, "Time - "
                             + prettyTimeFrame, ylabel,
                             data1operation.charAt(0), DataList.get(graphName1),
@@ -216,6 +218,7 @@
                                     .getSnapshotDuration() / 1000), timeFrame,
                             color, warninglevel1, warninglevel1));
                 } else {
+                	System.out.println("Using Null call.");
                     graph = (new StatsGraph());
                 }
             }
@@ -240,3 +243,4 @@
         return graph;
     }
 }
+

Modified: geronimo/server/trunk/applications/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/StatsGraph.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/StatsGraph.java?rev=612294&r1=612293&r2=612294&view=diff
==============================================================================
--- geronimo/server/trunk/applications/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/StatsGraph.java
(original)
+++ geronimo/server/trunk/applications/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/StatsGraph.java
Tue Jan 15 15:07:09 2008
@@ -63,216 +63,75 @@
         PointCount = dataSet1.size();
         HexColor = hexColor;
 
-        DivDefine = "#" + DivName + "\n" + "{\n" + "margin: 0px;\n"
-                + "width: 670px;\n" + "height: 240px;\n" + "}";
+        DivImplement = "<div id=\"" + DivName + "\" style=\"height: 220px;\"></div>"
+ "\n";
 
-        DivImplement = "<div id=\"" + DivName + "\"></div>" + "\n";
-
-        GraphJS = "var " + "graph" + graph_id + "Data = \n" + "[\n";
+        GraphJS = "var " + "graph" + graph_id + " = new dojox.charting.Chart2D(\""+DivName+"\");\n"+
+	"graph" + graph_id + ".addPlot(\"default\", {type: \"Areas\"});\n"+
+	"graph" + graph_id + ".setTheme(dojox.charting.themes.PlotKit.blue);\n";
+        
+        // Setup the x tick marks on the chart
+        Format formatter = new SimpleDateFormat("HH:mm");
+        if ((timeFrame / 1440) > 7)
+            formatter = new SimpleDateFormat("M/d");
+        else {
+            if ((timeFrame / 60) > 24)
+                formatter = new SimpleDateFormat("E a");
+            else {
+                formatter = new SimpleDateFormat("HH:mm");
+            }
+        }
+        GraphJS += "graph" + graph_id + ".addAxis(\"x\", {labels: [";
+        for (int i = 1; i < dataSet1.size(); i++) {
+            Date date = new Date((Long) snapshotTimes.get(i));
+            GraphJS += "{value: " + (i) + ", text: '" + formatter.format(date)
+                    + "' }, \n";
+        }
+        GraphJS += "]});\n";
+        GraphJS += "graph" + graph_id + ".addAxis(\"y\", {vertical: true});\n";
+        
+        GraphJS += "graph" + graph_id + ".addSeries(\"Series"+graph_id+"\", [";
         if (data1operation == 'D' && data2operation == 'D') {
             for (int i = 1; i < dataSet1.size(); i++) {
-                if (((Long) dataSet1.get(i) - (Long) dataSet1.get(i - 1)) < 0) {
+                if (((Long) dataSet1.get(i) - (Long) dataSet1.get(i - 1)) < 0)
                     dataSet1.set(i - 1, dataSet1.get(i));
-                    GraphJS = GraphJS
-                            + " { index: "
-                            + (i)
-                            + ", value: Math.round(("
-                            + ((Long) dataSet1.get(i) - (Long) dataSet1
-                                    .get(i - 1));
-                    // ensure there is not a division by 0
-                    GraphJS += appendOperation(operation, (Long) dataSet2.get(i) - (Long)
dataSet2.get(i - 1));
-                    GraphJS += ")*10)/10 },\n";
-                }
+                GraphJS = GraphJS + ((Long) dataSet1.get(i) - (Long) dataSet1.get(i - 1));
+                // ensure there is not a division by 0
+                GraphJS += appendOperation(operation, (Long) dataSet2.get(i) - (Long) dataSet2.get(i
- 1));
+                GraphJS += ",";
             }
         }
         if (data1operation == 'D' && data2operation != 'D')
+        {
             for (int i = 1; i < dataSet1.size(); i++) {
-                if (((Long) dataSet1.get(i) - (Long) dataSet1.get(i - 1)) < 0)
-                    dataSet1.set(i - 1, dataSet1.get(i));
-                GraphJS = GraphJS + " { index: " + (i)
-                        + ", value: Math.round(("
+                GraphJS = GraphJS
                         + ((Long) dataSet1.get(i) - (Long) dataSet1.get(i - 1));
                 // ensure there is not a division by 0
                 GraphJS += appendOperation(operation, (Long) dataSet2.get(i));
-                GraphJS += ")*10)/10 },\n";
+                GraphJS += ",";
             }
+        }
         if (data1operation != 'D' && data2operation == 'D')
+        {
             for (int i = 1; i < dataSet1.size(); i++) {
-                if (((Long) dataSet1.get(i) - (Long) dataSet1.get(i - 1)) < 0)
-                    dataSet1.set(i - 1, dataSet1.get(i));
-                GraphJS = GraphJS + " { index: " + (i)
-                        + ", value: Math.round((" + (dataSet1.get(i));
+                GraphJS = GraphJS + dataSet1.get(i);
                 // ensure there is not a division by 0
                 GraphJS += appendOperation(operation, (Long) dataSet2.get(i) - (Long) dataSet2.get(i
- 1));
-                GraphJS += ")*10)/10 },\n";
+                GraphJS += ",";
             }
+        }
         if (data1operation != 'D' && data2operation != 'D')
+        {
             for (int i = 1; i < dataSet1.size(); i++) {
-                if (((Long) dataSet1.get(i) - (Long) dataSet1.get(i - 1)) < 0) {
-                    dataSet1.set(i - 1, dataSet1.get(i));
-                }
-                GraphJS = GraphJS + " { index: " + (i)
-                        + ", value: Math.round((" + (dataSet1.get(i));
+                GraphJS = GraphJS + dataSet1.get(i);
                 // ensure there is not a division by 0
                 GraphJS += appendOperation(operation, (Long) dataSet2.get(i));
-                GraphJS += ")*10)/10 },\n";
-            }
-
-        GraphJS = GraphJS + "];\n";
-
-        GraphJS = GraphJS + "var " + "graph" + graph_id
-                + "Store = new dojo.collections.Store();\n";
-        GraphJS = GraphJS + "graph" + graph_id + "Store.setData(" + "graph"
-                + graph_id + "Data);\n";
-        GraphJS = GraphJS + "graph" + graph_id + "Max = 0;\n" + "graph"
-                + graph_id + "Min = 0;\n" + "graph" + graph_id + "Avg = 0;\n"
-                + "for (var i = 0; i<" + "graph" + graph_id
-                + "Data.length; i++)\n" + "{\n" + "graph" + graph_id
-                + "Max = Math.max(" + "graph" + graph_id + "Max," + "graph"
-                + graph_id + "Data[i].value);\n" + "graph" + graph_id
-                + "Min = Math.min(" + "graph" + graph_id + "Min," + "graph"
-                + graph_id + "Data[i].value);\n" + "graph" + graph_id
-                + "Avg = (" + "graph" + graph_id + "Avg + " + "graph"
-                + graph_id + "Data[i].value);\n" + "}\n" + "graph" + graph_id
-                + "Avg = Math.round(" + "graph" + graph_id + "Avg/" + "graph"
-                + graph_id + "Data.length*10)/10;\n" + "if (" + "graph"
-                + graph_id + "Max == 0)\n" + "graph" + graph_id + "Max = 1;\n";
-
-        // Setup the data series
-        GraphJS = GraphJS + "var " + "graph" + graph_id
-                + "Series = new dojo.charting.Series({\n";
-        GraphJS = GraphJS + "dataSource: " + "graph" + graph_id + "Store,\n";
-        GraphJS = GraphJS + "bindings: { x: \"index\", y: \"value\" },\n";
-        GraphJS = GraphJS + "label: \"" + "graph" + graph_id + "\"\n";
-        GraphJS = GraphJS + "});\n";
-
-        // Define the x-axis
-        GraphJS = GraphJS + "var " + "graph" + graph_id
-                + "xAxis = new dojo.charting.Axis(); \n";
-
-        // Set the upper and lower data range valuesprettyName
-        GraphJS = GraphJS + "graph" + graph_id + "xAxis.range = { lower: "
-                + "graph" + graph_id + "Data[0].index, upper: " + "graph"
-                + graph_id + "Data[" + "graph" + graph_id
-                + "Data.length-1].index };\n";
-
-        GraphJS = GraphJS + "graph" + graph_id + "xAxis.origin = \"" + "graph"
-                + graph_id + "Max\";\n";
-        GraphJS = GraphJS + "graph" + graph_id + "xAxis.showTicks = true;\n";
-        GraphJS = GraphJS + "graph" + graph_id + "xAxis.label = \""
-                + xAxisLabel + "\";\n";
-
-        // Setup the x tick marks on the chart
-        GraphJS = GraphJS + "graph" + graph_id + "xAxis.labels = [ \n";
-        // timeFrame = ((int) ((Long)snapshotTimes.get(0) - (Long)snapshotTimes
-        // .get(snapshotTimes.size() - 1)) / 60000);
-        Format formatter = new SimpleDateFormat("HH:mm");
-        if ((timeFrame / 1440) > 7)
-            formatter = new SimpleDateFormat("M/d");
-        else {
-            if ((timeFrame / 60) > 24)
-                formatter = new SimpleDateFormat("E a");
-            else {
-                // if (timeFrame > 60)
-                // formatter = new SimpleDateFormat("HH:mm");
-                // else
-                formatter = new SimpleDateFormat("HH:mm");
+                GraphJS += ",";
             }
         }
 
-        for (int i = 1; i < dataSet1.size(); i++) {
-            Date date = new Date((Long) snapshotTimes.get(i));
-            // System.out.println("StatsGraph Says: Time object "+i+" is
-            // "+snapshotTimes.get(i));
-            // System.out.println("StatsGraph Says: Time object "+i+" is
-            // "+formatter.format(date));
-            GraphJS = GraphJS + "{ label: '" + formatter.format(date)
-                    + "', value: " + (i) + " }, \n";
-        }
-        GraphJS = GraphJS + "];\n";
-        // Define the y-axis
-        GraphJS = GraphJS + "var " + "graph" + graph_id
-                + "yAxis = new dojo.charting.Axis();\n";
-        GraphJS = GraphJS + "graph" + graph_id + "yAxis.range = { lower: "
-                + "graph" + graph_id + "Min, upper: " + "graph" + graph_id
-                + "Max+(0.1*" + "graph" + graph_id + "Max)};\n";
-        GraphJS = GraphJS + "graph" + graph_id + "yAxis.showLines = true;\n";
-        GraphJS = GraphJS + "graph" + graph_id + "yAxis.showTicks = true;\n";
-        GraphJS = GraphJS + "graph" + graph_id + "yAxis.label = \""
-                + yAxisLabel + "\";\n";
-
-        // Setup the y tick marks on the chart
-        GraphJS = GraphJS + "graph" + graph_id + "yAxis.labels = [ \n";
-        GraphJS = GraphJS + "{ label: \"min - \"+" + "graph" + graph_id
-                + "Min, value: " + "graph" + graph_id + "Min },\n";
-        GraphJS = GraphJS + "{ label: \"avg - \"+" + "graph" + graph_id
-                + "Avg, value: " + "graph" + graph_id + "Avg },\n";
-        GraphJS = GraphJS + "{ label: \"max - \"+" + "graph" + graph_id
-                + "Max, value: " + "graph" + graph_id + "Max },\n";
-        GraphJS = GraphJS + "{ label: Math.round((" + "graph" + graph_id
-                + "Max+(0.1*" + "graph" + graph_id + "Max))), value: "
-                + "graph" + graph_id + "Max+(0.1*" + "graph" + graph_id
-                + "Max) },\n";
-        GraphJS = GraphJS + "];  \n";
-
-        // Create the actual graph with the x and y axes defined above
-        GraphJS = GraphJS + "var " + "graph" + graph_id
-                + "chartPlotArea = new dojo.charting.PlotArea();\n";
-        GraphJS = GraphJS + "var " + "graph" + graph_id
-                + "chartPlot = new dojo.charting.Plot(" + "graph" + graph_id
-                + "xAxis, " + "graph" + graph_id + "yAxis);\n";
-        GraphJS = GraphJS + "graph" + graph_id
-                + "chartPlotArea.initializePlot(" + "graph" + graph_id
-                + "chartPlot);\n";
-        // graphOutput.add(graphName+"xAxis.initializeLabels();");
-        // graphOutput.add(graphName+"xAxis.renderLabels("+graphName+"chartPlotArea,
-        // "+graphName+"chartPlot, '200', '10', 'LABEL');");
-
-        // Add the time series to the graph. The plotter will be a curved
-        // area graph.
-        // Other available plotters are:
-        // Bar, HorizontalBar, Gantt, StackedArea, StackedCurvedArea,
-        // HighLow, HighLowClose, HighLowOpenClose, Bubble,
-        // DataBar, Line, CurvedLine, Area, CurvedArea, Scatter
-
-        GraphJS = GraphJS + "graph" + graph_id + "chartPlot.addSeries({ \n";
-        GraphJS = GraphJS + "data: " + "graph" + graph_id + "Series,\n";
-        GraphJS = GraphJS + "plotter: dojo.charting.Plotters.CurvedArea\n";
-        GraphJS = GraphJS + "});\n";
-
-        // Define the plot area
-
-        GraphJS = GraphJS + "graph" + graph_id
-                + "chartPlotArea.size = { width: 650, height: 200 };\n";
-        GraphJS = GraphJS
-                + "graph"
-                + graph_id
-                + "chartPlotArea.padding = { top: 10, right: 20, bottom: 30, left: 80 };\n";
-
-        // Add the plot to the area
-        GraphJS = GraphJS + "graph" + graph_id + "chartPlotArea.plots.push("
-                + "graph" + graph_id + "chartPlot);\n";
-        // Simply use the next available color when plotting the time series
-        // plot
-        GraphJS = GraphJS + "graph" + graph_id + "Series.color = '#" + hexColor
-                + "';\n";
-
-        // Create the actual chart "canvas"
-        GraphJS = GraphJS + "var " + "graph" + graph_id
-                + "chart = new dojo.charting.Chart(null, \"" + "graph"
-                + graph_id
-                + "\", \"This is the example chart description\");\n";
-
-        // Add the plot area at an offset of 10 pixels from the top left
-        GraphJS = GraphJS + "graph" + graph_id + "chart.addPlotArea({ x: "
-                + dataSet1.size() + ", y: " + dataSet1.size() + ", plotArea: "
-                + "graph" + graph_id + "chartPlotArea });\n";
-
-        // Setup the chart to be added to the DOM on load
-        GraphJS = GraphJS + "dojo.addOnLoad(function()\n{\n" + "graph"
-                + graph_id + "chart.node = dojo.byId(\"" + DivName + "\");";
+        GraphJS = GraphJS + "]);\n";
 
-        GraphJS = GraphJS + "graph" + graph_id + "chart.render();\n});\n";
+        GraphJS = GraphJS + "graph" + graph_id + ".render();\n";
 
     }
 
@@ -293,192 +152,53 @@
         PointCount = dataSet1.size();
         HexColor = hexColor;
 
-        DivDefine = "#" + DivName + "\n" + "{\n" + "margin: 0px;\n"
-                + "width: 670px;\n" + "height: 240px;\n" + "}";
+        DivImplement = "<div id=\"" + DivName + "\" style=\"height: 220px;\"></div>"
+ "\n";
 
-        DivImplement = "<div id=\"" + DivName + "\"></div>" + "\n";
-
-        GraphJS = "var " + "graph" + graph_id + "Data = \n" + "[\n";
+        GraphJS = "var " + "graph" + graph_id + " = new dojox.charting.Chart2D(\""+DivName+"\");\n"+
+    	"graph" + graph_id + ".addPlot(\"default\", {type: \"Areas\"});\n"+
+    	"graph" + graph_id + ".setTheme(dojox.charting.themes.PlotKit.blue);\n";
+            
+            // Setup the x tick marks on the chart
+            Format formatter = new SimpleDateFormat("HH:mm");
+            if ((timeFrame / 1440) > 7)
+                formatter = new SimpleDateFormat("M/d");
+            else {
+                if ((timeFrame / 60) > 24)
+                    formatter = new SimpleDateFormat("E a");
+                else {
+                    formatter = new SimpleDateFormat("HH:mm");
+                }
+            }
+            GraphJS += "graph" + graph_id + ".addAxis(\"x\", {labels: [";
+            for (int i = 1; i < dataSet1.size(); i++) {
+                Date date = new Date((Long) snapshotTimes.get(i));
+                GraphJS += "{value: " + (i) + ", text: '" + formatter.format(date)
+                        + "' }, \n";
+            }
+            GraphJS += "]});\n";
+            GraphJS += "graph" + graph_id + ".addAxis(\"y\", {vertical: true});\n";
+            
+            GraphJS += "graph" + graph_id + ".addSeries(\"Series"+graph_id+"\", [";
         if (data1operation == 'D')
             for (int i = 1; i < dataSet1.size(); i++) {
-                if (((Long) dataSet1.get(i) - (Long) dataSet1.get(i - 1)) < 0)
-                    dataSet1.set(i - 1, dataSet1.get(i));
-                GraphJS = GraphJS + " { index: " + (i)
-                        + ", value: Math.round(("
-                        + ((Long) dataSet1.get(i) - (Long) dataSet1.get(i - 1))
-                        + operation + ")*10)/10 },\n";
+                GraphJS = GraphJS + ((Long) dataSet1.get(i) - (Long) dataSet1.get(i - 1))
+                        + operation + ",\n";
             }
         if (data1operation != 'D')
             for (int i = 1; i < dataSet1.size(); i++) {
-                if (((Long) dataSet1.get(i) - (Long) dataSet1.get(i - 1)) < 0)
-                    dataSet1.set(i - 1, dataSet1.get(i));
-                GraphJS = GraphJS + " { index: " + (i)
-                        + ", value: Math.round((" + (dataSet1.get(i))
-                        + operation + ")*10)/10 },\n";
+                GraphJS = GraphJS + dataSet1.get(i)
+                        + operation + ",\n";
             }
 
-        GraphJS = GraphJS + "];\n";
-
-        GraphJS = GraphJS + "var " + "graph" + graph_id
-                + "Store = new dojo.collections.Store();\n";
-        GraphJS = GraphJS + "graph" + graph_id + "Store.setData(" + "graph"
-                + graph_id + "Data);\n";
-        GraphJS = GraphJS + "graph" + graph_id + "Max = 0;\n" + "graph"
-                + graph_id + "Min = 0;\n" + "graph" + graph_id + "Avg = 0;\n"
-                + "for (var i = 0; i<" + "graph" + graph_id
-                + "Data.length; i++)\n" + "{\n" + "graph" + graph_id
-                + "Max = Math.max(" + "graph" + graph_id + "Max," + "graph"
-                + graph_id + "Data[i].value);\n" + "graph" + graph_id
-                + "Min = Math.min(" + "graph" + graph_id + "Min," + "graph"
-                + graph_id + "Data[i].value);\n" + "graph" + graph_id
-                + "Avg = (" + "graph" + graph_id + "Avg + " + "graph"
-                + graph_id + "Data[i].value);\n" + "}\n" + "graph" + graph_id
-                + "Avg = Math.round(" + "graph" + graph_id + "Avg/" + "graph"
-                + graph_id + "Data.length*10)/10;\n" + "if (" + "graph"
-                + graph_id + "Max == 0)\n" + "graph" + graph_id + "Max = 1;\n";
-
-        // Setup the data series
-        GraphJS = GraphJS + "var " + "graph" + graph_id
-                + "Series = new dojo.charting.Series({\n";
-        GraphJS = GraphJS + "dataSource: " + "graph" + graph_id + "Store,\n";
-        GraphJS = GraphJS + "bindings: { x: \"index\", y: \"value\" },\n";
-        GraphJS = GraphJS + "label: \"" + "graph" + graph_id + "\"\n";
-        GraphJS = GraphJS + "});\n";
-
-        // Define the x-axis
-        GraphJS = GraphJS + "var " + "graph" + graph_id
-                + "xAxis = new dojo.charting.Axis(); \n";
-
-        // Set the upper and lower data range valuesprettyName
-        GraphJS = GraphJS + "graph" + graph_id + "xAxis.range = { lower: "
-                + "graph" + graph_id + "Data[0].index, upper: " + "graph"
-                + graph_id + "Data[" + "graph" + graph_id
-                + "Data.length-1].index };\n";
-
-        GraphJS = GraphJS + "graph" + graph_id + "xAxis.origin = \"" + "graph"
-                + graph_id + "Max\";\n";
-        GraphJS = GraphJS + "graph" + graph_id + "xAxis.showTicks = true;\n";
-        GraphJS = GraphJS + "graph" + graph_id + "xAxis.label = \""
-                + xAxisLabel + "\";\n";
-
-        // Setup the x tick marks on the chart
-        GraphJS = GraphJS + "graph" + graph_id + "xAxis.labels = [ \n";
-        // timeFrame = ((int) ((Long)snapshotTimes.get(0) - (Long)snapshotTimes
-        // .get(snapshotTimes.size() - 1)) / 60000);
-        Format formatter = new SimpleDateFormat("HH:mm");
-        if ((timeFrame / 1440) > 7)
-            formatter = new SimpleDateFormat("M/d");
-        else {
-            if ((timeFrame / 60) > 24)
-                formatter = new SimpleDateFormat("E a");
-            else {
-                // if (timeFrame > 60)
-                // formatter = new SimpleDateFormat("HH:mm");
-                // else
-                formatter = new SimpleDateFormat("HH:mm");
-            }
-        }
-
-        for (int i = 1; i < dataSet1.size(); i++) {
-            Date date = new Date((Long) snapshotTimes.get(i));
-            // System.out.println("StatsGraph Says: Time object "+i+" is
-            // "+snapshotTimes.get(i));
-            // System.out.println("StatsGraph Says: Time object "+i+" is
-            // "+formatter.format(date));
-            GraphJS = GraphJS + "{ label: '" + formatter.format(date)
-                    + "', value: " + (i) + " }, \n";
-        }
-        GraphJS = GraphJS + "];\n";
-        // Define the y-axis
-        GraphJS = GraphJS + "var " + "graph" + graph_id
-                + "yAxis = new dojo.charting.Axis();\n";
-        GraphJS = GraphJS + "graph" + graph_id + "yAxis.range = { lower: "
-                + "graph" + graph_id + "Min, upper: " + "graph" + graph_id
-                + "Max+(0.1*" + "graph" + graph_id + "Max)};\n";
-        GraphJS = GraphJS + "graph" + graph_id + "yAxis.showLines = true;\n";
-        GraphJS = GraphJS + "graph" + graph_id + "yAxis.showTicks = true;\n";
-        GraphJS = GraphJS + "graph" + graph_id + "yAxis.label = \""
-                + yAxisLabel + "\";\n";
-
-        // Setup the y tick marks on the chart
-        GraphJS = GraphJS + "graph" + graph_id + "yAxis.labels = [ \n";
-        GraphJS = GraphJS + "{ label: \"min - \"+" + "graph" + graph_id
-                + "Min, value: " + "graph" + graph_id + "Min },\n";
-        GraphJS = GraphJS + "{ label: \"avg - \"+" + "graph" + graph_id
-                + "Avg, value: " + "graph" + graph_id + "Avg },\n";
-        GraphJS = GraphJS + "{ label: \"max - \"+" + "graph" + graph_id
-                + "Max, value: " + "graph" + graph_id + "Max },\n";
-        GraphJS = GraphJS + "{ label: Math.round((" + "graph" + graph_id
-                + "Max+(0.1*" + "graph" + graph_id + "Max))), value: "
-                + "graph" + graph_id + "Max+(0.1*" + "graph" + graph_id
-                + "Max) },\n";
-        GraphJS = GraphJS + "];  \n";
-
-        // Create the actual graph with the x and y axes defined above
-        GraphJS = GraphJS + "var " + "graph" + graph_id
-                + "chartPlotArea = new dojo.charting.PlotArea();\n";
-        GraphJS = GraphJS + "var " + "graph" + graph_id
-                + "chartPlot = new dojo.charting.Plot(" + "graph" + graph_id
-                + "xAxis, " + "graph" + graph_id + "yAxis);\n";
-        GraphJS = GraphJS + "graph" + graph_id
-                + "chartPlotArea.initializePlot(" + "graph" + graph_id
-                + "chartPlot);\n";
-        // graphOutput.add(graphName+"xAxis.initializeLabels();");
-        // graphOutput.add(graphName+"xAxis.renderLabels("+graphName+"chartPlotArea,
-        // "+graphName+"chartPlot, '200', '10', 'LABEL');");
-
-        // Add the time series to the graph. The plotter will be a curved
-        // area graph.
-        // Other available plotters are:
-        // Bar, HorizontalBar, Gantt, StackedArea, StackedCurvedArea,
-        // HighLow, HighLowClose, HighLowOpenClose, Bubble,
-        // DataBar, Line, CurvedLine, Area, CurvedArea, Scatter
-
-        GraphJS = GraphJS + "graph" + graph_id + "chartPlot.addSeries({ \n";
-        GraphJS = GraphJS + "data: " + "graph" + graph_id + "Series,\n";
-        GraphJS = GraphJS + "plotter: dojo.charting.Plotters.CurvedArea\n";
-        GraphJS = GraphJS + "});\n";
-
-        // Define the plot area
-
-        GraphJS = GraphJS + "graph" + graph_id
-                + "chartPlotArea.size = { width: 650, height: 200 };\n";
-        GraphJS = GraphJS
-                + "graph"
-                + graph_id
-                + "chartPlotArea.padding = { top: 10, right: 20, bottom: 30, left: 80 };\n";
-
-        // Add the plot to the area
-        GraphJS = GraphJS + "graph" + graph_id + "chartPlotArea.plots.push("
-                + "graph" + graph_id + "chartPlot);\n";
-        // Simply use the next available color when plotting the time series
-        // plot
-        GraphJS = GraphJS + "graph" + graph_id + "Series.color = '#" + hexColor
-                + "';\n";
-
-        // Create the actual chart "canvas"
-        GraphJS = GraphJS + "var " + "graph" + graph_id
-                + "chart = new dojo.charting.Chart(null, \"" + "graph"
-                + graph_id
-                + "\", \"This is the example chart description\");\n";
-
-        // Add the plot area at an offset of 10 pixels from the top left
-        GraphJS = GraphJS + "graph" + graph_id + "chart.addPlotArea({ x: "
-                + dataSet1.size() + ", y: " + dataSet1.size() + ", plotArea: "
-                + "graph" + graph_id + "chartPlotArea });\n";
-
-        // Setup the chart to be added to the DOM on load
-        GraphJS = GraphJS + "dojo.addOnLoad(function()\n{\n" + "graph"
-                + graph_id + "chart.node = dojo.byId(\"" + DivName + "\");";
-
-        GraphJS = GraphJS + "graph" + graph_id + "chart.render();\n});\n";
+        GraphJS = GraphJS + "]);\n";
 
+        GraphJS = GraphJS + "graph" + graph_id + ".render();\n";
     }
 
     private String appendOperation(String operation, Long number) {
         String retval = "";
         // ensure there is not a division by 0
-        if (operation.equals("/") && number == 0) {
+        if (operation.endsWith("/") && number == 0) {
             retval += "*0";
         } else {
             retval += operation + number;
@@ -542,3 +262,4 @@
         return HexColor;
     }
 }
+

Modified: geronimo/server/trunk/applications/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringPage.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringPage.jsp?rev=612294&r1=612293&r2=612294&view=diff
==============================================================================
--- geronimo/server/trunk/applications/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringPage.jsp
(original)
+++ geronimo/server/trunk/applications/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringPage.jsp
Tue Jan 15 15:07:09 2008
@@ -76,20 +76,7 @@
     
 %>
 <!-- <head> -->
-    <style type='text/css'>
-    <% 
-    try
-    {
-    for (StatsGraph graph : graphs) 
-            out.println(graph.getDiv());
-    }
-    catch (Exception e)
-    {
-        
-    }
-    %>
-    </style>
-    <script type='text/javascript' src='/dojo/dojo.js'>
+    <script type='text/javascript' src='/dojo/1.0/dojo/dojo.js' djConfig='isDebug: false,
parseOnLoad: true'>
     </script>
         <script type = "text/javascript">
 <!--
@@ -102,17 +89,18 @@
 //-->
 </script>
     <script type='text/javascript'>
-    var dojoConfig =
-    {
-        isDebug:true
-    };
-    dojo.require("dojo.collections.Store");
-    dojo.require("dojo.charting.Chart");
-    dojo.require('dojo.json');
+dojo.require("dojox.charting.Chart2D");
+dojo.require("dojox.charting.themes.PlotKit.blue");
+dojo.require("dojox.fx.easing");
+
+makeObjects = function(){
     <% for (StatsGraph graph : graphs)
        out.println(graph.getJS());
 
     %>
+};
+
+dojo.addOnLoad(makeObjects);
     </script>
 <!-- </head> -->
 
@@ -266,7 +254,3 @@
     </tr>
 </table>
     <%}%>
-
-
-
-

Modified: geronimo/server/trunk/plugins/dojo/geronimo-dojo/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/dojo/geronimo-dojo/pom.xml?rev=612294&r1=612293&r2=612294&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/dojo/geronimo-dojo/pom.xml (original)
+++ geronimo/server/trunk/plugins/dojo/geronimo-dojo/pom.xml Tue Jan 15 15:07:09 2008
@@ -90,11 +90,11 @@
                         <resource>
                             <directory>${project.build.directory}/dojo-release-${dojoVersion}/</directory>
                             <includes>
-                                <include>src/**</include>
-                                <include>*.js</include>
-                                <include>*.html</include>
-                                <include>*.swf</include>
-                                <include>LICENSE</include>
+                                <include>**</include>
+                                <include>dojo/**</include>
+                                <include>dojox/**</include>
+                                <include>util/**</include>
+                                <include>dijit/**</include>
                             </includes>
                         </resource>
                         



Mime
View raw message