You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ak...@apache.org on 2007/10/03 22:21:29 UTC
svn commit: r581714 [2/2] - in /geronimo/sandbox/monitoring: client/
client/client-ear/ client/client-ear/src/ client/client-ear/src/main/
client/client-ear/src/main/resources/
client/client-ear/src/main/resources/META-INF/ client/client-war/
client/cl...
Added: geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MonitoringPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MonitoringPortlet.java?rev=581714&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MonitoringPortlet.java (added)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MonitoringPortlet.java Wed Oct 3 13:21:26 2007
@@ -0,0 +1,171 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.plugins.monitoring.client;
+
+import java.io.IOException;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.util.ArrayList;
+import java.util.Vector;
+import java.util.Set;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.WindowState;
+
+import org.apache.geronimo.plugins.monitoring.client.GraphsBuilder;
+import org.apache.geronimo.plugins.monitoring.client.util.DBManager;
+/**
+ * STATS
+ */
+public class MonitoringPortlet extends GenericPortlet {
+
+ private static final String MBEAN_JSP = "/WEB-INF/view/monitoringMbean.jsp";
+
+ private static final String TIMEFRAME_JSP = "/WEB-INF/view/monitoringTimeframe.jsp";
+
+ private static final String MAXIMIZEDVIEW_JSP = "/WEB-INF/view/monitoringMaximized.jsp";
+
+ private static final String HELPVIEW_JSP = "/WEB-INF/view/monitoringHelp.jsp";
+
+ private PortletRequestDispatcher mBeanView;
+
+ private PortletRequestDispatcher timeFrameView;
+
+ private PortletRequestDispatcher maximizedView;
+
+ private PortletRequestDispatcher helpView;
+
+ public void processAction(ActionRequest actionRequest,
+ ActionResponse actionResponse) throws PortletException, IOException {
+ actionResponse.setRenderParameter("time", actionRequest.getParameter("time"));
+ actionResponse.setRenderParameter("mode", actionRequest.getParameter("mode"));
+ if (actionRequest.getParameter("mode").equals("mbean")) {
+ actionResponse.setRenderParameter("bean", actionRequest.getParameter("bean"));
+ }
+ }
+
+ public void doView(RenderRequest request, RenderResponse response)
+ throws PortletException, IOException {
+ Integer timeFrame = 60;
+ String mode = "mbean";
+ String bean = "TomcatWebConnector";
+ if (request.getParameter("time") != null)
+ timeFrame = Integer.parseInt(request.getParameter("time"));
+ if (request.getParameter("mode") != null)
+ mode = request.getParameter("mode");
+ if (request.getParameter("bean") != null)
+ bean = request.getParameter("bean");
+ response.setProperty("time", timeFrame.toString());
+ response.setProperty("mode", mode);
+
+ try {
+
+ /* //DBBBBB_--------
+ Connection con = DBManager.getConnection();
+
+ PreparedStatement pStmt = con.prepareStatement("CREATE TABLE mrc_servers(server_id INTEGER PRIMARY KEY, server_ip VARCHAR(15), username VARCHAR(128), password VARCHAR(1024) )");
+ pStmt.executeUpdate();
+ pStmt = con.prepareStatement("INSERT INTO mrc_servers VALUES(0, '127.0.0.1', 'system', 'manager')");
+ pStmt.executeUpdate();
+ pStmt = con.prepareStatement("INSERT INTO mrc_servers VALUES(1, '127.0.0.2', 'system', 'manager')");
+ pStmt.executeUpdate();
+ pStmt = con.prepareStatement("SELECT * FROM mrc_servers");
+ ResultSet rs = pStmt.executeQuery();
+
+ while(rs.next()){
+
+ Integer server_id = rs.getInt("server_id");
+ String server_ip = rs.getString("server_ip");
+ String username = rs.getString("username");
+ String password = rs.getString("password");
+
+ System.out.println(server_id);
+ System.out.println(server_ip);
+ System.out.println(username);
+ System.out.println(password);
+ }
+ //DBBBBB_--------*/
+ GraphsBuilder run = new GraphsBuilder(0);
+ if (mode.equals("mbean")) {
+ Vector <StatsGraph> GraphVector = run.BuildOnMbean(14, timeFrame, bean);
+ Set <String> trackedBeans = run.GetTrackedBeansPretty();
+ request.setAttribute("GraphVector", GraphVector);
+ request.setAttribute("trackedBeans", trackedBeans);
+ if (WindowState.MINIMIZED.equals(request.getWindowState())) {
+ return;
+ } else
+ mBeanView.include(request, response);
+ }
+ if (mode.equals("timeframe")) {
+ Vector <StatsGraph> GraphVector = run.BuildAllOnTimeFrame(14, timeFrame);
+ Set <String> trackedBeans = run.GetTrackedBeansPretty();
+ request.setAttribute("GraphVector", GraphVector);
+ request.setAttribute("trackedBeans", trackedBeans);
+ if (WindowState.MINIMIZED.equals(request.getWindowState())) {
+ return;
+ } else
+ timeFrameView.include(request, response);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ //if (WindowState.MINIMIZED.equals(request.getWindowState())) {
+ //return;
+ //}
+
+ //if (WindowState.NORMAL.equals(request.getWindowState())) {
+ // normalView.include(request, response);
+ //} else {
+ // maximizedView.include(request, response);
+ //}
+
+ }
+
+ protected void doHelp(RenderRequest renderRequest,
+ RenderResponse renderResponse) throws PortletException, IOException {
+ helpView.include(renderRequest, renderResponse);
+ }
+
+ public void init(PortletConfig portletConfig) throws PortletException {
+ super.init(portletConfig);
+ mBeanView = portletConfig.getPortletContext().getRequestDispatcher(
+ MBEAN_JSP);
+ timeFrameView = portletConfig.getPortletContext().getRequestDispatcher(
+ TIMEFRAME_JSP);
+ maximizedView = portletConfig.getPortletContext().getRequestDispatcher(
+ MAXIMIZEDVIEW_JSP);
+ helpView = portletConfig.getPortletContext().getRequestDispatcher(
+ HELPVIEW_JSP);
+ }
+
+ public void destroy() {
+ mBeanView = null;
+ timeFrameView = null;
+ maximizedView = null;
+ helpView = null;
+ super.destroy();
+ }
+}
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MonitoringPortlet.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MonitoringPortlet.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MonitoringPortlet.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/StatsGraph.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/StatsGraph.java?rev=581714&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/StatsGraph.java (added)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/StatsGraph.java Wed Oct 3 13:21:26 2007
@@ -0,0 +1,480 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.plugins.monitoring.client;
+
+import java.text.Format;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Vector;
+import java.lang.Character;
+
+public class StatsGraph {
+ private String GraphName;
+ private String DivName;
+ private String PrettyName;
+ private String DivDefine;
+ private String DivImplement;
+ private String XAxisLabel;
+ private String YAxisLabel;
+ private int SnapshotDuration;
+ private int TimeFrame;
+ private int PointCount;
+ private String HexColor;
+ private String GraphJS;
+
+ public StatsGraph(String graphName, String prettyName, String xAxisLabel, String yAxisLabel, Vector<Object> dataSet1, Character operation, Vector<Object> dataSet2, Vector<Object> snapshotTimes, int snapshotDuration, int timeFrame, String hexColor)
+ {
+
+ DivName = graphName +"Container";
+ GraphName = graphName;
+ PrettyName = prettyName;
+ XAxisLabel = xAxisLabel;
+ YAxisLabel = yAxisLabel;
+ SnapshotDuration = snapshotDuration;
+ TimeFrame = timeFrame;
+ PointCount = dataSet1.size();
+ HexColor = hexColor;
+
+ DivDefine = "#" + DivName + "\n" +
+ "{\n" +
+ "margin: 0px;\n" +
+ "background-color: #"+hexColor+"\n" +
+ "border: 1px solid #999;\n" +
+ "width: 750px;\n" +
+ "height: 260px;\n" +
+ "}";
+
+ DivImplement = "<tr><td>\n" +
+ "<div id=\""+DivName+"\"></div><br>\n" +
+ "</td></tr>\n";
+
+ GraphJS = "var " + graphName + "Data = \n" +
+ "[\n";
+
+ 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+((Long)dataSet2.get(i)-(Long)dataSet2.get(i-1))+")*10)/10 },\n";
+ //System.out.println("StatsGraph Says: Data object "+i+" is "+dataSet2.get(i));
+ }
+
+ GraphJS = GraphJS+"];\n";
+
+
+ GraphJS = GraphJS+"var " + graphName
+ + "Store = new dojo.collections.Store();\n";
+ GraphJS = GraphJS+graphName + "Store.setData(" + graphName + "Data);\n";
+ GraphJS = GraphJS+graphName + "Max = 0;\n" +
+ graphName + "Min = 0;\n" +
+ graphName + "Avg = 0;\n" +
+ "for (var i = 0; i<"+ graphName + "Data.length; i++)\n" +
+ "{\n" +
+ graphName + "Max = Math.max(" + graphName + "Max," + graphName+ "Data[i].value);\n" +
+ graphName + "Min = Math.min("+ graphName + "Min," + graphName + "Data[i].value);\n"
+ + graphName + "Avg = (" + graphName + "Avg + " + graphName
+ + "Data[i].value);\n" + "}\n" + graphName
+ + "Avg = Math.round(" + graphName + "Avg/" + graphName
+ + "Data.length*10)/10;\n" + "if (" + graphName + "Max == 0)\n"
+ + graphName + "Max = 1;\n";
+
+ // Setup the data series
+ GraphJS = GraphJS+"var " + graphName
+ + "Series = new dojo.charting.Series({\n";
+ GraphJS = GraphJS+"dataSource: " + graphName + "Store,\n";
+ GraphJS = GraphJS+"bindings: { x: \"index\", y: \"value\" },\n";
+ GraphJS = GraphJS+"label: \"" + graphName + "\"\n";
+ GraphJS = GraphJS+"});\n";
+
+ // Define the x-axis
+ GraphJS = GraphJS+"var " + graphName + "xAxis = new dojo.charting.Axis(); \n";
+
+ // Set the upper and lower data range valuesprettyName
+ GraphJS = GraphJS+graphName + "xAxis.range = { lower: "
+ + graphName + "Data[0].index, upper: " + graphName
+ + "Data[" + graphName + "Data.length-1].index };\n";
+
+ GraphJS = GraphJS+graphName + "xAxis.origin = \"" + graphName
+ + "Max\";\n";
+ GraphJS = GraphJS+graphName + "xAxis.showTicks = true;\n";
+ GraphJS = GraphJS+graphName + "xAxis.label = \"" + prettyName + "\";\n";
+
+ // Setup the x tick marks on the chart
+ GraphJS = GraphJS+graphName + "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 " + graphName
+ + "yAxis = new dojo.charting.Axis();\n";
+ GraphJS = GraphJS+graphName + "yAxis.range = { lower: " + graphName
+ + "Min, upper: " + graphName + "Max+(0.1*"+graphName+"Max)};\n";
+ GraphJS = GraphJS+graphName + "yAxis.showLines = true;\n";
+ GraphJS = GraphJS+graphName + "yAxis.showTicks = true;\n";
+ GraphJS = GraphJS+graphName + "yAxis.label = \"" + yAxisLabel + "\";\n";
+
+ // Setup the y tick marks on the chart
+ GraphJS = GraphJS+graphName + "yAxis.labels = [ \n";
+ GraphJS = GraphJS+"{ label: \"min - \"+" + graphName + "Min, value: "
+ + graphName + "Min },\n";
+ GraphJS = GraphJS+"{ label: \"avg - \"+" + graphName + "Avg, value: "
+ + graphName + "Avg },\n";
+ GraphJS = GraphJS+"{ label: \"max - \"+" + graphName + "Max, value: "
+ + graphName + "Max },\n";
+ GraphJS = GraphJS+"{ label: Math.round(("+ graphName + "Max+(0.1*"+graphName+"Max))), value: "
+ + graphName + "Max+(0.1*"+graphName+"Max) },\n";
+ GraphJS = GraphJS+"]; \n";
+
+ // Create the actual graph with the x and y axes defined above
+ GraphJS = GraphJS+"var " + graphName
+ + "chartPlotArea = new dojo.charting.PlotArea();\n";
+ GraphJS = GraphJS+"var " + graphName
+ + "chartPlot = new dojo.charting.Plot(" + graphName
+ + "xAxis, " + graphName + "yAxis);\n";
+ GraphJS = GraphJS+graphName + "chartPlotArea.initializePlot("
+ + graphName + "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+graphName + "chartPlot.addSeries({ \n";
+ GraphJS = GraphJS+"data: " + graphName + "Series,\n";
+ GraphJS = GraphJS+"plotter: dojo.charting.Plotters.CurvedArea\n";
+ GraphJS = GraphJS+"});\n";
+
+ // Define the plot area
+
+ GraphJS = GraphJS+graphName
+ + "chartPlotArea.size = { width: 650, height: 200 };\n";
+ GraphJS = GraphJS+graphName
+ + "chartPlotArea.padding = { top: 30, right: 20, bottom: 30, left: 80 };\n";
+
+ // Add the plot to the area
+ GraphJS = GraphJS+graphName + "chartPlotArea.plots.push(" + graphName
+ + "chartPlot);\n";
+ // Simply use the next available color when plotting the time series
+ // plot
+ GraphJS = GraphJS+graphName + "Series.color = '#"+hexColor+"';\n";
+
+ // Create the actual chart "canvas"
+ GraphJS = GraphJS+"var " + graphName
+ + "chart = new dojo.charting.Chart(null, \"" + graphName
+ + "\", \"This is the example chart description\");\n";
+
+ // Add the plot area at an offset of 10 pixels from the top left
+ GraphJS = GraphJS+graphName + "chart.addPlotArea({ x: "
+ + dataSet1.size() + ", y: " + dataSet1.size()
+ + ", plotArea: " + graphName + "chartPlotArea });\n";
+
+ // Setup the chart to be added to the DOM on load
+ GraphJS = GraphJS+"dojo.addOnLoad(function()\n{\n"+graphName + "chart.node = dojo.byId(\"" + DivName +"\");";
+
+ GraphJS = GraphJS+graphName + "chart.render();\n});\n";
+
+ }
+
+ public StatsGraph(String graphName, String prettyName, String xAxisLabel, String yAxisLabel, Vector<Long> dataSet1, Character operation, Vector<Long> dataSet2, Vector<Long> snapshotTimes, int snapshotDuration, int timeFrame, int pointCount)
+ {
+
+ }
+
+ public StatsGraph(String graphName, String prettyName, String xAxisLabel, String yAxisLabel, Vector<Long> dataSet1, Character operation, Vector<Long> dataSet2, Vector<Long> snapshotTimes, int snapshotDuration, int timeFrame)
+ {
+
+ }
+
+ public StatsGraph(String graphName, String prettyName, String xAxisLabel, String yAxisLabel, Vector<Object> dataSet1, Vector<Object> snapshotTimes, int snapshotDuration, int timeFrame, String hexColor)
+ {
+ DivName = graphName +"Container";
+ GraphName = graphName;
+ PrettyName = prettyName;
+ XAxisLabel = xAxisLabel;
+ YAxisLabel = yAxisLabel;
+ SnapshotDuration = snapshotDuration;
+ TimeFrame = timeFrame;
+ PointCount = dataSet1.size();
+ HexColor = hexColor;
+
+ DivDefine = "#" + DivName + "\n" +
+ "{\n" +
+ "margin: 0px;\n" +
+ "background-color: #"+hexColor+"\n" +
+ "border: 1px solid #999;\n" +
+ "width: 750px;\n" +
+ "height: 260px;\n" +
+ "}";
+
+ DivImplement = "<tr><td>\n" +
+ "<div id=\""+DivName+"\"></div><br>\n" +
+ "</td></tr>\n";
+
+ GraphJS = "var " + graphName + "Data = \n" +
+ "[\n";
+
+ for (int i = 1; i < dataSet1.size(); i++) {
+ GraphJS = GraphJS+" { index: " + (i) + ", value: Math.round(("+(Long)dataSet1.get(i)+")*10)/10 },\n";
+ //System.out.println("StatsGraph Says: Data object "+i+" is "+dataSet2.get(i));
+ }
+
+ GraphJS = GraphJS+"];\n";
+
+
+ GraphJS = GraphJS+"var " + graphName
+ + "Store = new dojo.collections.Store();\n";
+ GraphJS = GraphJS+graphName + "Store.setData(" + graphName + "Data);\n";
+ GraphJS = GraphJS+graphName + "Max = 0;\n" +
+ graphName + "Min = 0;\n" +
+ graphName + "Avg = 0;\n" +
+ "for (var i = 0; i<"+ graphName + "Data.length; i++)\n" +
+ "{\n" +
+ graphName + "Max = Math.max(" + graphName + "Max," + graphName+ "Data[i].value);\n" +
+ graphName + "Min = Math.min("+ graphName + "Min," + graphName + "Data[i].value);\n"
+ + graphName + "Avg = (" + graphName + "Avg + " + graphName
+ + "Data[i].value);\n" + "}\n" + graphName
+ + "Avg = Math.round(" + graphName + "Avg/" + graphName
+ + "Data.length*10)/10;\n" + "if (" + graphName + "Max == 0)\n"
+ + graphName + "Max = 1;\n";
+
+ // Setup the data series
+ GraphJS = GraphJS+"var " + graphName
+ + "Series = new dojo.charting.Series({\n";
+ GraphJS = GraphJS+"dataSource: " + graphName + "Store,\n";
+ GraphJS = GraphJS+"bindings: { x: \"index\", y: \"value\" },\n";
+ GraphJS = GraphJS+"label: \"" + graphName + "\"\n";
+ GraphJS = GraphJS+"});\n";
+
+ // Define the x-axis
+ GraphJS = GraphJS+"var " + graphName + "xAxis = new dojo.charting.Axis(); \n";
+
+ // Set the upper and lower data range valuesprettyName
+ GraphJS = GraphJS+graphName + "xAxis.range = { lower: "
+ + graphName + "Data[0].index, upper: " + graphName
+ + "Data[" + graphName + "Data.length-1].index };\n";
+
+ GraphJS = GraphJS+graphName + "xAxis.origin = \"" + graphName
+ + "Max\";\n";
+ GraphJS = GraphJS+graphName + "xAxis.showTicks = true;\n";
+ GraphJS = GraphJS+graphName + "xAxis.label = \"" + prettyName + "\";\n";
+
+ // Setup the x tick marks on the chart
+ GraphJS = GraphJS+graphName + "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 " + graphName
+ + "yAxis = new dojo.charting.Axis();\n";
+ GraphJS = GraphJS+graphName + "yAxis.range = { lower: " + graphName
+ + "Min, upper: " + graphName + "Max+(0.1*"+graphName+"Max)};\n";
+ GraphJS = GraphJS+graphName + "yAxis.showLines = true;\n";
+ GraphJS = GraphJS+graphName + "yAxis.showTicks = true;\n";
+ GraphJS = GraphJS+graphName + "yAxis.label = \"" + yAxisLabel + "\";\n";
+
+ // Setup the y tick marks on the chart
+ GraphJS = GraphJS+graphName + "yAxis.labels = [ \n";
+ GraphJS = GraphJS+"{ label: \"min - \"+" + graphName + "Min, value: "
+ + graphName + "Min },\n";
+ GraphJS = GraphJS+"{ label: \"avg - \"+" + graphName + "Avg, value: "
+ + graphName + "Avg },\n";
+ GraphJS = GraphJS+"{ label: \"max - \"+" + graphName + "Max, value: "
+ + graphName + "Max },\n";
+ GraphJS = GraphJS+"{ label: Math.round(("+ graphName + "Max+(0.1*"+graphName+"Max))), value: "
+ + graphName + "Max+(0.1*"+graphName+"Max) },\n";
+ GraphJS = GraphJS+"]; \n";
+
+ // Create the actual graph with the x and y axes defined above
+ GraphJS = GraphJS+"var " + graphName
+ + "chartPlotArea = new dojo.charting.PlotArea();\n";
+ GraphJS = GraphJS+"var " + graphName
+ + "chartPlot = new dojo.charting.Plot(" + graphName
+ + "xAxis, " + graphName + "yAxis);\n";
+ GraphJS = GraphJS+graphName + "chartPlotArea.initializePlot("
+ + graphName + "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+graphName + "chartPlot.addSeries({ \n";
+ GraphJS = GraphJS+"data: " + graphName + "Series,\n";
+ GraphJS = GraphJS+"plotter: dojo.charting.Plotters.CurvedArea\n";
+ GraphJS = GraphJS+"});\n";
+
+ // Define the plot area
+
+ GraphJS = GraphJS+graphName
+ + "chartPlotArea.size = { width: 650, height: 200 };\n";
+ GraphJS = GraphJS+graphName
+ + "chartPlotArea.padding = { top: 30, right: 20, bottom: 30, left: 80 };\n";
+
+ // Add the plot to the area
+ GraphJS = GraphJS+graphName + "chartPlotArea.plots.push(" + graphName
+ + "chartPlot);\n";
+ // Simply use the next available color when plotting the time series
+ // plot
+ GraphJS = GraphJS+graphName + "Series.color = '#"+hexColor+"';\n";
+
+ // Create the actual chart "canvas"
+ GraphJS = GraphJS+"var " + graphName
+ + "chart = new dojo.charting.Chart(null, \"" + graphName
+ + "\", \"This is the example chart description\");\n";
+
+ // Add the plot area at an offset of 10 pixels from the top left
+ GraphJS = GraphJS+graphName + "chart.addPlotArea({ x: "
+ + dataSet1.size() + ", y: " + dataSet1.size()
+ + ", plotArea: " + graphName + "chartPlotArea });\n";
+
+ // Setup the chart to be added to the DOM on load
+ GraphJS = GraphJS+"dojo.addOnLoad(function()\n{\n"+graphName + "chart.node = dojo.byId(\"" + DivName +"\");";
+
+ GraphJS = GraphJS+graphName + "chart.render();\n});\n";
+ }
+
+ public StatsGraph(String graphName, String prettyName, String xAxisLabel, String yAxisLabel, Vector<Long> dataSet1, Vector<Long> snapshotTimes, int snapshotDuration, int timeFrame, int pointCount)
+ {
+
+ }
+
+ public StatsGraph(String graphName, String prettyName, String xAxisLabel, String yAxisLabel, Vector<Long> dataSet1, Vector<Long> snapshotTimes, int snapshotDuration, int timeFrame)
+ {
+
+ }
+
+ public StatsGraph()
+ {
+
+ }
+
+ public void redraw()
+ {
+
+ }
+
+ public String getJS()
+ {
+ return GraphJS;
+ }
+
+ public String getDiv()
+ {
+ return DivDefine;
+ }
+
+ public String getDivImplement()
+ {
+ return DivImplement;
+ }
+
+ public String getDivName()
+ {
+ return DivName;
+ }
+
+ public String getXAxis()
+ {
+ return XAxisLabel;
+ }
+
+ public String getYAxis()
+ {
+ return YAxisLabel;
+ }
+
+ public String getName()
+ {
+ return GraphName;
+ }
+
+ public String getPrettyName()
+ {
+ return PrettyName;
+ }
+
+ public int getSnapshotDuration()
+ {
+ return SnapshotDuration;
+ }
+
+ public int getTimeFrame()
+ {
+ return TimeFrame;
+ }
+
+ public int getPointCount()
+ {
+ return PointCount;
+ }
+
+ public String getColor()
+ {
+ return HexColor;
+ }
+}
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/StatsGraph.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/StatsGraph.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/StatsGraph.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/util/DBManager.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/util/DBManager.java?rev=581714&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/util/DBManager.java (added)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/util/DBManager.java Wed Oct 3 13:21:26 2007
@@ -0,0 +1,45 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.plugins.monitoring.client.util;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.sql.DataSource;
+
+
+public class DBManager {
+
+ public static Connection getConnection(){
+ Connection con = null;
+
+ try {
+ Context context = new InitialContext();
+ DataSource ds = (DataSource)context.lookup("java:comp/env/jdbc/MonitoringClientDS");
+ con = ds.getConnection();
+ } catch (NamingException e) {
+ e.printStackTrace();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+ return con;
+ }
+
+}
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/util/DBManager.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/util/DBManager.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/util/DBManager.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/geronimo-web.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/geronimo-web.xml?rev=581714&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/geronimo-web.xml (added)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/geronimo-web.xml Wed Oct 3 13:21:26 2007
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.2">
+ <environment>
+ <moduleId>
+ <groupId>org.apache.geronimo.plugins.monitoring</groupId>
+ <artifactId>client</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <type>war</type>
+ </moduleId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.geronimo.plugins</groupId>
+ <artifactId>pluto-support</artifactId>
+ </dependency>
+ </dependencies>
+ </environment>
+
+ <context-root>/MonitoringPortlet</context-root>
+ <!-- define a reference name to the db pool-->
+ <resource-ref>
+ <ref-name>jdbc/MonitoringClientDS</ref-name>
+ <resource-link>MonitoringClientPool</resource-link>
+ </resource-ref>
+ <gbean name="MonitoringPortlet" class="org.apache.geronimo.pluto.AdminConsoleExtensionGBean">
+ <attribute name="pageTitle">Monitoring</attribute>
+ <attribute name="portletContext">/MonitoringPortlet</attribute>
+ <attribute name="portletList">[MonitoringPortlet]</attribute>
+ </gbean>
+
+</web-app>
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/geronimo-web.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/geronimo-web.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/geronimo-web.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/portlet.xml?rev=581714&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/portlet.xml (added)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/portlet.xml Wed Oct 3 13:21:26 2007
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<portlet-app
+ xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ version="1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd
+ http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
+
+ <portlet>
+ <description>Monitoring Portlet</description>
+ <portlet-name>MonitoringPortlet</portlet-name>
+ <display-name>Monitoring Portlet</display-name>
+ <portlet-class>org.apache.geronimo.plugins.monitoring.client.MonitoringPortlet</portlet-class>
+ <supports> <!-- Defines which views are avaliable [view,edit,help] -->
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>HELP</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Monitoring</title>
+ </portlet-info>
+ </portlet>
+
+</portlet-app>
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/portlet.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/portlet.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/portlet.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringHelp.jsp
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringHelp.jsp?rev=581714&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringHelp.jsp (added)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringHelp.jsp Wed Oct 3 13:21:26 2007
@@ -0,0 +1,22 @@
+<%--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+--%>
+
+<p><font face="Verdana" size="+1"><center><b>This is the help for the MRC Statistics.</b></center></font></p>
+
+<P>The stats page needs help documentation</P>
+
+<P>To return to the main Welcome panel select the "view" link from the header of this portlet.</P>
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringHelp.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringHelp.jsp
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringHelp.jsp
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringMaximized.jsp
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringMaximized.jsp?rev=581714&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringMaximized.jsp (added)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringMaximized.jsp Wed Oct 3 13:21:26 2007
@@ -0,0 +1,17 @@
+<%--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+--%>
+<%@ include file="monitoringMbean.jsp" %>
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringMaximized.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringMaximized.jsp
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringMaximized.jsp
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringMbean.jsp
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringMbean.jsp?rev=581714&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringMbean.jsp (added)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringMbean.jsp Wed Oct 3 13:21:26 2007
@@ -0,0 +1,86 @@
+<%--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+--%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
+<%@ page import="org.apache.geronimo.plugins.monitoring.client.StatsGraph" %>
+<%@ page import="java.util.Vector" %>
+<%@ page import="java.util.Set" %>
+<%@ page import="org.apache.geronimo.console.util.PortletManager" %>
+<portlet:defineObjects/>
+
+<%
+Vector <StatsGraph> GraphVector = (Vector<StatsGraph>) request.getAttribute("GraphVector");
+Set <String> trackedBeans = (Set<String>) request.getAttribute("trackedBeans");
+Integer time = (Integer) request.getAttribute("time");
+%>
+<head>
+ <style type='text/css'>
+ <% for (StatsGraph graph : GraphVector)
+ out.println(graph.getDiv());
+ %>
+ </style>
+ <script type='text/javascript' src='/dojo/dojo.js'>
+ </script>
+ <script type='text/javascript'>
+ var dojoConfig =
+ {
+ isDebug:true
+ };
+ dojo.require("dojo.collections.Store");
+ dojo.require("dojo.charting.Chart");
+ dojo.require('dojo.json');
+ <% for (StatsGraph graph : GraphVector)
+ out.println(graph.getJS());
+ %>
+ </script>
+</head>
+<table>
+ <tr>
+ <!-- Body -->
+ <td width="90%" align="left" valign="top">
+ <p>
+ <font face="Verdana" size="+1">
+ <left>
+ <b>By MBean | <a href="<portlet:actionURL portletMode="view"><portlet:param name="mode" value="timeframe" /><portlet:param name="time" value="60" /></portlet:actionURL>">By
+ Timeframe</a></b>
+ </left>
+ </font>
+ </p>
+ |
+<% for (String Bean : trackedBeans)
+{
+%>
+ <a href="<portlet:actionURL portletMode="view"><portlet:param name="mode" value="mbean" /><portlet:param name="time" value="60" /><portlet:param name="draw" value="all" /><portlet:param name="bean" value="<%=Bean%>" /></portlet:actionURL>"><%=Bean%></a>
+ |
+<%
+}
+%>
+
+<% for (StatsGraph graph : GraphVector)
+{
+%>
+ <p>
+<%=graph.getDivImplement()%>
+ </p>
+<%
+}
+%>
+
+ </td>
+ </tr>
+</table>
+
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringMbean.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringMbean.jsp
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringMbean.jsp
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringTimeframe.jsp
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringTimeframe.jsp?rev=581714&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringTimeframe.jsp (added)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringTimeframe.jsp Wed Oct 3 13:21:26 2007
@@ -0,0 +1,73 @@
+<%--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+--%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
+<%@ page import="org.apache.geronimo.plugins.monitoring.client.StatsGraph" %>
+<%@ page import="java.util.Vector" %>
+<%@ page import="org.apache.geronimo.console.util.PortletManager" %>
+<portlet:defineObjects/>
+
+<%
+Vector <StatsGraph> GraphVector = (Vector<StatsGraph>) request.getAttribute("GraphVector");
+Integer time = (Integer) request.getAttribute("time");
+%>
+<head>
+ <style type='text/css'>
+ <% for (StatsGraph graph : GraphVector)
+ out.println(graph.getDiv());
+ %>
+ </style>
+ <script type='text/javascript' src='/dojo/dojo.js'>
+ </script>
+ <script type='text/javascript'>
+ var dojoConfig =
+ {
+ isDebug:true
+ };
+ dojo.require("dojo.collections.Store");
+ dojo.require("dojo.charting.Chart");
+ dojo.require('dojo.json');
+ <% for (StatsGraph graph : GraphVector)
+ out.println(graph.getJS());
+ %>
+ </script>
+</head>
+<table>
+ <tr>
+ <!-- Body -->
+ <td width="90%" align="left" valign="top">
+ <p>
+ <font face="Verdana" size="+1">
+ <left>
+ <b><a href="<portlet:actionURL portletMode="view"><portlet:param name="bean" value="TomcatWebConnector" /><portlet:param name="mode" value="mbean" /><portlet:param name="time" value="60" /></portlet:actionURL>">By
+ MBean</a> | By Timeframe</b>
+ </left>
+ </font>
+ </p>
+ <a href="<portlet:actionURL portletMode="view"><portlet:param name="time" value="60" /><portlet:param name="mode" value="timeframe" /></portlet:actionURL>">Hour</a>
+ | <a href="<portlet:actionURL portletMode="view"><portlet:param name="time" value="1440" /><portlet:param name="mode" value="timeframe" /></portlet:actionURL>">Day</a>
+ | <a href="<portlet:actionURL portletMode="view"><portlet:param name="time" value="10080" /><portlet:param name="mode" value="timeframe" /></portlet:actionURL>">Week</a>
+ | <a href="<portlet:actionURL portletMode="view"><portlet:param name="time" value="43200" /><portlet:param name="mode" value="timeframe" /></portlet:actionURL>">30
+ day</a>
+ <% for (StatsGraph graph : GraphVector)
+ out.println("<p>"+graph.getDivImplement()+"</p>");
+ %>
+
+ </td>
+ </tr>
+</table>
+
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringTimeframe.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringTimeframe.jsp
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringTimeframe.jsp
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/web.xml?rev=581714&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/web.xml (added)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/web.xml Wed Oct 3 13:21:26 2007
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+
+ <servlet>
+ <servlet-name>MonitoringPortlet</servlet-name>
+ <servlet-class>org.apache.pluto.core.PortletServlet</servlet-class>
+ <init-param>
+ <param-name>portlet-name</param-name>
+ <param-value>MonitoringPortlet</param-value>
+ </init-param>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>MonitoringPortlet</servlet-name>
+ <url-pattern>/PlutoInvoker/MonitoringPortlet</url-pattern>
+ </servlet-mapping>
+ <!-- reference name exposed as a datasource -->
+ <resource-ref>
+ <res-ref-name>jdbc/MonitoringClientDS</res-ref-name>
+ <res-type>javax.sql.DataSource</res-type>
+ <res-auth>Container</res-auth>
+ <res-sharing-scope>Shareable</res-sharing-scope>
+ </resource-ref>
+
+</web-app>
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: geronimo/sandbox/monitoring/client/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/pom.xml?rev=581714&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/client/pom.xml (added)
+++ geronimo/sandbox/monitoring/client/pom.xml Wed Oct 3 13:21:26 2007
@@ -0,0 +1,275 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.geronimo.samples</groupId>
+ <artifactId>samples</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.apache.geronimo.plugins.monitoring</groupId>
+ <version>1.0-SNAPSHOT</version>
+ <artifactId>client</artifactId>
+ <name>Geronimo Stats :: Client</name>
+ <packaging>pom</packaging>
+
+ <description>
+ Geronimo Stats
+ </description>
+
+ <properties>
+ <!--
+ NOTE: Project version, to be used instead of ${pom.version} since that
+ value magically changes when using SNAPSHOT versions.
+
+ This value *must* be kept in sync with the value of the <version>
+ element, and it will need to be changed manually before a release,
+ as the maven-release-plugin will not update this value.
+ -->
+ <version>1.0-SNAPSHOT</version>
+ <consoleVersion>1.0-SNAPSHOT</consoleVersion>
+ <geronimoVersion>2.1-SNAPSHOT</geronimoVersion>
+ <geronimoServletSpecVersion>1.1</geronimoServletSpecVersion>
+ <plutoVersion>1.2.0-SNAPSHOT</plutoVersion>
+ <xbeanVersion>3.0.1</xbeanVersion>
+
+ <!-- deployers needed to create the CAR files -->
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+
+ <dependency>
+ <groupId>javax.portlet</groupId>
+ <artifactId>portlet-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.modules</groupId>
+ <artifactId>geronimo-kernel</artifactId>
+ <version>${geronimoVersion}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.modules</groupId>
+ <artifactId>geronimo-management</artifactId>
+ <version>${geronimoVersion}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-servlet_2.5_spec</artifactId>
+ <version>${geronimoServletSpecVersion}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.modules</groupId>
+ <artifactId>geronimo-j2ee</artifactId>
+ <version>${geronimoVersion}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.xbean</groupId>
+ <artifactId>xbean-naming</artifactId>
+ <version>${xbeanVersion}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.configs</groupId>
+ <artifactId>geronimo-gbean-deployer</artifactId>
+ <version>${geronimoVersion}</version>
+ <type>car</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.configs</groupId>
+ <artifactId>dojo-jetty6</artifactId>
+ <version>${geronimoVersion}</version>
+ <type>car</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.configs</groupId>
+ <artifactId>dojo-tomcat</artifactId>
+ <version>${geronimoVersion}</version>
+ <type>car</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.plugins</groupId>
+ <artifactId>console-core</artifactId>
+ <version>${consoleVersion}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.geronimo.modules</groupId>
+ <artifactId>geronimo-connector</artifactId>
+ </exclusion>
+
+ <exclusion>
+ <groupId>javax.portlet</groupId>
+ <artifactId>portlet-api</artifactId>
+ </exclusion>
+
+ <exclusion>
+ <groupId>org.apache.geronimo.modules</groupId>
+ <artifactId>geronimo-deploy-jsr88</artifactId>
+ </exclusion>
+
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-servlet_2.5_spec</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ </dependencies>
+ </dependencyManagement>
+
+
+ <modules>
+ <module>client-war</module>
+ <module>client-ear</module>
+ </modules>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.geronimo.plugins</groupId>
+ <artifactId>car-maven-plugin</artifactId>
+ <version>${geronimoVersion}</version>
+ <extensions>true</extensions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>1.0-alpha-2</version>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.0-alpha-4</version>
+ </plugin>
+
+ <!--
+ FIXME: Should not configure war to assume jsp by default
+ -->
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.0.2</version>
+ <configuration>
+ <warSourceDirectory>${pom.basedir}/src/main/webapp</warSourceDirectory>
+ <archiveClasses>true</archiveClasses>
+ <archive>
+ <!-- Do not include META-INF/maven to avoid long file problems on windows -->
+ <addMavenDescriptor>false</addMavenDescriptor>
+ </archive>
+
+ <!--
+ HACK: Include legal files explicity, otherwise they will end up in the wrong path
+ or in another jar file in the war.
+
+ NOTE: targetPath is broken for webResources (as documented)
+ -->
+ <webResources>
+ <resource>
+ <directory>${project.build.outputDirectory}</directory>
+ <includes>
+ <include>META-INF/LICENSE*</include>
+ <include>META-INF/NOTICE*</include>
+ <include>META-INF/DISCLAIMER*</include>
+ </includes>
+ </resource>
+ </webResources>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.pluto</groupId>
+ <artifactId>maven-pluto-plugin</artifactId>
+ <version>${plutoVersion}</version>
+ </plugin>
+
+ </plugins>
+
+ </pluginManagement>
+
+ <plugins>
+ <plugin>
+ <artifactId>maven-site-plugin</artifactId>
+ <inherited>false</inherited>
+ <configuration>
+ <outputDirectory>${project.basedir}/docs</outputDirectory>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.geronimo.genesis.plugins</groupId>
+ <artifactId>tools-maven-plugin</artifactId>
+ <!-- Tools includes custom packagings, install as extension to pick them up -->
+ <extensions>true</extensions>
+
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ <configuration>
+ <tagBase>https://svn.apache.org/repos/asf/geronimo/sandbox/portals/tags</tagBase>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <repositories>
+ <repository>
+ <id>apache-snapshots</id>
+ <name>Apache Snapshots Repository</name>
+ <url>http://people.apache.org/repo/m2-snapshot-repository</url>
+ <layout>default</layout>
+ <snapshots>
+ <enabled>true</enabled>
+ <updatePolicy>daily</updatePolicy>
+ <checksumPolicy>ignore</checksumPolicy>
+ </snapshots>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ </repository>
+ </repositories>
+
+</project>
Propchange: geronimo/sandbox/monitoring/client/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/monitoring/client/pom.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/sandbox/monitoring/client/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: geronimo/sandbox/monitoring/mrc-server/mrc-server-ear-1.0-SNAPSHOT.ear
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/mrc-server/mrc-server-ear-1.0-SNAPSHOT.ear?rev=581714&view=auto
==============================================================================
Binary file - no diff available.
Propchange: geronimo/sandbox/monitoring/mrc-server/mrc-server-ear-1.0-SNAPSHOT.ear
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream