You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
(927) |
Apr
(419) |
May
(352) |
Jun
(431) |
Jul
(463) |
Aug
(345) |
Sep
(304) |
Oct
(596) |
Nov
(466) |
Dec
(414) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(348) |
Feb
(313) |
Mar
(665) |
Apr
(688) |
May
(434) |
Jun
(311) |
Jul
(540) |
Aug
(554) |
Sep
(467) |
Oct
(341) |
Nov
(365) |
Dec
(272) |
2009 |
Jan
(386) |
Feb
(293) |
Mar
(279) |
Apr
(239) |
May
(229) |
Jun
(199) |
Jul
(186) |
Aug
(111) |
Sep
(196) |
Oct
(146) |
Nov
(116) |
Dec
(140) |
2010 |
Jan
(170) |
Feb
(159) |
Mar
(151) |
Apr
(161) |
May
(90) |
Jun
(56) |
Jul
(28) |
Aug
(22) |
Sep
(5) |
Oct
|
Nov
(23) |
Dec
(12) |
2011 |
Jan
(8) |
Feb
(8) |
Mar
(22) |
Apr
(24) |
May
(4) |
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2012 |
Jan
(5) |
Feb
(1) |
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <no...@gi...> - 2009-11-20 23:12:29
|
Branch: refs/heads/evolution Home: http://github.com/hyperic/hqapi Commit: 6560d7f175cf7b627254c46810e2990a379eda9e http://github.com/hyperic/hqapi/commit/6560d7f175cf7b627254c46810e2990a379eda9e Author: Jennifer Hickey <jen...@sp...> Date: 2009-11-20 (Fri, 20 Nov 2009) Changed paths: M hqu/hqapi1/app/AlertController.groovy Log Message: ----------- Removed reference to EJB in comments |
From: <pn...@hy...> - 2009-11-20 23:08:48
|
Author: pnguyen Date: 2009-11-20 15:08:35 -0800 (Fri, 20 Nov 2009) New Revision: 13984 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13984 Added: trunk/web/resource/common/monitor/visibility/ParticipatingResourcesSMMR.jsp Modified: trunk/src/org/hyperic/hq/ui/action/resource/common/monitor/visibility/ViewChartFormPrepareAction.java trunk/web/WEB-INF/tiles/resource-common-def.xml trunk/web/resource/common/monitor/visibility/ChartLayout.jsp Log: [HQ-1916] To improve the performance of SMMR charts, get the metric display summary for only the first resource since the UI does not need the rest of the data. Modified: trunk/src/org/hyperic/hq/ui/action/resource/common/monitor/visibility/ViewChartFormPrepareAction.java =================================================================== --- trunk/src/org/hyperic/hq/ui/action/resource/common/monitor/visibility/ViewChartFormPrepareAction.java 2009-11-20 23:01:31 UTC (rev 13983) +++ trunk/src/org/hyperic/hq/ui/action/resource/common/monitor/visibility/ViewChartFormPrepareAction.java 2009-11-20 23:08:35 UTC (rev 13984) @@ -88,6 +88,7 @@ import org.hyperic.util.config.ConfigResponse; import org.hyperic.util.pager.PageControl; import org.hyperic.util.pager.PageList; +import org.hyperic.util.timer.StopWatch; /** * An <code>Action</code> that retrieves data from the BizApp to @@ -107,6 +108,10 @@ ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { + + final boolean debug = log.isDebugEnabled(); + StopWatch watch = new StopWatch(); + super.workflow(cc, mapping, form, request, response); ViewChartForm chartForm = (ViewChartForm)form; @@ -138,22 +143,33 @@ MeasurementBoss mb = ContextUtils.getMeasurementBoss(ctx); + if (debug) watch.markTimeBegin("_setupResources"); AppdefResourceValue[][] resources = _setupResources(request, sessionId, chartForm, resource, mb); + if (debug) watch.markTimeEnd("_setupResources"); try { if (resources.length == 0 || resources[0].length == 0) throw new MeasurementNotFoundException( "No resources found for chart"); + if (debug) watch.markTimeBegin("_setupMetricData"); _setupMetricData(request, sessionId, chartForm, resources[1], mb, ctx); + if (debug) watch.markTimeEnd("_setupMetricData"); } catch (MeasurementNotFoundException e) { return removeBadDashboardLink(request, ctx); } + if (debug) watch.markTimeBegin("_setupPageData"); + _setupPageData(request, sessionId, chartForm, resources[0], mb); - + + if (debug) { + watch.markTimeEnd("_setupPageData"); + log.debug("workflow: " + watch); + } + return null; } @@ -244,6 +260,10 @@ throws SessionTimeoutException, SessionException, AppdefEntityNotFoundException, PermissionException, RemoteException, MeasurementNotFoundException { + + final boolean debug = log.isDebugEnabled(); + StopWatch watch = new StopWatch(); + ServletContext ctx = getServlet().getServletContext(); // get list of all child resources AppdefResourceValue[] resources = null; @@ -253,9 +273,11 @@ AppdefBoss ab = ContextUtils.getAppdefBoss(ctx); AppdefEntityTypeID atid = new AppdefEntityTypeID(chartForm.getCtype()); + if (debug) watch.markTimeBegin("findChildResources"); PageList children = ab.findChildResources( sessionId, adeId, atid, PageControl.PAGE_ALL ); + if (debug) watch.markTimeEnd("findChildResources"); String[] rids = request.getParameterValues("r"); Integer[] r = ArrayUtil.stringToInteger(rids); // if we've been passed a list of resource ids, we are @@ -287,15 +309,21 @@ grpVal.getAppdefGroupEntries().toArray(grpMembers); AppdefBoss ab = ContextUtils.getAppdefBoss(ctx); + if (debug) watch.markTimeBegin("findByIds"); List memVals = ab.findByIds(sessionId, grpMembers, PageControl.PAGE_ALL); + if (debug) watch.markTimeEnd("findByIds"); resources = new AppdefResourceValue[memVals.size()]; resources = (AppdefResourceValue[]) memVals.toArray(resources); } else { resources = new AppdefResourceValue[] { resource }; } + + if (debug) watch.markTimeBegin("pruneResourcesNotCollecting"); resources = mb.pruneResourcesNotCollecting(sessionId, resources, chartForm.getM()[0]); + if (debug) watch.markTimeEnd("pruneResourcesNotCollecting"); + request.setAttribute("resources", resources); request.setAttribute( "resourcesSize", new Integer(resources.length) ); @@ -303,29 +331,30 @@ // is the same as resources and chartForm.resourceIds contains // all resource ids String[] resourceIds = request.getParameterValues("resourceIds"); + AppdefResourceValue[] checkedResources = null; + + if (debug) watch.markTimeBegin("checkedResources"); + if (null == resourceIds || resourceIds.length == 0) { int maxResources = _getMaxResources(request, resources.length); log.debug("maxResources=" + maxResources); - AppdefResourceValue[] checkedResources = - new AppdefResourceValue[maxResources]; + checkedResources = new AppdefResourceValue[maxResources]; System.arraycopy(resources, 0, checkedResources, 0, maxResources); Integer[] rids = new Integer[checkedResources.length]; for (int i = 0; i < rids.length; ++i) { rids[i] = checkedResources[i].getId(); } chartForm.setResourceIds(rids); - if (log.isDebugEnabled()) { + if (debug) { log.debug("no resourceIds specified: " + StringUtil.arrayToString(rids)); } request.setAttribute("checkedResources", checkedResources); request.setAttribute("checkedResourcesSize", new Integer(checkedResources.length)); - return new AppdefResourceValue[][] { resources, checkedResources }; } else { Integer[] rids = chartForm.getResourceIds(); - AppdefResourceValue[] checkedResources = - new AppdefResourceValue[rids.length]; + checkedResources = new AppdefResourceValue[rids.length]; for (int i=0; i<rids.length; ++i) { for (int j=0; j<resources.length; ++j) { if ( resources[j].getId().equals(rids[i]) ) { @@ -333,15 +362,21 @@ } } } - if ( log.isDebugEnabled() ) { + if (debug) { log.debug( "resourceIds specified: " + org.hyperic.util.StringUtil.arrayToString(rids) ); } request.setAttribute("checkedResources", checkedResources); request.setAttribute("checkedResourcesSize", - new Integer(checkedResources.length) ); - return new AppdefResourceValue[][] {resources, checkedResources}; + new Integer(checkedResources.length) ); } + + if (debug) { + watch.markTimeEnd("checkedResources"); + log.debug("_setupResources: " + watch); + } + + return new AppdefResourceValue[][] {resources, checkedResources}; } private void _setupMetricData(HttpServletRequest request, int sessionId, @@ -353,6 +388,7 @@ RemoteException, AppdefEntityNotFoundException, PermissionException { + final boolean debug = log.isDebugEnabled(); EventLogBoss eb = ContextUtils.getEventLogBoss(ctx); List eventPointsList = new ArrayList(resources.length); @@ -365,7 +401,7 @@ // data points for chart Integer m[] = chartForm.getM(); String[] chartDataKeys = new String[m.length]; - log.trace("number of metrics: " + m.length); + if (debug) log.debug("number of metrics: " + m.length); for (int i = 0; i < m.length; ++i) { // Use the current time concatenated with metric @@ -374,7 +410,7 @@ String.valueOf( System.currentTimeMillis() ) + m[i]; for (int j = 0; j < resources.length; ++j) { - if (log.isDebugEnabled()) { + if (debug) { log.debug("mtid=" + m[i] + ", rid=" + resources[j].getId()); log.debug("startDate=" + chartForm.getStartDate()); log.debug("endDate=" + chartForm.getEndDate()); @@ -404,7 +440,7 @@ } } } - log.debug("Store into session: " + chartDataKeys[i]); + if (debug) log.debug("Store into session: " + chartDataKeys[i]); } request.setAttribute(Constants.CHART_DATA_KEYS_SIZE, new Integer( chartDataKeys.length)); @@ -435,24 +471,44 @@ AppdefEntityNotFoundException, PermissionException, AppdefCompatException, RemoteException, MeasurementNotFoundException, BaselineCreationException { + + final boolean debug = log.isDebugEnabled(); + StopWatch watch = new StopWatch(); + List mtids = Arrays.asList( chartForm.getOrigM() ); ArrayList metricSummaries = new ArrayList(); - for (int i=0; i<resources.length; ++i) { + + if (debug) watch.markTimeBegin("findMetrics"); + + for (int i=0; i<resources.length; ++i) { Map metrics = mb.findMetrics(sessionId, resources[i].getEntityId(), mtids, chartForm.getStartDate().getTime(), chartForm.getEndDate().getTime() ); - MonitorUtils.formatMetrics( metrics, request.getLocale(), - getResources(request) ); - for (Iterator it = metrics.values().iterator(); it.hasNext();) { - metricSummaries.addAll( (Collection) it.next() ); + + for (Iterator it=metrics.entrySet().iterator(); it.hasNext();) { + Map.Entry entry = (Map.Entry)it.next(); + metricSummaries.addAll( (Collection)entry.getValue() ); } + + if (chartForm.getMode().equals(Constants.MODE_MON_CHART_SMMR) + && !metricSummaries.isEmpty()) { + // HQ-1916: For SMMR charts, get the metric display summary + // for only the first resource + break; + } } + Collections.sort(metricSummaries, comp); request.setAttribute("metricSummaries", metricSummaries); request.setAttribute("metricSummariesSize", new Integer(metricSummaries.size())); + if (debug) { + watch.markTimeEnd("findMetrics"); + watch.markTimeBegin("chartedMetrics"); + } + // pick out the charted metrics from the metric summaries ChartedMetricBean[] chartedMetrics = new ChartedMetricBean[chartForm.getM().length]; @@ -472,10 +528,21 @@ } } } + + if (debug) watch.markTimeEnd("chartedMetrics"); + request.setAttribute("chartedMetrics", chartedMetrics); - - _setupBaselineExpectedRange(request, sessionId, chartForm, resources, - chartedMetrics, mb); + + if (chartedMetrics.length > 0 && chartedMetrics[0] != null) { + watch.markTimeBegin("_setupBaselineExpectedRange"); + _setupBaselineExpectedRange(request, sessionId, chartForm, + resources, chartedMetrics, mb); + watch.markTimeEnd("_setupBaselineExpectedRange"); + } + + if (debug) { + log.debug("_setupPageData: " + watch); + } } protected void _setupBaselineExpectedRange(HttpServletRequest request, Modified: trunk/web/WEB-INF/tiles/resource-common-def.xml =================================================================== --- trunk/web/WEB-INF/tiles/resource-common-def.xml 2009-11-20 23:01:31 UTC (rev 13983) +++ trunk/web/WEB-INF/tiles/resource-common-def.xml 2009-11-20 23:08:35 UTC (rev 13984) @@ -173,6 +173,9 @@ <definition name=".resource.common.monitor.visibility.charts.metric.partrsrcs" path="/resource/common/monitor/visibility/ParticipatingResources.jsp"/> + <definition name=".resource.common.monitor.visibility.charts.metric.partrsrcs.smmr" + path="/resource/common/monitor/visibility/ParticipatingResourcesSMMR.jsp"/> + <definition name=".resource.common.monitor.visibility.charts.metric.chartlegend" path="/resource/common/monitor/visibility/ChartLegend.jsp"/> Modified: trunk/web/resource/common/monitor/visibility/ChartLayout.jsp =================================================================== --- trunk/web/resource/common/monitor/visibility/ChartLayout.jsp 2009-11-20 23:01:31 UTC (rev 13983) +++ trunk/web/resource/common/monitor/visibility/ChartLayout.jsp 2009-11-20 23:08:35 UTC (rev 13984) @@ -132,8 +132,7 @@ </tiles:insert> <br> <tiles:insert - definition=".resource.common.monitor.visibility.charts.metric.partrsrcs"> - <tiles:put name="multiResource" value="true" /> + definition=".resource.common.monitor.visibility.charts.metric.partrsrcs.smmr"> </tiles:insert> <br> </c:when> Added: trunk/web/resource/common/monitor/visibility/ParticipatingResourcesSMMR.jsp =================================================================== --- trunk/web/resource/common/monitor/visibility/ParticipatingResourcesSMMR.jsp (rev 0) +++ trunk/web/resource/common/monitor/visibility/ParticipatingResourcesSMMR.jsp 2009-11-20 23:08:35 UTC (rev 13984) @@ -0,0 +1,103 @@ +<%@ taglib uri="struts-html-el" prefix="html" %> +<%@ taglib uri="struts-tiles" prefix="tiles" %> +<%@ taglib uri="jstl-fmt" prefix="fmt" %> +<%@ taglib uri="jstl-c" prefix="c" %> +<%@ taglib uri="hq" prefix="hq" %> +<%-- + NOTE: This copyright does *not* cover user programs that use HQ + program services by normal system calls through the application + program interfaces provided as part of the Hyperic Plug-in Development + Kit or the Hyperic Client Development Kit - this is merely considered + normal use of the program, and does *not* fall under the heading of + "derived work". + + Copyright (C) [2004-2009], Hyperic, Inc. + This file is part of HQ. + + HQ is free software; you can redistribute it and/or modify + it under the terms version 2 of the GNU General Public License as + published by the Free Software Foundation. This program is distributed + in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + even the implied warranty of MERCHANTABILITY or FITNESS FOR A + PARTICULAR PURPOSE. See the GNU General Public License for more + details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + USA. + --%> + +<html:hidden property="m" value="${ViewChartForm.m[0]}"/> + +<c:set var="widgetInstanceName" value="listMetrics"/> +<script type="text/javascript"> +var pageData = new Array(); +initializeWidgetProperties('<c:out value="${widgetInstanceName}"/>'); +widgetProperties = getWidgetProperties('<c:out value="${widgetInstanceName}"/>'); +</script> + +<!-- PARTICIPATING RESOURCE TITLE --> +<tiles:insert definition=".header.tab"> +<tiles:put name="tabKey" value="resource.common.monitor.visibility.chart.ParticipatingResourceTab"/> +</tiles:insert> +<!-- / --> + +<div id="listDiv"> +<table width="100%" cellpadding="0" cellspacing="0" border="0" id="listTable"> + <tr class="ListHeaderDark"> + <td width="29%" class="ListHeaderInactiveSorted"><fmt:message + key="resource.common.monitor.visibility.MetricNameTH"/></td> + <td width="1%" class="ListHeaderInactiveSorted"><html:img + page="/images/spacer.gif" width="1" height="1" alt="" + border="0"/></td> + <td width="69%" class="ListHeaderInactiveSorted"><fmt:message + key="resource.common.monitor.visibility.ResourceTH"/></td> + </tr> + <c:forEach var="resource" varStatus="rStatus" items="${resources}"> + <c:url var="resourceUrl" value="/Resource.do"> + <c:param name="rid" value="${resource.id}"/> + <c:param name="type" value="${resource.entityId.type}"/> + </c:url> + <tr class="ListRow"> + <c:if test="${rStatus.first}"> + <td rowspan="<c:out value='${resourcesSize}'/>" + class="ListCellPrimary" valign="top"><c:out value="${metricSummaries[0].label}"/></td> + </c:if> + <c:set var="maxResources"><c:out value="${checkedResourcesSize}"/></c:set> + <c:set var="maxMessage"> + <fmt:message key="resource.common.monitor.visibility.chart.TooManyResources"> + <fmt:param value="${maxResources}"/> + </fmt:message> + </c:set> + <td class="ListCellLeftLineNoPadding" valign="top"><html:multibox + property="resourceIds" value="${resource.id}" + onclick="ToggleSelection(this, widgetProperties, ${maxResources}, '${maxMessage}');" + styleClass="resourceList"/></td> + <c:set var="resCellClass" value="ListCellPrimary"/> + <td + class="<c:out value='${resCellClass}'/>" valign="top"> + <html:link href="${resourceUrl}"><c:out value="${resource.name}"/></html:link> + </td> + </tr> + </c:forEach> +</table> + +<!-- REDRAW SELECTED TOOLBAR --> +<table width="100%" cellpadding="5" cellspacing="0" border="0" class="ToolbarContent"> + <tr> + <td id="<c:out value="${widgetInstanceName}"/>RedrawTd"><div + id="<c:out value="${widgetInstanceName}"/>RedrawDiv"><html:img + page="/images/tbb_redrawselectedonchart_gray.gif" width="171" + height="16" alt="" border="0"/></div></td> + <td width="100%" align="right"> </td> + </tr> +</table> +<!-- / --> + +</div> + +<input type="Hidden" id="privateChart"> +<script type="text/javascript"> + testCheckboxes('<c:out value="${widgetInstanceName}"/>'); +</script> |
Author: pnguyen Date: 2009-11-20 15:01:31 -0800 (Fri, 20 Nov 2009) New Revision: 13983 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13983 Added: branches/HQ_4_2/web/resource/common/monitor/visibility/ParticipatingResourcesSMMR.jsp Modified: branches/HQ_4_2/src/org/hyperic/hq/ui/action/resource/common/monitor/visibility/ViewChartFormPrepareAction.java branches/HQ_4_2/web/WEB-INF/tiles/resource-common-def.xml branches/HQ_4_2/web/resource/common/monitor/visibility/ChartLayout.jsp Log: [HQ-1916] To improve the performance of SMMR charts, get the metric display summary for only the first resource since the UI does not need the rest of the data. Modified: branches/HQ_4_2/src/org/hyperic/hq/ui/action/resource/common/monitor/visibility/ViewChartFormPrepareAction.java =================================================================== --- branches/HQ_4_2/src/org/hyperic/hq/ui/action/resource/common/monitor/visibility/ViewChartFormPrepareAction.java 2009-11-20 15:39:14 UTC (rev 13982) +++ branches/HQ_4_2/src/org/hyperic/hq/ui/action/resource/common/monitor/visibility/ViewChartFormPrepareAction.java 2009-11-20 23:01:31 UTC (rev 13983) @@ -88,6 +88,7 @@ import org.hyperic.util.config.ConfigResponse; import org.hyperic.util.pager.PageControl; import org.hyperic.util.pager.PageList; +import org.hyperic.util.timer.StopWatch; /** * An <code>Action</code> that retrieves data from the BizApp to @@ -107,6 +108,10 @@ ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { + + final boolean debug = log.isDebugEnabled(); + StopWatch watch = new StopWatch(); + super.workflow(cc, mapping, form, request, response); ViewChartForm chartForm = (ViewChartForm)form; @@ -138,22 +143,33 @@ MeasurementBoss mb = ContextUtils.getMeasurementBoss(ctx); + if (debug) watch.markTimeBegin("_setupResources"); AppdefResourceValue[][] resources = _setupResources(request, sessionId, chartForm, resource, mb); + if (debug) watch.markTimeEnd("_setupResources"); try { if (resources.length == 0 || resources[0].length == 0) throw new MeasurementNotFoundException( "No resources found for chart"); + if (debug) watch.markTimeBegin("_setupMetricData"); _setupMetricData(request, sessionId, chartForm, resources[1], mb, ctx); + if (debug) watch.markTimeEnd("_setupMetricData"); } catch (MeasurementNotFoundException e) { return removeBadDashboardLink(request, ctx); } + if (debug) watch.markTimeBegin("_setupPageData"); + _setupPageData(request, sessionId, chartForm, resources[0], mb); - + + if (debug) { + watch.markTimeEnd("_setupPageData"); + log.debug("workflow: " + watch); + } + return null; } @@ -244,6 +260,10 @@ throws SessionTimeoutException, SessionException, AppdefEntityNotFoundException, PermissionException, RemoteException, MeasurementNotFoundException { + + final boolean debug = log.isDebugEnabled(); + StopWatch watch = new StopWatch(); + ServletContext ctx = getServlet().getServletContext(); // get list of all child resources AppdefResourceValue[] resources = null; @@ -253,9 +273,11 @@ AppdefBoss ab = ContextUtils.getAppdefBoss(ctx); AppdefEntityTypeID atid = new AppdefEntityTypeID(chartForm.getCtype()); + if (debug) watch.markTimeBegin("findChildResources"); PageList children = ab.findChildResources( sessionId, adeId, atid, PageControl.PAGE_ALL ); + if (debug) watch.markTimeEnd("findChildResources"); String[] rids = request.getParameterValues("r"); Integer[] r = ArrayUtil.stringToInteger(rids); // if we've been passed a list of resource ids, we are @@ -287,15 +309,21 @@ grpVal.getAppdefGroupEntries().toArray(grpMembers); AppdefBoss ab = ContextUtils.getAppdefBoss(ctx); + if (debug) watch.markTimeBegin("findByIds"); List memVals = ab.findByIds(sessionId, grpMembers, PageControl.PAGE_ALL); + if (debug) watch.markTimeEnd("findByIds"); resources = new AppdefResourceValue[memVals.size()]; resources = (AppdefResourceValue[]) memVals.toArray(resources); } else { resources = new AppdefResourceValue[] { resource }; } + + if (debug) watch.markTimeBegin("pruneResourcesNotCollecting"); resources = mb.pruneResourcesNotCollecting(sessionId, resources, chartForm.getM()[0]); + if (debug) watch.markTimeEnd("pruneResourcesNotCollecting"); + request.setAttribute("resources", resources); request.setAttribute( "resourcesSize", new Integer(resources.length) ); @@ -303,29 +331,30 @@ // is the same as resources and chartForm.resourceIds contains // all resource ids String[] resourceIds = request.getParameterValues("resourceIds"); + AppdefResourceValue[] checkedResources = null; + + if (debug) watch.markTimeBegin("checkedResources"); + if (null == resourceIds || resourceIds.length == 0) { int maxResources = _getMaxResources(request, resources.length); log.debug("maxResources=" + maxResources); - AppdefResourceValue[] checkedResources = - new AppdefResourceValue[maxResources]; + checkedResources = new AppdefResourceValue[maxResources]; System.arraycopy(resources, 0, checkedResources, 0, maxResources); Integer[] rids = new Integer[checkedResources.length]; for (int i = 0; i < rids.length; ++i) { rids[i] = checkedResources[i].getId(); } chartForm.setResourceIds(rids); - if (log.isDebugEnabled()) { + if (debug) { log.debug("no resourceIds specified: " + StringUtil.arrayToString(rids)); } request.setAttribute("checkedResources", checkedResources); request.setAttribute("checkedResourcesSize", new Integer(checkedResources.length)); - return new AppdefResourceValue[][] { resources, checkedResources }; } else { Integer[] rids = chartForm.getResourceIds(); - AppdefResourceValue[] checkedResources = - new AppdefResourceValue[rids.length]; + checkedResources = new AppdefResourceValue[rids.length]; for (int i=0; i<rids.length; ++i) { for (int j=0; j<resources.length; ++j) { if ( resources[j].getId().equals(rids[i]) ) { @@ -333,15 +362,21 @@ } } } - if ( log.isDebugEnabled() ) { + if (debug) { log.debug( "resourceIds specified: " + org.hyperic.util.StringUtil.arrayToString(rids) ); } request.setAttribute("checkedResources", checkedResources); request.setAttribute("checkedResourcesSize", - new Integer(checkedResources.length) ); - return new AppdefResourceValue[][] {resources, checkedResources}; + new Integer(checkedResources.length) ); } + + if (debug) { + watch.markTimeEnd("checkedResources"); + log.debug("_setupResources: " + watch); + } + + return new AppdefResourceValue[][] {resources, checkedResources}; } private void _setupMetricData(HttpServletRequest request, int sessionId, @@ -353,6 +388,7 @@ RemoteException, AppdefEntityNotFoundException, PermissionException { + final boolean debug = log.isDebugEnabled(); EventLogBoss eb = ContextUtils.getEventLogBoss(ctx); List eventPointsList = new ArrayList(resources.length); @@ -365,7 +401,7 @@ // data points for chart Integer m[] = chartForm.getM(); String[] chartDataKeys = new String[m.length]; - log.trace("number of metrics: " + m.length); + if (debug) log.debug("number of metrics: " + m.length); for (int i = 0; i < m.length; ++i) { // Use the current time concatenated with metric @@ -374,7 +410,7 @@ String.valueOf( System.currentTimeMillis() ) + m[i]; for (int j = 0; j < resources.length; ++j) { - if (log.isDebugEnabled()) { + if (debug) { log.debug("mtid=" + m[i] + ", rid=" + resources[j].getId()); log.debug("startDate=" + chartForm.getStartDate()); log.debug("endDate=" + chartForm.getEndDate()); @@ -404,7 +440,7 @@ } } } - log.debug("Store into session: " + chartDataKeys[i]); + if (debug) log.debug("Store into session: " + chartDataKeys[i]); } request.setAttribute(Constants.CHART_DATA_KEYS_SIZE, new Integer( chartDataKeys.length)); @@ -435,24 +471,44 @@ AppdefEntityNotFoundException, PermissionException, AppdefCompatException, RemoteException, MeasurementNotFoundException, BaselineCreationException { + + final boolean debug = log.isDebugEnabled(); + StopWatch watch = new StopWatch(); + List mtids = Arrays.asList( chartForm.getOrigM() ); ArrayList metricSummaries = new ArrayList(); - for (int i=0; i<resources.length; ++i) { + + if (debug) watch.markTimeBegin("findMetrics"); + + for (int i=0; i<resources.length; ++i) { Map metrics = mb.findMetrics(sessionId, resources[i].getEntityId(), mtids, chartForm.getStartDate().getTime(), chartForm.getEndDate().getTime() ); - MonitorUtils.formatMetrics( metrics, request.getLocale(), - getResources(request) ); - for (Iterator it = metrics.values().iterator(); it.hasNext();) { - metricSummaries.addAll( (Collection) it.next() ); + + for (Iterator it=metrics.entrySet().iterator(); it.hasNext();) { + Map.Entry entry = (Map.Entry)it.next(); + metricSummaries.addAll( (Collection)entry.getValue() ); } + + if (chartForm.getMode().equals(Constants.MODE_MON_CHART_SMMR) + && !metricSummaries.isEmpty()) { + // HQ-1916: For SMMR charts, get the metric display summary + // for only the first resource + break; + } } + Collections.sort(metricSummaries, comp); request.setAttribute("metricSummaries", metricSummaries); request.setAttribute("metricSummariesSize", new Integer(metricSummaries.size())); + if (debug) { + watch.markTimeEnd("findMetrics"); + watch.markTimeBegin("chartedMetrics"); + } + // pick out the charted metrics from the metric summaries ChartedMetricBean[] chartedMetrics = new ChartedMetricBean[chartForm.getM().length]; @@ -472,10 +528,21 @@ } } } + + if (debug) watch.markTimeEnd("chartedMetrics"); + request.setAttribute("chartedMetrics", chartedMetrics); - - _setupBaselineExpectedRange(request, sessionId, chartForm, resources, - chartedMetrics, mb); + + if (chartedMetrics.length > 0 && chartedMetrics[0] != null) { + watch.markTimeBegin("_setupBaselineExpectedRange"); + _setupBaselineExpectedRange(request, sessionId, chartForm, + resources, chartedMetrics, mb); + watch.markTimeEnd("_setupBaselineExpectedRange"); + } + + if (debug) { + log.debug("_setupPageData: " + watch); + } } protected void _setupBaselineExpectedRange(HttpServletRequest request, Modified: branches/HQ_4_2/web/WEB-INF/tiles/resource-common-def.xml =================================================================== --- branches/HQ_4_2/web/WEB-INF/tiles/resource-common-def.xml 2009-11-20 15:39:14 UTC (rev 13982) +++ branches/HQ_4_2/web/WEB-INF/tiles/resource-common-def.xml 2009-11-20 23:01:31 UTC (rev 13983) @@ -173,6 +173,9 @@ <definition name=".resource.common.monitor.visibility.charts.metric.partrsrcs" path="/resource/common/monitor/visibility/ParticipatingResources.jsp"/> + <definition name=".resource.common.monitor.visibility.charts.metric.partrsrcs.smmr" + path="/resource/common/monitor/visibility/ParticipatingResourcesSMMR.jsp"/> + <definition name=".resource.common.monitor.visibility.charts.metric.chartlegend" path="/resource/common/monitor/visibility/ChartLegend.jsp"/> Modified: branches/HQ_4_2/web/resource/common/monitor/visibility/ChartLayout.jsp =================================================================== --- branches/HQ_4_2/web/resource/common/monitor/visibility/ChartLayout.jsp 2009-11-20 15:39:14 UTC (rev 13982) +++ branches/HQ_4_2/web/resource/common/monitor/visibility/ChartLayout.jsp 2009-11-20 23:01:31 UTC (rev 13983) @@ -132,8 +132,7 @@ </tiles:insert> <br> <tiles:insert - definition=".resource.common.monitor.visibility.charts.metric.partrsrcs"> - <tiles:put name="multiResource" value="true" /> + definition=".resource.common.monitor.visibility.charts.metric.partrsrcs.smmr"> </tiles:insert> <br> </c:when> Added: branches/HQ_4_2/web/resource/common/monitor/visibility/ParticipatingResourcesSMMR.jsp =================================================================== --- branches/HQ_4_2/web/resource/common/monitor/visibility/ParticipatingResourcesSMMR.jsp (rev 0) +++ branches/HQ_4_2/web/resource/common/monitor/visibility/ParticipatingResourcesSMMR.jsp 2009-11-20 23:01:31 UTC (rev 13983) @@ -0,0 +1,103 @@ +<%@ taglib uri="struts-html-el" prefix="html" %> +<%@ taglib uri="struts-tiles" prefix="tiles" %> +<%@ taglib uri="jstl-fmt" prefix="fmt" %> +<%@ taglib uri="jstl-c" prefix="c" %> +<%@ taglib uri="hq" prefix="hq" %> +<%-- + NOTE: This copyright does *not* cover user programs that use HQ + program services by normal system calls through the application + program interfaces provided as part of the Hyperic Plug-in Development + Kit or the Hyperic Client Development Kit - this is merely considered + normal use of the program, and does *not* fall under the heading of + "derived work". + + Copyright (C) [2004-2009], Hyperic, Inc. + This file is part of HQ. + + HQ is free software; you can redistribute it and/or modify + it under the terms version 2 of the GNU General Public License as + published by the Free Software Foundation. This program is distributed + in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + even the implied warranty of MERCHANTABILITY or FITNESS FOR A + PARTICULAR PURPOSE. See the GNU General Public License for more + details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + USA. + --%> + +<html:hidden property="m" value="${ViewChartForm.m[0]}"/> + +<c:set var="widgetInstanceName" value="listMetrics"/> +<script type="text/javascript"> +var pageData = new Array(); +initializeWidgetProperties('<c:out value="${widgetInstanceName}"/>'); +widgetProperties = getWidgetProperties('<c:out value="${widgetInstanceName}"/>'); +</script> + +<!-- PARTICIPATING RESOURCE TITLE --> +<tiles:insert definition=".header.tab"> +<tiles:put name="tabKey" value="resource.common.monitor.visibility.chart.ParticipatingResourceTab"/> +</tiles:insert> +<!-- / --> + +<div id="listDiv"> +<table width="100%" cellpadding="0" cellspacing="0" border="0" id="listTable"> + <tr class="ListHeaderDark"> + <td width="29%" class="ListHeaderInactiveSorted"><fmt:message + key="resource.common.monitor.visibility.MetricNameTH"/></td> + <td width="1%" class="ListHeaderInactiveSorted"><html:img + page="/images/spacer.gif" width="1" height="1" alt="" + border="0"/></td> + <td width="69%" class="ListHeaderInactiveSorted"><fmt:message + key="resource.common.monitor.visibility.ResourceTH"/></td> + </tr> + <c:forEach var="resource" varStatus="rStatus" items="${resources}"> + <c:url var="resourceUrl" value="/Resource.do"> + <c:param name="rid" value="${resource.id}"/> + <c:param name="type" value="${resource.entityId.type}"/> + </c:url> + <tr class="ListRow"> + <c:if test="${rStatus.first}"> + <td rowspan="<c:out value='${resourcesSize}'/>" + class="ListCellPrimary" valign="top"><c:out value="${metricSummaries[0].label}"/></td> + </c:if> + <c:set var="maxResources"><c:out value="${checkedResourcesSize}"/></c:set> + <c:set var="maxMessage"> + <fmt:message key="resource.common.monitor.visibility.chart.TooManyResources"> + <fmt:param value="${maxResources}"/> + </fmt:message> + </c:set> + <td class="ListCellLeftLineNoPadding" valign="top"><html:multibox + property="resourceIds" value="${resource.id}" + onclick="ToggleSelection(this, widgetProperties, ${maxResources}, '${maxMessage}');" + styleClass="resourceList"/></td> + <c:set var="resCellClass" value="ListCellPrimary"/> + <td + class="<c:out value='${resCellClass}'/>" valign="top"> + <html:link href="${resourceUrl}"><c:out value="${resource.name}"/></html:link> + </td> + </tr> + </c:forEach> +</table> + +<!-- REDRAW SELECTED TOOLBAR --> +<table width="100%" cellpadding="5" cellspacing="0" border="0" class="ToolbarContent"> + <tr> + <td id="<c:out value="${widgetInstanceName}"/>RedrawTd"><div + id="<c:out value="${widgetInstanceName}"/>RedrawDiv"><html:img + page="/images/tbb_redrawselectedonchart_gray.gif" width="171" + height="16" alt="" border="0"/></div></td> + <td width="100%" align="right"> </td> + </tr> +</table> +<!-- / --> + +</div> + +<input type="Hidden" id="privateChart"> +<script type="text/javascript"> + testCheckboxes('<c:out value="${widgetInstanceName}"/>'); +</script> |
From: <jko...@hy...> - 2009-11-20 19:28:02
|
Author: jkonicki Date: 2009-11-20 07:39:14 -0800 (Fri, 20 Nov 2009) New Revision: 13982 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13982 Modified: trunk/src/org/hyperic/hq/product/SigarMeasurementPlugin.java Log: HHQ-3554 - MultiProcCpu now handles the return value from the sigar call, before it would return "available" if it just found the metric. Now it verifies that at least one process matched the ptql before returning "available" metric value. Modified: trunk/src/org/hyperic/hq/product/SigarMeasurementPlugin.java =================================================================== --- trunk/src/org/hyperic/hq/product/SigarMeasurementPlugin.java 2009-11-20 10:22:41 UTC (rev 13981) +++ trunk/src/org/hyperic/hq/product/SigarMeasurementPlugin.java 2009-11-20 15:39:14 UTC (rev 13982) @@ -56,7 +56,7 @@ private ProcessFinder processFinder = null; private static final Map AVAIL_ATTRS = new HashMap(); - //Availaiblity helpers. Assume resource is available if + //Availability helpers. Assume resource is available if //we can collect the given attribute. static { AVAIL_ATTRS.put("DirUsage", "Total"); @@ -161,7 +161,6 @@ { Object systemValue; Double useVal; - String domain = metric.getDomainName(); String name = metric.getObjectName(); String attr = metric.getAttributeName(); @@ -180,8 +179,8 @@ "Type=MountedFileSystemUsage"); } - boolean isAvail = false; - boolean isProcessState = false; + boolean isAvailabilityAttribute = false; + boolean isStateAttribute = false; //check for Availability attribute aliases if (attr.equals(Metric.ATTR_AVAIL)) { String type = @@ -189,11 +188,11 @@ String alias = (String)AVAIL_ATTRS.get(type); if (alias != null) { attr = alias; - isAvail = true; + isAvailabilityAttribute = true; } } else { - isAvail = isProcessState = isProcessState(attr); + isAvailabilityAttribute = isStateAttribute = isProcessState(attr); } SigarInvokerJMX invoker = @@ -206,18 +205,39 @@ } catch (SigarNotImplementedException e) { return MetricValue.NONE; } catch (SigarException e) { - if (isAvail) { + if (isAvailabilityAttribute) { return new MetricValue(Metric.AVAIL_DOWN); } else { throw new MetricNotFoundException(e.getMessage(), e); } } - - if (isAvail && !isProcessState) { - useVal = new Double(Metric.AVAIL_UP); + /* If the availability metric was accessible then it is considered + * "up" for certain cases (File, FileServer, NetworkInterface...), otherwise + * the metric would be set to down in the above SigarException catch statement. + * + * We should also see the value returned from SIGAR to be the number of + * processes found with the specified ptql. So if it is greater then 0 it + * is Available. + */ + if (isAvailabilityAttribute && !isStateAttribute) { + if (systemValue instanceof Number && ((Number)systemValue).intValue() > 0){ + useVal = new Double(Metric.AVAIL_UP); + } else { + useVal = new Double(Metric.AVAIL_DOWN); + } + }else { + useVal = convertToDouble(systemValue, isStateAttribute); } - else if (systemValue instanceof Double) { + if (useVal.doubleValue() == Sigar.FIELD_NOTIMPL) { + return MetricValue.NONE; + } + return new MetricValue(useVal, System.currentTimeMillis()); + } + + private Double convertToDouble(Object systemValue, boolean isProcessState) throws MetricNotFoundException{ + Double useVal; + if (systemValue instanceof Double) { useVal = (Double)systemValue; } else if (systemValue instanceof Long) { @@ -229,7 +249,7 @@ else if (systemValue instanceof Character) { char c = ((Character)systemValue).charValue(); //process state - if (isProcessState(attr)) { + if (isProcessState) { double avail; switch (c) { case 'Z': @@ -255,9 +275,6 @@ " object, which could not " + " be handled"); } - if (useVal.doubleValue() == Sigar.FIELD_NOTIMPL) { - return MetricValue.NONE; - } - return new MetricValue(useVal, System.currentTimeMillis()); + return useVal; } } |
From: <no...@gi...> - 2009-11-20 17:29:35
|
Branch: refs/heads/evolution Home: http://github.com/hyperic/hqapi Commit: cef38dcb3961a8f00031baec65ee0e60efdd03af http://github.com/hyperic/hqapi/commit/cef38dcb3961a8f00031baec65ee0e60efdd03af Author: Jennifer Hickey <jen...@sp...> Date: 2009-11-20 (Fri, 20 Nov 2009) Changed paths: M hqu/hqapi1/app/AlertController.groovy Log Message: ----------- Cleaned up converted EJB ref |
From: <bo...@hy...> - 2009-11-20 10:22:54
|
Author: bob Date: 2009-11-20 02:22:41 -0800 (Fri, 20 Nov 2009) New Revision: 13981 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13981 Modified: branches/HQ_4_2/etc/version.properties Log: Release 4.2.1 build #1268 Modified: branches/HQ_4_2/etc/version.properties =================================================================== --- branches/HQ_4_2/etc/version.properties 2009-11-20 08:52:37 UTC (rev 13980) +++ branches/HQ_4_2/etc/version.properties 2009-11-20 10:22:41 UTC (rev 13981) @@ -1,3 +1,3 @@ -#Thu Nov 19 01:38:07 PST 2009 +#Fri Nov 20 01:29:07 PST 2009 version=4.2.1 -build=1267 +build=1268 |
From: <bo...@hy...> - 2009-11-20 08:52:51
|
Author: bob Date: 2009-11-20 00:52:37 -0800 (Fri, 20 Nov 2009) New Revision: 13980 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13980 Modified: trunk/etc/version.properties Log: Release 4.3.0 build #1264 Modified: trunk/etc/version.properties =================================================================== --- trunk/etc/version.properties 2009-11-20 01:29:59 UTC (rev 13979) +++ trunk/etc/version.properties 2009-11-20 08:52:37 UTC (rev 13980) @@ -1,3 +1,3 @@ -#Thu Nov 19 00:20:00 PST 2009 +#Fri Nov 20 00:16:24 PST 2009 version=4.3.0 -build=1263 +build=1264 |
From: <bo...@hy...> - 2009-11-20 01:59:28
|
Author: bob Date: 2009-11-19 17:29:59 -0800 (Thu, 19 Nov 2009) New Revision: 13979 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13979 Modified: branches/HQ_4_2_0_PATCH/etc/version.properties Log: Release 4.2.0.1 build #1264 Modified: branches/HQ_4_2_0_PATCH/etc/version.properties =================================================================== --- branches/HQ_4_2_0_PATCH/etc/version.properties 2009-11-20 01:09:44 UTC (rev 13978) +++ branches/HQ_4_2_0_PATCH/etc/version.properties 2009-11-20 01:29:59 UTC (rev 13979) @@ -1,3 +1,3 @@ -#Thu Nov 19 13:04:19 PST 2009 +#Thu Nov 19 16:54:15 PST 2009 version=4.2.0.1 -build=1263 +build=1264 |
From: <sc...@hy...> - 2009-11-20 01:09:58
|
Author: scottmf Date: 2009-11-19 17:09:44 -0800 (Thu, 19 Nov 2009) New Revision: 13978 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13978 Modified: branches/HQ_4_2/src/org/hyperic/hq/bizapp/server/session/EventsBossEJBImpl.java branches/HQ_4_2/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java Log: [HHQ-3534] reworked code so that the entireCleanup is not called per appdefId, instead it is called once. Also batched it up to avoid potential timeout issues Modified: branches/HQ_4_2/src/org/hyperic/hq/bizapp/server/session/EventsBossEJBImpl.java =================================================================== --- branches/HQ_4_2/src/org/hyperic/hq/bizapp/server/session/EventsBossEJBImpl.java 2009-11-20 01:08:32 UTC (rev 13977) +++ branches/HQ_4_2/src/org/hyperic/hq/bizapp/server/session/EventsBossEJBImpl.java 2009-11-20 01:09:44 UTC (rev 13978) @@ -1724,9 +1724,8 @@ _log.debug("fixPreviousAlerts: alertId = " + alertID + ", previous alerts fixed = " + fixCount + ", time = " + watch); - - return fixCount; } + return fixCount; } /** @@ -1833,16 +1832,30 @@ // are deleted. HashSet events = new HashSet(); events.add (ResourceDeletedZevent.class); - ZeventManager.getInstance().addBufferedListener(events, - new ZeventListener() { + ZeventManager inst = ZeventManager.getInstance(); + inst.addBufferedListener( + events, new ZeventListener() { public void processEvents(List events) { - AlertDefinitionManagerLocal adm = getADM(); - for (Iterator i = events.iterator(); i.hasNext();) { - ResourceZevent z = (ResourceZevent) i.next(); - if (z instanceof ResourceDeletedZevent) { - adm.cleanupAlertDefinitions(z.getAppdefEntityID()); + final StopWatch watch = new StopWatch(); + final Log log = LogFactory.getLog(this.getClass().getName()); + final boolean debug = log.isDebugEnabled(); + final AlertDefinitionManagerLocal adm = getADM(); + final List alertDefs = getADM().getAllDeletedAlertDefs(); + final int batchSize = 1000; + for (int i=0; i<alertDefs.size(); i+=batchSize) { + final int end = Math.min(i+batchSize, alertDefs.size()); + final List sublist = alertDefs.subList(i, end); + // can't pass in pojos since the session changes + final List ids = new ArrayList(sublist.size()); + for (final Iterator it=sublist.iterator(); it.hasNext(); ) { + final AlertDefinition def = (AlertDefinition) it.next(); + ids.add(def.getId()); } + if (debug) watch.markTimeBegin("cleanupAlertDefs"); + adm.cleanupAlertDefs(ids); + if (debug) watch.markTimeEnd("cleanupAlertDefs"); } + if (debug) log.debug(watch); } public String toString() { Modified: branches/HQ_4_2/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java =================================================================== --- branches/HQ_4_2/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java 2009-11-20 01:08:32 UTC (rev 13977) +++ branches/HQ_4_2/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java 2009-11-20 01:09:44 UTC (rev 13978) @@ -67,7 +67,6 @@ import org.hyperic.hq.events.shared.AlertDefinitionValue; import org.hyperic.hq.events.shared.RegisteredTriggerManagerLocal; import org.hyperic.hq.events.shared.RegisteredTriggerValue; -import org.hyperic.hq.measurement.MeasurementConstants; import org.hyperic.hq.measurement.server.session.Measurement; import org.hyperic.hq.measurement.server.session.MeasurementDAO; import org.hyperic.util.config.ConfigResponse; @@ -741,56 +740,59 @@ } aDao.getSession().flush(); } + + /** + * @ejb:interface-method + */ + public List getAllDeletedAlertDefs() { + return getAlertDefDAO().findAllDeletedResources(); + } - /** Clean up alert definitions and alerts for removed resources - * + /** + * @param alertDefIds {@link List} of {@link Integer} of alertDefIds * @ejb:interface-method */ - public void cleanupAlertDefinitions(AppdefEntityID aeid) { - StopWatch watch = new StopWatch(); - + public void cleanupAlertDefs(List alertDefIds) { + if (alertDefIds.size() <= 0) { + return; + } + final StopWatch watch = new StopWatch(); + final boolean debug = log.isDebugEnabled(); + final AlertDAO dao = getAlertDAO(); final AlertDefinitionDAO aDao = getAlertDefDAO(); - final AlertDAO dao = getAlertDAO(); final ActionDAO actionDAO = getActionDAO(); + for (final Iterator i = alertDefIds.iterator(); i.hasNext();) { + final Integer alertdefId = (Integer) i.next(); + final AlertDefinition alertdef = aDao.findById(alertdefId); - List adefs = aDao.findAllDeletedResources(); - for (Iterator i = adefs.iterator(); i.hasNext();) { - AlertDefinition alertdef = (AlertDefinition) i.next(); - // Delete the alerts - watch.markTimeBegin("deleteByAlertDefinition"); + if (debug) watch.markTimeBegin("deleteByAlertDefinition"); dao.deleteByAlertDefinition(alertdef); - watch.markTimeEnd("deleteByAlertDefinition"); + if (debug) watch.markTimeEnd("deleteByAlertDefinition"); - // Get the alerts deleted - dao.getSession().flush(); - // Remove the conditions - watch.markTimeBegin("remove conditions and triggers"); + if (debug) watch.markTimeBegin("remove conditions and triggers"); alertdef.clearConditions(); alertdef.getTriggersBag().clear(); - watch.markTimeEnd("remove conditions and triggers"); + if (debug) watch.markTimeEnd("remove conditions and triggers"); // Remove the actions - watch.markTimeBegin("removeActions"); + if (debug) watch.markTimeBegin("removeActions"); actionDAO.removeActions(alertdef); - watch.markTimeEnd("removeActions"); + if (debug) watch.markTimeEnd("removeActions"); - watch.markTimeBegin("remove from parent"); + if (debug) watch.markTimeBegin("remove from parent"); if (alertdef.getParent() != null) { alertdef.getParent().getChildrenBag().remove(alertdef); } - watch.markTimeBegin("remove from parent"); + if (debug) watch.markTimeEnd("remove from parent"); // Actually remove the definition - watch.markTimeBegin("remove"); + if (debug) watch.markTimeBegin("remove"); aDao.remove(alertdef); - watch.markTimeBegin("remove"); - - if (log.isDebugEnabled()) { - log.debug("deleteAlertDefinition: " + watch); - } + if (debug) watch.markTimeEnd("remove"); } + if (debug) log.debug("deleted " + alertDefIds.size() + " alertDefs: " + watch); } /** Find an alert definition and return a value object |
From: <sc...@hy...> - 2009-11-20 01:08:46
|
Author: scottmf Date: 2009-11-19 17:08:32 -0800 (Thu, 19 Nov 2009) New Revision: 13977 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13977 Modified: trunk/src/org/hyperic/hq/bizapp/server/session/EventsBossEJBImpl.java trunk/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java Log: [HHQ-3534] reworked code so that the entireCleanup is not called per appdefId, instead it is called once. Also batched it up to avoid potential timeout issues Modified: trunk/src/org/hyperic/hq/bizapp/server/session/EventsBossEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/server/session/EventsBossEJBImpl.java 2009-11-20 00:29:00 UTC (rev 13976) +++ trunk/src/org/hyperic/hq/bizapp/server/session/EventsBossEJBImpl.java 2009-11-20 01:08:32 UTC (rev 13977) @@ -1724,9 +1724,8 @@ _log.debug("fixPreviousAlerts: alertId = " + alertID + ", previous alerts fixed = " + fixCount + ", time = " + watch); - - return fixCount; } + return fixCount; } /** @@ -1833,16 +1832,30 @@ // are deleted. HashSet events = new HashSet(); events.add (ResourceDeletedZevent.class); - ZeventManager.getInstance().addBufferedListener(events, - new ZeventListener() { + ZeventManager inst = ZeventManager.getInstance(); + inst.addBufferedListener( + events, new ZeventListener() { public void processEvents(List events) { - AlertDefinitionManagerLocal adm = getADM(); - for (Iterator i = events.iterator(); i.hasNext();) { - ResourceZevent z = (ResourceZevent) i.next(); - if (z instanceof ResourceDeletedZevent) { - adm.cleanupAlertDefinitions(z.getAppdefEntityID()); + final StopWatch watch = new StopWatch(); + final Log log = LogFactory.getLog(this.getClass().getName()); + final boolean debug = log.isDebugEnabled(); + final AlertDefinitionManagerLocal adm = getADM(); + final List alertDefs = getADM().getAllDeletedAlertDefs(); + final int batchSize = 1000; + for (int i=0; i<alertDefs.size(); i+=batchSize) { + final int end = Math.min(i+batchSize, alertDefs.size()); + final List sublist = alertDefs.subList(i, end); + // can't pass in pojos since the session changes + final List ids = new ArrayList(sublist.size()); + for (final Iterator it=sublist.iterator(); it.hasNext(); ) { + final AlertDefinition def = (AlertDefinition) it.next(); + ids.add(def.getId()); } + if (debug) watch.markTimeBegin("cleanupAlertDefs"); + adm.cleanupAlertDefs(ids); + if (debug) watch.markTimeEnd("cleanupAlertDefs"); } + if (debug) log.debug(watch); } public String toString() { Modified: trunk/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java 2009-11-20 00:29:00 UTC (rev 13976) +++ trunk/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java 2009-11-20 01:08:32 UTC (rev 13977) @@ -67,7 +67,6 @@ import org.hyperic.hq.events.shared.AlertDefinitionValue; import org.hyperic.hq.events.shared.RegisteredTriggerManagerLocal; import org.hyperic.hq.events.shared.RegisteredTriggerValue; -import org.hyperic.hq.measurement.MeasurementConstants; import org.hyperic.hq.measurement.server.session.Measurement; import org.hyperic.hq.measurement.server.session.MeasurementDAO; import org.hyperic.util.config.ConfigResponse; @@ -741,56 +740,59 @@ } aDao.getSession().flush(); } + + /** + * @ejb:interface-method + */ + public List getAllDeletedAlertDefs() { + return getAlertDefDAO().findAllDeletedResources(); + } - /** Clean up alert definitions and alerts for removed resources - * + /** + * @param alertDefIds {@link List} of {@link Integer} of alertDefIds * @ejb:interface-method */ - public void cleanupAlertDefinitions(AppdefEntityID aeid) { - StopWatch watch = new StopWatch(); - + public void cleanupAlertDefs(List alertDefIds) { + if (alertDefIds.size() <= 0) { + return; + } + final StopWatch watch = new StopWatch(); + final boolean debug = log.isDebugEnabled(); + final AlertDAO dao = getAlertDAO(); final AlertDefinitionDAO aDao = getAlertDefDAO(); - final AlertDAO dao = getAlertDAO(); final ActionDAO actionDAO = getActionDAO(); + for (final Iterator i = alertDefIds.iterator(); i.hasNext();) { + final Integer alertdefId = (Integer) i.next(); + final AlertDefinition alertdef = aDao.findById(alertdefId); - List adefs = aDao.findAllDeletedResources(); - for (Iterator i = adefs.iterator(); i.hasNext();) { - AlertDefinition alertdef = (AlertDefinition) i.next(); - // Delete the alerts - watch.markTimeBegin("deleteByAlertDefinition"); + if (debug) watch.markTimeBegin("deleteByAlertDefinition"); dao.deleteByAlertDefinition(alertdef); - watch.markTimeEnd("deleteByAlertDefinition"); + if (debug) watch.markTimeEnd("deleteByAlertDefinition"); - // Get the alerts deleted - dao.getSession().flush(); - // Remove the conditions - watch.markTimeBegin("remove conditions and triggers"); + if (debug) watch.markTimeBegin("remove conditions and triggers"); alertdef.clearConditions(); alertdef.getTriggersBag().clear(); - watch.markTimeEnd("remove conditions and triggers"); + if (debug) watch.markTimeEnd("remove conditions and triggers"); // Remove the actions - watch.markTimeBegin("removeActions"); + if (debug) watch.markTimeBegin("removeActions"); actionDAO.removeActions(alertdef); - watch.markTimeEnd("removeActions"); + if (debug) watch.markTimeEnd("removeActions"); - watch.markTimeBegin("remove from parent"); + if (debug) watch.markTimeBegin("remove from parent"); if (alertdef.getParent() != null) { alertdef.getParent().getChildrenBag().remove(alertdef); } - watch.markTimeBegin("remove from parent"); + if (debug) watch.markTimeEnd("remove from parent"); // Actually remove the definition - watch.markTimeBegin("remove"); + if (debug) watch.markTimeBegin("remove"); aDao.remove(alertdef); - watch.markTimeBegin("remove"); - - if (log.isDebugEnabled()) { - log.debug("deleteAlertDefinition: " + watch); - } + if (debug) watch.markTimeEnd("remove"); } + if (debug) log.debug("deleted " + alertDefIds.size() + " alertDefs: " + watch); } /** Find an alert definition and return a value object |
From: <no...@gi...> - 2009-11-20 00:38:14
|
Branch: refs/heads/master Home: http://github.com/hyperic/hqapi Commit: 88b6214fd6a243296e8d2d8ccb9307007d9067ce http://github.com/hyperic/hqapi/commit/88b6214fd6a243296e8d2d8ccb9307007d9067ce Author: Ryan Morgan <rm...@hy...> Date: 2009-09-30 (Wed, 30 Sep 2009) Changed paths: M hqu/hqapi1/app/ApiController.groovy Log Message: ----------- Hand merge null check for getResource(id) from 2.x tree. Commit: b950ccb4f0b32fac87d382a97f35a1c4ad243542 http://github.com/hyperic/hqapi/commit/b950ccb4f0b32fac87d382a97f35a1c4ad243542 Author: pnguyen <pnguyen@192.168.1.66> Date: 2009-11-18 (Wed, 18 Nov 2009) Changed paths: M hqu/hqapi1/app/ApplicationController.groovy Log Message: ----------- [HHQ-3513] To improve performance, use the resourceId (new) and description from the ServiceValue object if available. Commit: 40c3625832f13a9db54a38e6e9a16fabc92749ce http://github.com/hyperic/hqapi/commit/40c3625832f13a9db54a38e6e9a16fabc92749ce Author: Patrick Nguyen <pnguyen@patrick-nguyens-macbook-pro.local> Date: 2009-11-19 (Thu, 19 Nov 2009) Changed paths: M hqu/hqapi1/app/ApplicationController.groovy Log Message: ----------- Merge branch 'hqapi-1.0' into hqapi-2.x Commit: de4e5d6382a1282036589b90ab9e05d66ffa1ec5 http://github.com/hyperic/hqapi/commit/de4e5d6382a1282036589b90ab9e05d66ffa1ec5 Author: Patrick Nguyen <pnguyen@patrick-nguyens-macbook-pro.local> Date: 2009-11-19 (Thu, 19 Nov 2009) Changed paths: M hqu/hqapi1/app/ApplicationController.groovy Log Message: ----------- Merge branch 'hqapi-2.x' |
From: <no...@gi...> - 2009-11-20 00:36:07
|
Branch: refs/heads/hqapi-2.x Home: http://github.com/hyperic/hqapi Commit: 88b6214fd6a243296e8d2d8ccb9307007d9067ce http://github.com/hyperic/hqapi/commit/88b6214fd6a243296e8d2d8ccb9307007d9067ce Author: Ryan Morgan <rm...@hy...> Date: 2009-09-30 (Wed, 30 Sep 2009) Changed paths: M hqu/hqapi1/app/ApiController.groovy Log Message: ----------- Hand merge null check for getResource(id) from 2.x tree. Commit: b950ccb4f0b32fac87d382a97f35a1c4ad243542 http://github.com/hyperic/hqapi/commit/b950ccb4f0b32fac87d382a97f35a1c4ad243542 Author: pnguyen <pnguyen@192.168.1.66> Date: 2009-11-18 (Wed, 18 Nov 2009) Changed paths: M hqu/hqapi1/app/ApplicationController.groovy Log Message: ----------- [HHQ-3513] To improve performance, use the resourceId (new) and description from the ServiceValue object if available. Commit: 40c3625832f13a9db54a38e6e9a16fabc92749ce http://github.com/hyperic/hqapi/commit/40c3625832f13a9db54a38e6e9a16fabc92749ce Author: Patrick Nguyen <pnguyen@patrick-nguyens-macbook-pro.local> Date: 2009-11-19 (Thu, 19 Nov 2009) Changed paths: M hqu/hqapi1/app/ApplicationController.groovy Log Message: ----------- Merge branch 'hqapi-1.0' into hqapi-2.x |
From: <rm...@hy...> - 2009-11-20 00:29:48
|
Author: rmorgan Date: 2009-11-19 16:29:00 -0800 (Thu, 19 Nov 2009) New Revision: 13976 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13976 Modified: branches/HQ_4_2_0_PATCH/ui_plugins/ Log: Bump to HQApi 2.3. Property changes on: branches/HQ_4_2_0_PATCH/ui_plugins ___________________________________________________________________ Name: svn:externals - hqapi1 http://svn.hyperic.org/projects/hqapi/dist/HQAPI_2_2 + hqapi1 http://svn.hyperic.org/projects/hqapi/dist/HQAPI_2_3 |
From: <rm...@hy...> - 2009-11-20 00:27:40
|
Author: rmorgan Date: 2009-11-19 16:27:17 -0800 (Thu, 19 Nov 2009) New Revision: 13975 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13975 Modified: branches/HQ_4_2/ui_plugins/ Log: Bump to HQApi 2.3. Property changes on: branches/HQ_4_2/ui_plugins ___________________________________________________________________ Name: svn:externals - hqapi1 http://svn.hyperic.org/projects/hqapi/dist/HQAPI_2_2 + hqapi1 http://svn.hyperic.org/projects/hqapi/dist/HQAPI_2_3 |
Author: pnguyen Date: 2009-11-19 15:03:08 -0800 (Thu, 19 Nov 2009) New Revision: 13974 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13974 Added: branches/HQ_4_2_0_PATCH/web/resource/common/monitor/visibility/ParticipatingResourcesSMMR.jsp Modified: branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/ui/action/resource/common/monitor/visibility/ViewChartFormPrepareAction.java branches/HQ_4_2_0_PATCH/web/WEB-INF/tiles/resource-common-def.xml branches/HQ_4_2_0_PATCH/web/resource/common/monitor/visibility/ChartLayout.jsp Log: [HQ-1916] To improve the performance of SMMR charts, get the metric display summary for only the first resource since the UI does not need the rest of the data. Modified: branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/ui/action/resource/common/monitor/visibility/ViewChartFormPrepareAction.java =================================================================== --- branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/ui/action/resource/common/monitor/visibility/ViewChartFormPrepareAction.java 2009-11-19 21:36:05 UTC (rev 13973) +++ branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/ui/action/resource/common/monitor/visibility/ViewChartFormPrepareAction.java 2009-11-19 23:03:08 UTC (rev 13974) @@ -88,6 +88,7 @@ import org.hyperic.util.config.ConfigResponse; import org.hyperic.util.pager.PageControl; import org.hyperic.util.pager.PageList; +import org.hyperic.util.timer.StopWatch; /** * An <code>Action</code> that retrieves data from the BizApp to @@ -107,6 +108,10 @@ ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { + + final boolean debug = log.isDebugEnabled(); + StopWatch watch = new StopWatch(); + super.workflow(cc, mapping, form, request, response); ViewChartForm chartForm = (ViewChartForm)form; @@ -138,22 +143,33 @@ MeasurementBoss mb = ContextUtils.getMeasurementBoss(ctx); + if (debug) watch.markTimeBegin("_setupResources"); AppdefResourceValue[][] resources = _setupResources(request, sessionId, chartForm, resource, mb); + if (debug) watch.markTimeEnd("_setupResources"); try { if (resources.length == 0 || resources[0].length == 0) throw new MeasurementNotFoundException( "No resources found for chart"); + if (debug) watch.markTimeBegin("_setupMetricData"); _setupMetricData(request, sessionId, chartForm, resources[1], mb, ctx); + if (debug) watch.markTimeEnd("_setupMetricData"); } catch (MeasurementNotFoundException e) { return removeBadDashboardLink(request, ctx); } + if (debug) watch.markTimeBegin("_setupPageData"); + _setupPageData(request, sessionId, chartForm, resources[0], mb); - + + if (debug) { + watch.markTimeEnd("_setupPageData"); + log.debug("workflow: " + watch); + } + return null; } @@ -244,6 +260,10 @@ throws SessionTimeoutException, SessionException, AppdefEntityNotFoundException, PermissionException, RemoteException, MeasurementNotFoundException { + + final boolean debug = log.isDebugEnabled(); + StopWatch watch = new StopWatch(); + ServletContext ctx = getServlet().getServletContext(); // get list of all child resources AppdefResourceValue[] resources = null; @@ -253,9 +273,11 @@ AppdefBoss ab = ContextUtils.getAppdefBoss(ctx); AppdefEntityTypeID atid = new AppdefEntityTypeID(chartForm.getCtype()); + if (debug) watch.markTimeBegin("findChildResources"); PageList children = ab.findChildResources( sessionId, adeId, atid, PageControl.PAGE_ALL ); + if (debug) watch.markTimeEnd("findChildResources"); String[] rids = request.getParameterValues("r"); Integer[] r = ArrayUtil.stringToInteger(rids); // if we've been passed a list of resource ids, we are @@ -287,15 +309,21 @@ grpVal.getAppdefGroupEntries().toArray(grpMembers); AppdefBoss ab = ContextUtils.getAppdefBoss(ctx); + if (debug) watch.markTimeBegin("findByIds"); List memVals = ab.findByIds(sessionId, grpMembers, PageControl.PAGE_ALL); + if (debug) watch.markTimeEnd("findByIds"); resources = new AppdefResourceValue[memVals.size()]; resources = (AppdefResourceValue[]) memVals.toArray(resources); } else { resources = new AppdefResourceValue[] { resource }; } + + if (debug) watch.markTimeBegin("pruneResourcesNotCollecting"); resources = mb.pruneResourcesNotCollecting(sessionId, resources, chartForm.getM()[0]); + if (debug) watch.markTimeEnd("pruneResourcesNotCollecting"); + request.setAttribute("resources", resources); request.setAttribute( "resourcesSize", new Integer(resources.length) ); @@ -303,29 +331,30 @@ // is the same as resources and chartForm.resourceIds contains // all resource ids String[] resourceIds = request.getParameterValues("resourceIds"); + AppdefResourceValue[] checkedResources = null; + + if (debug) watch.markTimeBegin("checkedResources"); + if (null == resourceIds || resourceIds.length == 0) { int maxResources = _getMaxResources(request, resources.length); log.debug("maxResources=" + maxResources); - AppdefResourceValue[] checkedResources = - new AppdefResourceValue[maxResources]; + checkedResources = new AppdefResourceValue[maxResources]; System.arraycopy(resources, 0, checkedResources, 0, maxResources); Integer[] rids = new Integer[checkedResources.length]; for (int i = 0; i < rids.length; ++i) { rids[i] = checkedResources[i].getId(); } chartForm.setResourceIds(rids); - if (log.isDebugEnabled()) { + if (debug) { log.debug("no resourceIds specified: " + StringUtil.arrayToString(rids)); } request.setAttribute("checkedResources", checkedResources); request.setAttribute("checkedResourcesSize", new Integer(checkedResources.length)); - return new AppdefResourceValue[][] { resources, checkedResources }; } else { Integer[] rids = chartForm.getResourceIds(); - AppdefResourceValue[] checkedResources = - new AppdefResourceValue[rids.length]; + checkedResources = new AppdefResourceValue[rids.length]; for (int i=0; i<rids.length; ++i) { for (int j=0; j<resources.length; ++j) { if ( resources[j].getId().equals(rids[i]) ) { @@ -333,15 +362,21 @@ } } } - if ( log.isDebugEnabled() ) { + if (debug) { log.debug( "resourceIds specified: " + org.hyperic.util.StringUtil.arrayToString(rids) ); } request.setAttribute("checkedResources", checkedResources); request.setAttribute("checkedResourcesSize", - new Integer(checkedResources.length) ); - return new AppdefResourceValue[][] {resources, checkedResources}; + new Integer(checkedResources.length) ); } + + if (debug) { + watch.markTimeEnd("checkedResources"); + log.debug("_setupResources: " + watch); + } + + return new AppdefResourceValue[][] {resources, checkedResources}; } private void _setupMetricData(HttpServletRequest request, int sessionId, @@ -353,6 +388,7 @@ RemoteException, AppdefEntityNotFoundException, PermissionException { + final boolean debug = log.isDebugEnabled(); EventLogBoss eb = ContextUtils.getEventLogBoss(ctx); List eventPointsList = new ArrayList(resources.length); @@ -365,7 +401,7 @@ // data points for chart Integer m[] = chartForm.getM(); String[] chartDataKeys = new String[m.length]; - log.trace("number of metrics: " + m.length); + if (debug) log.debug("number of metrics: " + m.length); for (int i = 0; i < m.length; ++i) { // Use the current time concatenated with metric @@ -374,7 +410,7 @@ String.valueOf( System.currentTimeMillis() ) + m[i]; for (int j = 0; j < resources.length; ++j) { - if (log.isDebugEnabled()) { + if (debug) { log.debug("mtid=" + m[i] + ", rid=" + resources[j].getId()); log.debug("startDate=" + chartForm.getStartDate()); log.debug("endDate=" + chartForm.getEndDate()); @@ -404,7 +440,7 @@ } } } - log.debug("Store into session: " + chartDataKeys[i]); + if (debug) log.debug("Store into session: " + chartDataKeys[i]); } request.setAttribute(Constants.CHART_DATA_KEYS_SIZE, new Integer( chartDataKeys.length)); @@ -435,24 +471,44 @@ AppdefEntityNotFoundException, PermissionException, AppdefCompatException, RemoteException, MeasurementNotFoundException, BaselineCreationException { + + final boolean debug = log.isDebugEnabled(); + StopWatch watch = new StopWatch(); + List mtids = Arrays.asList( chartForm.getOrigM() ); ArrayList metricSummaries = new ArrayList(); - for (int i=0; i<resources.length; ++i) { + + if (debug) watch.markTimeBegin("findMetrics"); + + for (int i=0; i<resources.length; ++i) { Map metrics = mb.findMetrics(sessionId, resources[i].getEntityId(), mtids, chartForm.getStartDate().getTime(), chartForm.getEndDate().getTime() ); - MonitorUtils.formatMetrics( metrics, request.getLocale(), - getResources(request) ); - for (Iterator it = metrics.values().iterator(); it.hasNext();) { - metricSummaries.addAll( (Collection) it.next() ); + + for (Iterator it=metrics.entrySet().iterator(); it.hasNext();) { + Map.Entry entry = (Map.Entry)it.next(); + metricSummaries.addAll( (Collection)entry.getValue() ); } + + if (chartForm.getMode().equals(Constants.MODE_MON_CHART_SMMR) + && !metricSummaries.isEmpty()) { + // HQ-1916: For SMMR charts, get the metric display summary + // for only the first resource + break; + } } + Collections.sort(metricSummaries, comp); request.setAttribute("metricSummaries", metricSummaries); request.setAttribute("metricSummariesSize", new Integer(metricSummaries.size())); + if (debug) { + watch.markTimeEnd("findMetrics"); + watch.markTimeBegin("chartedMetrics"); + } + // pick out the charted metrics from the metric summaries ChartedMetricBean[] chartedMetrics = new ChartedMetricBean[chartForm.getM().length]; @@ -472,10 +528,21 @@ } } } + + if (debug) watch.markTimeEnd("chartedMetrics"); + request.setAttribute("chartedMetrics", chartedMetrics); - - _setupBaselineExpectedRange(request, sessionId, chartForm, resources, - chartedMetrics, mb); + + if (chartedMetrics.length > 0 && chartedMetrics[0] != null) { + watch.markTimeBegin("_setupBaselineExpectedRange"); + _setupBaselineExpectedRange(request, sessionId, chartForm, + resources, chartedMetrics, mb); + watch.markTimeEnd("_setupBaselineExpectedRange"); + } + + if (debug) { + log.debug("_setupPageData: " + watch); + } } protected void _setupBaselineExpectedRange(HttpServletRequest request, Modified: branches/HQ_4_2_0_PATCH/web/WEB-INF/tiles/resource-common-def.xml =================================================================== --- branches/HQ_4_2_0_PATCH/web/WEB-INF/tiles/resource-common-def.xml 2009-11-19 21:36:05 UTC (rev 13973) +++ branches/HQ_4_2_0_PATCH/web/WEB-INF/tiles/resource-common-def.xml 2009-11-19 23:03:08 UTC (rev 13974) @@ -173,6 +173,9 @@ <definition name=".resource.common.monitor.visibility.charts.metric.partrsrcs" path="/resource/common/monitor/visibility/ParticipatingResources.jsp"/> + <definition name=".resource.common.monitor.visibility.charts.metric.partrsrcs.smmr" + path="/resource/common/monitor/visibility/ParticipatingResourcesSMMR.jsp"/> + <definition name=".resource.common.monitor.visibility.charts.metric.chartlegend" path="/resource/common/monitor/visibility/ChartLegend.jsp"/> Modified: branches/HQ_4_2_0_PATCH/web/resource/common/monitor/visibility/ChartLayout.jsp =================================================================== --- branches/HQ_4_2_0_PATCH/web/resource/common/monitor/visibility/ChartLayout.jsp 2009-11-19 21:36:05 UTC (rev 13973) +++ branches/HQ_4_2_0_PATCH/web/resource/common/monitor/visibility/ChartLayout.jsp 2009-11-19 23:03:08 UTC (rev 13974) @@ -132,8 +132,7 @@ </tiles:insert> <br> <tiles:insert - definition=".resource.common.monitor.visibility.charts.metric.partrsrcs"> - <tiles:put name="multiResource" value="true" /> + definition=".resource.common.monitor.visibility.charts.metric.partrsrcs.smmr"> </tiles:insert> <br> </c:when> Added: branches/HQ_4_2_0_PATCH/web/resource/common/monitor/visibility/ParticipatingResourcesSMMR.jsp =================================================================== --- branches/HQ_4_2_0_PATCH/web/resource/common/monitor/visibility/ParticipatingResourcesSMMR.jsp (rev 0) +++ branches/HQ_4_2_0_PATCH/web/resource/common/monitor/visibility/ParticipatingResourcesSMMR.jsp 2009-11-19 23:03:08 UTC (rev 13974) @@ -0,0 +1,103 @@ +<%@ taglib uri="struts-html-el" prefix="html" %> +<%@ taglib uri="struts-tiles" prefix="tiles" %> +<%@ taglib uri="jstl-fmt" prefix="fmt" %> +<%@ taglib uri="jstl-c" prefix="c" %> +<%@ taglib uri="hq" prefix="hq" %> +<%-- + NOTE: This copyright does *not* cover user programs that use HQ + program services by normal system calls through the application + program interfaces provided as part of the Hyperic Plug-in Development + Kit or the Hyperic Client Development Kit - this is merely considered + normal use of the program, and does *not* fall under the heading of + "derived work". + + Copyright (C) [2004-2009], Hyperic, Inc. + This file is part of HQ. + + HQ is free software; you can redistribute it and/or modify + it under the terms version 2 of the GNU General Public License as + published by the Free Software Foundation. This program is distributed + in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + even the implied warranty of MERCHANTABILITY or FITNESS FOR A + PARTICULAR PURPOSE. See the GNU General Public License for more + details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + USA. + --%> + +<html:hidden property="m" value="${ViewChartForm.m[0]}"/> + +<c:set var="widgetInstanceName" value="listMetrics"/> +<script type="text/javascript"> +var pageData = new Array(); +initializeWidgetProperties('<c:out value="${widgetInstanceName}"/>'); +widgetProperties = getWidgetProperties('<c:out value="${widgetInstanceName}"/>'); +</script> + +<!-- PARTICIPATING RESOURCE TITLE --> +<tiles:insert definition=".header.tab"> +<tiles:put name="tabKey" value="resource.common.monitor.visibility.chart.ParticipatingResourceTab"/> +</tiles:insert> +<!-- / --> + +<div id="listDiv"> +<table width="100%" cellpadding="0" cellspacing="0" border="0" id="listTable"> + <tr class="ListHeaderDark"> + <td width="29%" class="ListHeaderInactiveSorted"><fmt:message + key="resource.common.monitor.visibility.MetricNameTH"/></td> + <td width="1%" class="ListHeaderInactiveSorted"><html:img + page="/images/spacer.gif" width="1" height="1" alt="" + border="0"/></td> + <td width="69%" class="ListHeaderInactiveSorted"><fmt:message + key="resource.common.monitor.visibility.ResourceTH"/></td> + </tr> + <c:forEach var="resource" varStatus="rStatus" items="${resources}"> + <c:url var="resourceUrl" value="/Resource.do"> + <c:param name="rid" value="${resource.id}"/> + <c:param name="type" value="${resource.entityId.type}"/> + </c:url> + <tr class="ListRow"> + <c:if test="${rStatus.first}"> + <td rowspan="<c:out value='${resourcesSize}'/>" + class="ListCellPrimary" valign="top"><c:out value="${metricSummaries[0].label}"/></td> + </c:if> + <c:set var="maxResources"><c:out value="${checkedResourcesSize}"/></c:set> + <c:set var="maxMessage"> + <fmt:message key="resource.common.monitor.visibility.chart.TooManyResources"> + <fmt:param value="${maxResources}"/> + </fmt:message> + </c:set> + <td class="ListCellLeftLineNoPadding" valign="top"><html:multibox + property="resourceIds" value="${resource.id}" + onclick="ToggleSelection(this, widgetProperties, ${maxResources}, '${maxMessage}');" + styleClass="resourceList"/></td> + <c:set var="resCellClass" value="ListCellPrimary"/> + <td + class="<c:out value='${resCellClass}'/>" valign="top"> + <html:link href="${resourceUrl}"><c:out value="${resource.name}"/></html:link> + </td> + </tr> + </c:forEach> +</table> + +<!-- REDRAW SELECTED TOOLBAR --> +<table width="100%" cellpadding="5" cellspacing="0" border="0" class="ToolbarContent"> + <tr> + <td id="<c:out value="${widgetInstanceName}"/>RedrawTd"><div + id="<c:out value="${widgetInstanceName}"/>RedrawDiv"><html:img + page="/images/tbb_redrawselectedonchart_gray.gif" width="171" + height="16" alt="" border="0"/></div></td> + <td width="100%" align="right"> </td> + </tr> +</table> +<!-- / --> + +</div> + +<input type="Hidden" id="privateChart"> +<script type="text/javascript"> + testCheckboxes('<c:out value="${widgetInstanceName}"/>'); +</script> |
From: <bo...@hy...> - 2009-11-19 21:36:21
|
Author: bob Date: 2009-11-19 13:36:05 -0800 (Thu, 19 Nov 2009) New Revision: 13973 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13973 Modified: branches/HQ_4_2_0_PATCH/etc/version.properties Log: Release 4.2.0.1 build #1263 Modified: branches/HQ_4_2_0_PATCH/etc/version.properties =================================================================== --- branches/HQ_4_2_0_PATCH/etc/version.properties 2009-11-19 19:23:52 UTC (rev 13972) +++ branches/HQ_4_2_0_PATCH/etc/version.properties 2009-11-19 21:36:05 UTC (rev 13973) @@ -1,3 +1,3 @@ -#Thu Nov 19 05:09:47 PST 2009 +#Thu Nov 19 13:04:19 PST 2009 version=4.2.0.1 -build=1262 +build=1263 |
From: <sc...@hy...> - 2009-11-19 19:24:06
|
Author: scottmf Date: 2009-11-19 11:23:52 -0800 (Thu, 19 Nov 2009) New Revision: 13972 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13972 Modified: branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/measurement/server/session/AvailabilityDataDAO.java branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/measurement/server/session/MeasurementDAO.java Log: [HHQ-3524] batching measurement queries with maximum of 1000 to avoid oracle limit and hibernate bug Modified: branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/measurement/server/session/AvailabilityDataDAO.java =================================================================== --- branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/measurement/server/session/AvailabilityDataDAO.java 2009-11-19 19:08:19 UTC (rev 13971) +++ branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/measurement/server/session/AvailabilityDataDAO.java 2009-11-19 19:23:52 UTC (rev 13972) @@ -25,12 +25,13 @@ package org.hyperic.hq.measurement.server.session; +import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.Iterator; import java.util.List; -import java.util.ArrayList; import java.util.Map; import java.util.TreeSet; @@ -39,6 +40,8 @@ import org.hibernate.Query; import org.hibernate.type.IntegerType; import org.hyperic.dao.DAOFactory; +import org.hyperic.hibernate.Util; +import org.hyperic.hibernate.dialect.HQDialect; import org.hyperic.hq.authz.server.session.Resource; import org.hyperic.hq.dao.HibernateDAO; import org.hyperic.hq.measurement.MeasurementConstants; @@ -64,7 +67,7 @@ "(" + TOTAL_TIME + ") * rle.availVal"; public AvailabilityDataDAO(DAOFactory f) { - super(AvailabilityDataDAO.class, f); + super(AvailabilityDataRLE.class, f); } List findLastAvail(List mids, long after) { @@ -215,7 +218,9 @@ */ List getHistoricalAvails(Integer[] mids, long start, long end, boolean descending) { - String sql = new StringBuilder() + final List rtn = new ArrayList(mids.length); + final List list = Arrays.asList(mids); + final String sql = new StringBuilder() .append("FROM AvailabilityDataRLE rle") .append(" WHERE rle.availabilityDataId.measurement in (:mids)") .append(" AND rle.endtime > :startime") @@ -223,12 +228,16 @@ .append(" ORDER BY rle.availabilityDataId.measurement,") .append(" rle.availabilityDataId.startime") .append(((descending) ? " DESC" : " ASC")).toString(); - return getSession() - .createQuery(sql) - .setLong("startime", start) - .setLong("endtime", end) - .setParameterList("mids", mids, new IntegerType()) - .list(); + for (int i=0; i<list.size(); i+=BATCH_SIZE) { + final int last = Math.min(i+BATCH_SIZE, list.size()); + rtn.addAll(getSession() + .createQuery(sql) + .setLong("startime", start) + .setLong("endtime", end) + .setParameterList("mids", list.subList(i, last), new IntegerType()) + .list()); + } + return rtn; } /** Modified: branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/measurement/server/session/MeasurementDAO.java =================================================================== --- branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/measurement/server/session/MeasurementDAO.java 2009-11-19 19:08:19 UTC (rev 13971) +++ branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/measurement/server/session/MeasurementDAO.java 2009-11-19 19:23:52 UTC (rev 13972) @@ -40,7 +40,6 @@ import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.criterion.Restrictions; -import org.hibernate.dialect.Dialect; import org.hibernate.type.IntegerType; import org.hyperic.dao.DAOFactory; import org.hyperic.hibernate.Util; @@ -474,33 +473,55 @@ } List findMeasurements(Integer[] tids, Integer[] iids) { + final IntegerType iType = new IntegerType(); // sort to take advantage of query cache - final List iidList = Arrays.asList(iids); - final List tidList = Arrays.asList(tids); + final List iidList = new ArrayList(Arrays.asList(iids)); + final List tidList = new ArrayList(Arrays.asList(tids)); Collections.sort(tidList); Collections.sort(iidList); - final String sql = new StringBuilder() + final String sql = new StringBuilder(256) .append("select m from Measurement m ") .append("join m.template t ") .append("where m.instanceId in (:iids) AND t.id in (:tids)") .toString(); - return getSession().createQuery(sql) - .setParameterList("iids", iidList, new IntegerType()) - .setParameterList("tids", tidList, new IntegerType()) - .setCacheable(true) - .setCacheRegion("Measurement.findMeasurements") - .list(); + final List rtn = new ArrayList(iidList.size()); + final int batch = BATCH_SIZE/2; + for (int xx=0; xx<iidList.size(); xx+=batch) { + final int iidEnd = Math.min(xx+batch, iidList.size()); + for (int yy=0; yy<tidList.size(); yy+=batch) { + final int tidEnd = Math.min(yy+batch, tidList.size()); + rtn.addAll(getSession().createQuery(sql) + .setParameterList("iids", iidList.subList(xx, iidEnd), iType) + .setParameterList("tids", tidList.subList(yy, tidEnd), iType) + .setCacheable(true) + .setCacheRegion("Measurement.findMeasurements") + .list()); + } + } + return rtn; } List findAvailMeasurements(Integer[] tids, Integer[] iids) { - String sql = new StringBuilder() + final IntegerType iType = new IntegerType(); + final List iidList = Arrays.asList(iids); + final List tidList = Arrays.asList(tids); + final String sql = new StringBuilder(256) .append("select m from Measurement m ") .append("join m.template t ") .append("where m.instanceId in (:iids) AND t.id in (:tids) AND ") .append(ALIAS_CLAUSE).toString(); - return getSession().createQuery(sql) - .setParameterList("iids", iids) - .setParameterList("tids", tids).list(); + final List rtn = new ArrayList(iidList.size()); + final int batch = BATCH_SIZE/2; + for (int xx=0; xx<iidList.size(); xx+=batch) { + final int iidEnd = Math.min(xx+batch, iidList.size()); + for (int yy=0; yy<tidList.size(); yy+=batch) { + final int tidEnd = Math.min(yy+batch, tidList.size()); + rtn.addAll(getSession().createQuery(sql) + .setParameterList("iids", iidList.subList(xx, iidEnd), iType) + .setParameterList("tids", tidList.subList(yy, tidEnd), iType).list()); + } + } + return rtn; } /** |
From: <bo...@hy...> - 2009-11-19 19:08:30
|
Author: bob Date: 2009-11-19 11:08:19 -0800 (Thu, 19 Nov 2009) New Revision: 13971 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13971 Modified: branches/HQ_4_2_0_PATCH/etc/version.properties Log: update version to 4.2.0.1 Modified: branches/HQ_4_2_0_PATCH/etc/version.properties =================================================================== --- branches/HQ_4_2_0_PATCH/etc/version.properties 2009-11-19 18:58:10 UTC (rev 13970) +++ branches/HQ_4_2_0_PATCH/etc/version.properties 2009-11-19 19:08:19 UTC (rev 13971) @@ -1,3 +1,3 @@ #Thu Nov 19 05:09:47 PST 2009 -version=4.2.0 +version=4.2.0.1 build=1262 |
From: <sc...@hy...> - 2009-11-19 18:58:22
|
Author: scottmf Date: 2009-11-19 10:58:10 -0800 (Thu, 19 Nov 2009) New Revision: 13970 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13970 Modified: branches/HQ_4_2/src/org/hyperic/hq/measurement/server/session/AvailabilityDataDAO.java branches/HQ_4_2/src/org/hyperic/hq/measurement/server/session/MeasurementDAO.java Log: [HHQ-3524] batching measurement queries with maximum of 1000 to avoid oracle limit and hibernate bug Modified: branches/HQ_4_2/src/org/hyperic/hq/measurement/server/session/AvailabilityDataDAO.java =================================================================== --- branches/HQ_4_2/src/org/hyperic/hq/measurement/server/session/AvailabilityDataDAO.java 2009-11-19 18:57:16 UTC (rev 13969) +++ branches/HQ_4_2/src/org/hyperic/hq/measurement/server/session/AvailabilityDataDAO.java 2009-11-19 18:58:10 UTC (rev 13970) @@ -25,12 +25,13 @@ package org.hyperic.hq.measurement.server.session; +import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.Iterator; import java.util.List; -import java.util.ArrayList; import java.util.Map; import java.util.TreeSet; @@ -39,6 +40,8 @@ import org.hibernate.Query; import org.hibernate.type.IntegerType; import org.hyperic.dao.DAOFactory; +import org.hyperic.hibernate.Util; +import org.hyperic.hibernate.dialect.HQDialect; import org.hyperic.hq.authz.server.session.Resource; import org.hyperic.hq.dao.HibernateDAO; import org.hyperic.hq.measurement.MeasurementConstants; @@ -64,7 +67,7 @@ "(" + TOTAL_TIME + ") * rle.availVal"; public AvailabilityDataDAO(DAOFactory f) { - super(AvailabilityDataDAO.class, f); + super(AvailabilityDataRLE.class, f); } List findLastAvail(List mids, long after) { @@ -215,7 +218,9 @@ */ List getHistoricalAvails(Integer[] mids, long start, long end, boolean descending) { - String sql = new StringBuilder() + final List rtn = new ArrayList(mids.length); + final List list = Arrays.asList(mids); + final String sql = new StringBuilder() .append("FROM AvailabilityDataRLE rle") .append(" WHERE rle.availabilityDataId.measurement in (:mids)") .append(" AND rle.endtime > :startime") @@ -223,12 +228,16 @@ .append(" ORDER BY rle.availabilityDataId.measurement,") .append(" rle.availabilityDataId.startime") .append(((descending) ? " DESC" : " ASC")).toString(); - return getSession() - .createQuery(sql) - .setLong("startime", start) - .setLong("endtime", end) - .setParameterList("mids", mids, new IntegerType()) - .list(); + for (int i=0; i<list.size(); i+=BATCH_SIZE) { + final int last = Math.min(i+BATCH_SIZE, list.size()); + rtn.addAll(getSession() + .createQuery(sql) + .setLong("startime", start) + .setLong("endtime", end) + .setParameterList("mids", list.subList(i, last), new IntegerType()) + .list()); + } + return rtn; } /** Modified: branches/HQ_4_2/src/org/hyperic/hq/measurement/server/session/MeasurementDAO.java =================================================================== --- branches/HQ_4_2/src/org/hyperic/hq/measurement/server/session/MeasurementDAO.java 2009-11-19 18:57:16 UTC (rev 13969) +++ branches/HQ_4_2/src/org/hyperic/hq/measurement/server/session/MeasurementDAO.java 2009-11-19 18:58:10 UTC (rev 13970) @@ -40,7 +40,6 @@ import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.criterion.Restrictions; -import org.hibernate.dialect.Dialect; import org.hibernate.type.IntegerType; import org.hyperic.dao.DAOFactory; import org.hyperic.hibernate.Util; @@ -474,33 +473,55 @@ } List findMeasurements(Integer[] tids, Integer[] iids) { + final IntegerType iType = new IntegerType(); // sort to take advantage of query cache - final List iidList = Arrays.asList(iids); - final List tidList = Arrays.asList(tids); + final List iidList = new ArrayList(Arrays.asList(iids)); + final List tidList = new ArrayList(Arrays.asList(tids)); Collections.sort(tidList); Collections.sort(iidList); - final String sql = new StringBuilder() + final String sql = new StringBuilder(256) .append("select m from Measurement m ") .append("join m.template t ") .append("where m.instanceId in (:iids) AND t.id in (:tids)") .toString(); - return getSession().createQuery(sql) - .setParameterList("iids", iidList, new IntegerType()) - .setParameterList("tids", tidList, new IntegerType()) - .setCacheable(true) - .setCacheRegion("Measurement.findMeasurements") - .list(); + final List rtn = new ArrayList(iidList.size()); + final int batch = BATCH_SIZE/2; + for (int xx=0; xx<iidList.size(); xx+=batch) { + final int iidEnd = Math.min(xx+batch, iidList.size()); + for (int yy=0; yy<tidList.size(); yy+=batch) { + final int tidEnd = Math.min(yy+batch, tidList.size()); + rtn.addAll(getSession().createQuery(sql) + .setParameterList("iids", iidList.subList(xx, iidEnd), iType) + .setParameterList("tids", tidList.subList(yy, tidEnd), iType) + .setCacheable(true) + .setCacheRegion("Measurement.findMeasurements") + .list()); + } + } + return rtn; } List findAvailMeasurements(Integer[] tids, Integer[] iids) { - String sql = new StringBuilder() + final IntegerType iType = new IntegerType(); + final List iidList = Arrays.asList(iids); + final List tidList = Arrays.asList(tids); + final String sql = new StringBuilder(256) .append("select m from Measurement m ") .append("join m.template t ") .append("where m.instanceId in (:iids) AND t.id in (:tids) AND ") .append(ALIAS_CLAUSE).toString(); - return getSession().createQuery(sql) - .setParameterList("iids", iids) - .setParameterList("tids", tids).list(); + final List rtn = new ArrayList(iidList.size()); + final int batch = BATCH_SIZE/2; + for (int xx=0; xx<iidList.size(); xx+=batch) { + final int iidEnd = Math.min(xx+batch, iidList.size()); + for (int yy=0; yy<tidList.size(); yy+=batch) { + final int tidEnd = Math.min(yy+batch, tidList.size()); + rtn.addAll(getSession().createQuery(sql) + .setParameterList("iids", iidList.subList(xx, iidEnd), iType) + .setParameterList("tids", tidList.subList(yy, tidEnd), iType).list()); + } + } + return rtn; } /** |
From: <sc...@hy...> - 2009-11-19 18:57:30
|
Author: scottmf Date: 2009-11-19 10:57:16 -0800 (Thu, 19 Nov 2009) New Revision: 13969 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13969 Modified: trunk/src/org/hyperic/hq/measurement/server/session/AvailabilityDataDAO.java trunk/src/org/hyperic/hq/measurement/server/session/MeasurementDAO.java Log: [HHQ-3524] batching measurement queries with maximum of 1000 to avoid oracle limit and hibernate bug Modified: trunk/src/org/hyperic/hq/measurement/server/session/AvailabilityDataDAO.java =================================================================== --- trunk/src/org/hyperic/hq/measurement/server/session/AvailabilityDataDAO.java 2009-11-19 17:10:18 UTC (rev 13968) +++ trunk/src/org/hyperic/hq/measurement/server/session/AvailabilityDataDAO.java 2009-11-19 18:57:16 UTC (rev 13969) @@ -25,12 +25,13 @@ package org.hyperic.hq.measurement.server.session; +import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.Iterator; import java.util.List; -import java.util.ArrayList; import java.util.Map; import java.util.TreeSet; @@ -39,6 +40,8 @@ import org.hibernate.Query; import org.hibernate.type.IntegerType; import org.hyperic.dao.DAOFactory; +import org.hyperic.hibernate.Util; +import org.hyperic.hibernate.dialect.HQDialect; import org.hyperic.hq.authz.server.session.Resource; import org.hyperic.hq.dao.HibernateDAO; import org.hyperic.hq.measurement.MeasurementConstants; @@ -64,7 +67,7 @@ "(" + TOTAL_TIME + ") * rle.availVal"; public AvailabilityDataDAO(DAOFactory f) { - super(AvailabilityDataDAO.class, f); + super(AvailabilityDataRLE.class, f); } List findLastAvail(List mids, long after) { @@ -215,7 +218,9 @@ */ List getHistoricalAvails(Integer[] mids, long start, long end, boolean descending) { - String sql = new StringBuilder() + final List rtn = new ArrayList(mids.length); + final List list = Arrays.asList(mids); + final String sql = new StringBuilder() .append("FROM AvailabilityDataRLE rle") .append(" WHERE rle.availabilityDataId.measurement in (:mids)") .append(" AND rle.endtime > :startime") @@ -223,12 +228,16 @@ .append(" ORDER BY rle.availabilityDataId.measurement,") .append(" rle.availabilityDataId.startime") .append(((descending) ? " DESC" : " ASC")).toString(); - return getSession() - .createQuery(sql) - .setLong("startime", start) - .setLong("endtime", end) - .setParameterList("mids", mids, new IntegerType()) - .list(); + for (int i=0; i<list.size(); i+=BATCH_SIZE) { + final int last = Math.min(i+BATCH_SIZE, list.size()); + rtn.addAll(getSession() + .createQuery(sql) + .setLong("startime", start) + .setLong("endtime", end) + .setParameterList("mids", list.subList(i, last), new IntegerType()) + .list()); + } + return rtn; } /** Modified: trunk/src/org/hyperic/hq/measurement/server/session/MeasurementDAO.java =================================================================== --- trunk/src/org/hyperic/hq/measurement/server/session/MeasurementDAO.java 2009-11-19 17:10:18 UTC (rev 13968) +++ trunk/src/org/hyperic/hq/measurement/server/session/MeasurementDAO.java 2009-11-19 18:57:16 UTC (rev 13969) @@ -40,7 +40,6 @@ import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.criterion.Restrictions; -import org.hibernate.dialect.Dialect; import org.hibernate.type.IntegerType; import org.hyperic.dao.DAOFactory; import org.hyperic.hibernate.Util; @@ -474,33 +473,55 @@ } List findMeasurements(Integer[] tids, Integer[] iids) { + final IntegerType iType = new IntegerType(); // sort to take advantage of query cache - final List iidList = Arrays.asList(iids); - final List tidList = Arrays.asList(tids); + final List iidList = new ArrayList(Arrays.asList(iids)); + final List tidList = new ArrayList(Arrays.asList(tids)); Collections.sort(tidList); Collections.sort(iidList); - final String sql = new StringBuilder() + final String sql = new StringBuilder(256) .append("select m from Measurement m ") .append("join m.template t ") .append("where m.instanceId in (:iids) AND t.id in (:tids)") .toString(); - return getSession().createQuery(sql) - .setParameterList("iids", iidList, new IntegerType()) - .setParameterList("tids", tidList, new IntegerType()) - .setCacheable(true) - .setCacheRegion("Measurement.findMeasurements") - .list(); + final List rtn = new ArrayList(iidList.size()); + final int batch = BATCH_SIZE/2; + for (int xx=0; xx<iidList.size(); xx+=batch) { + final int iidEnd = Math.min(xx+batch, iidList.size()); + for (int yy=0; yy<tidList.size(); yy+=batch) { + final int tidEnd = Math.min(yy+batch, tidList.size()); + rtn.addAll(getSession().createQuery(sql) + .setParameterList("iids", iidList.subList(xx, iidEnd), iType) + .setParameterList("tids", tidList.subList(yy, tidEnd), iType) + .setCacheable(true) + .setCacheRegion("Measurement.findMeasurements") + .list()); + } + } + return rtn; } List findAvailMeasurements(Integer[] tids, Integer[] iids) { - String sql = new StringBuilder() + final IntegerType iType = new IntegerType(); + final List iidList = Arrays.asList(iids); + final List tidList = Arrays.asList(tids); + final String sql = new StringBuilder(256) .append("select m from Measurement m ") .append("join m.template t ") .append("where m.instanceId in (:iids) AND t.id in (:tids) AND ") .append(ALIAS_CLAUSE).toString(); - return getSession().createQuery(sql) - .setParameterList("iids", iids) - .setParameterList("tids", tids).list(); + final List rtn = new ArrayList(iidList.size()); + final int batch = BATCH_SIZE/2; + for (int xx=0; xx<iidList.size(); xx+=batch) { + final int iidEnd = Math.min(xx+batch, iidList.size()); + for (int yy=0; yy<tidList.size(); yy+=batch) { + final int tidEnd = Math.min(yy+batch, tidList.size()); + rtn.addAll(getSession().createQuery(sql) + .setParameterList("iids", iidList.subList(xx, iidEnd), iType) + .setParameterList("tids", tidList.subList(yy, tidEnd), iType).list()); + } + } + return rtn; } /** |
From: <pn...@hy...> - 2009-11-19 17:10:30
|
Author: pnguyen Date: 2009-11-19 09:10:18 -0800 (Thu, 19 Nov 2009) New Revision: 13968 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13968 Modified: trunk/src/org/hyperic/hq/appdef/server/session/Service.java trunk/src/org/hyperic/hq/appdef/shared/ServiceValue.java Log: [HHQ-3513] Added resourceId to ServiceValue so HQApi does not need to do an additional lookup Modified: trunk/src/org/hyperic/hq/appdef/server/session/Service.java =================================================================== --- trunk/src/org/hyperic/hq/appdef/server/session/Service.java 2009-11-19 17:00:44 UTC (rev 13967) +++ trunk/src/org/hyperic/hq/appdef/server/session/Service.java 2009-11-19 17:10:18 UTC (rev 13968) @@ -178,6 +178,8 @@ _serviceValue.setName(getName()); _serviceValue.setDescription(getDescription()); _serviceValue.setId(getId()); + _serviceValue.setResourceId(getResource() != null ? + getResource().getId() : null); _serviceValue.setMTime(getMTime()); _serviceValue.setCTime(getCTime()); if (getServer() != null) { Modified: trunk/src/org/hyperic/hq/appdef/shared/ServiceValue.java =================================================================== --- trunk/src/org/hyperic/hq/appdef/shared/ServiceValue.java 2009-11-19 17:00:44 UTC (rev 13967) +++ trunk/src/org/hyperic/hq/appdef/shared/ServiceValue.java 2009-11-19 17:10:18 UTC (rev 13968) @@ -62,6 +62,8 @@ private boolean descriptionHasBeenSet = false; private Integer id; private boolean idHasBeenSet = false; + private Integer resourceId; + private boolean resourceIdHasBeenSet = false; private Long mTime; private boolean mTimeHasBeenSet = false; private Long cTime; @@ -131,6 +133,8 @@ configResponseIdHasBeenSet = true; this.parentId = otherValue.parentId; parentIdHasBeenSet = true; + this.resourceId = otherValue.resourceId; + resourceIdHasBeenSet = true; this.name = otherValue.name; nameHasBeenSet = true; this.description = otherValue.description; @@ -287,6 +291,20 @@ public boolean parentIdHasBeenSet(){ return parentIdHasBeenSet; } + + public Integer getResourceId() { + return this.resourceId; + } + + public void setResourceId(Integer resourceId) { + this.resourceId = resourceId; + resourceIdHasBeenSet = true; + } + + public boolean resourceIdHasBeenSet() { + return resourceIdHasBeenSet; + } + public String getName() { return this.name; |
From: <pn...@hy...> - 2009-11-19 17:00:57
|
Author: pnguyen Date: 2009-11-19 09:00:44 -0800 (Thu, 19 Nov 2009) New Revision: 13967 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13967 Modified: branches/HQ_4_2/src/org/hyperic/hq/appdef/server/session/Service.java branches/HQ_4_2/src/org/hyperic/hq/appdef/shared/ServiceValue.java Log: [HHQ-3513] Added resourceId to ServiceValue so HQApi does not need to do an additional lookup Modified: branches/HQ_4_2/src/org/hyperic/hq/appdef/server/session/Service.java =================================================================== --- branches/HQ_4_2/src/org/hyperic/hq/appdef/server/session/Service.java 2009-11-19 13:46:21 UTC (rev 13966) +++ branches/HQ_4_2/src/org/hyperic/hq/appdef/server/session/Service.java 2009-11-19 17:00:44 UTC (rev 13967) @@ -178,6 +178,8 @@ _serviceValue.setName(getName()); _serviceValue.setDescription(getDescription()); _serviceValue.setId(getId()); + _serviceValue.setResourceId(getResource() != null ? + getResource().getId() : null); _serviceValue.setMTime(getMTime()); _serviceValue.setCTime(getCTime()); if (getServer() != null) { Modified: branches/HQ_4_2/src/org/hyperic/hq/appdef/shared/ServiceValue.java =================================================================== --- branches/HQ_4_2/src/org/hyperic/hq/appdef/shared/ServiceValue.java 2009-11-19 13:46:21 UTC (rev 13966) +++ branches/HQ_4_2/src/org/hyperic/hq/appdef/shared/ServiceValue.java 2009-11-19 17:00:44 UTC (rev 13967) @@ -62,6 +62,8 @@ private boolean descriptionHasBeenSet = false; private Integer id; private boolean idHasBeenSet = false; + private Integer resourceId; + private boolean resourceIdHasBeenSet = false; private Long mTime; private boolean mTimeHasBeenSet = false; private Long cTime; @@ -131,6 +133,8 @@ configResponseIdHasBeenSet = true; this.parentId = otherValue.parentId; parentIdHasBeenSet = true; + this.resourceId = otherValue.resourceId; + resourceIdHasBeenSet = true; this.name = otherValue.name; nameHasBeenSet = true; this.description = otherValue.description; @@ -287,6 +291,20 @@ public boolean parentIdHasBeenSet(){ return parentIdHasBeenSet; } + + public Integer getResourceId() { + return this.resourceId; + } + + public void setResourceId(Integer resourceId) { + this.resourceId = resourceId; + resourceIdHasBeenSet = true; + } + + public boolean resourceIdHasBeenSet() { + return resourceIdHasBeenSet; + } + public String getName() { return this.name; |
From: <bo...@hy...> - 2009-11-19 13:46:34
|
Author: bob Date: 2009-11-19 05:46:21 -0800 (Thu, 19 Nov 2009) New Revision: 13966 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13966 Modified: branches/HQ_4_2_0_PATCH/etc/version.properties Log: Release 4.2.0 build #1262 Modified: branches/HQ_4_2_0_PATCH/etc/version.properties =================================================================== --- branches/HQ_4_2_0_PATCH/etc/version.properties 2009-11-19 10:32:33 UTC (rev 13965) +++ branches/HQ_4_2_0_PATCH/etc/version.properties 2009-11-19 13:46:21 UTC (rev 13966) @@ -1,3 +1,3 @@ -#Wed Nov 18 22:58:10 PST 2009 +#Thu Nov 19 05:09:47 PST 2009 version=4.2.0 -build=1261 +build=1262 |
From: <bo...@hy...> - 2009-11-19 10:32:48
|
Author: bob Date: 2009-11-19 02:32:33 -0800 (Thu, 19 Nov 2009) New Revision: 13965 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13965 Modified: branches/HQ_4_2/etc/version.properties Log: Release 4.2.1 build #1267 Modified: branches/HQ_4_2/etc/version.properties =================================================================== --- branches/HQ_4_2/etc/version.properties 2009-11-19 08:51:29 UTC (rev 13964) +++ branches/HQ_4_2/etc/version.properties 2009-11-19 10:32:33 UTC (rev 13965) @@ -1,3 +1,3 @@ -#Wed Nov 18 01:18:04 PST 2009 +#Thu Nov 19 01:38:07 PST 2009 version=4.2.1 -build=1266 +build=1267 |
From: <bo...@hy...> - 2009-11-19 08:51:40
|
Author: bob Date: 2009-11-19 00:51:29 -0800 (Thu, 19 Nov 2009) New Revision: 13964 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13964 Modified: trunk/etc/version.properties Log: Release 4.3.0 build #1263 Modified: trunk/etc/version.properties =================================================================== --- trunk/etc/version.properties 2009-11-19 07:28:00 UTC (rev 13963) +++ trunk/etc/version.properties 2009-11-19 08:51:29 UTC (rev 13964) @@ -1,3 +1,3 @@ -#Wed Nov 18 00:26:41 PST 2009 +#Thu Nov 19 00:20:00 PST 2009 version=4.3.0 -build=1262 +build=1263 |