modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftCarouselView.java | 2 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/LiveGraphView.java | 9 +++++-
modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml | 14 ++--------
modules/plugins/platform/src/main/java/org/rhq/plugins/platform/CpuComponent.java | 11 ++++---
4 files changed, 19 insertions(+), 17 deletions(-)
New commits:
commit 63957050f668025e2284b9db58dd6ca863036f16
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Dec 5 11:08:25 2011 -0500
[Bug 760105 - Drift: Unchecking the 'File Changed' option in 'Category' drop-down in the carousel view displays Globally uncaught exception]
This had to do with the filtering leaving no eligible snapshots.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftCarouselView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftCarouselView.java
index 6899913..bea8c99 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftCarouselView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftCarouselView.java
@@ -167,7 +167,7 @@ public class DriftCarouselView extends BookmarkableCarousel implements DetailsVi
break;
}
}
- if (null == maxSnapshotVersion || maxSnapshotVersion < carouselStart) {
+ if (null == maxSnapshotVersion || null == carouselStart || maxSnapshotVersion < carouselStart) {
maxSnapshotVersion = carouselStart;
setCarouselStartFilterMax(maxSnapshotVersion);
}
commit 34653b7a47a6f3aaea2485928d5f31e0c17f2a94
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Dec 2 13:52:59 2011 -0500
[Bug 759485 - Error viewing live data in the resource metric graph portlet]
- Fixed the live graph code to throw out metric requests returning no values
- Fixed CpuComponent to return valid data on a live metric request, instead
of null.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/LiveGraphView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/LiveGraphView.java
index 01284cc..5076804 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/LiveGraphView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/LiveGraphView.java
@@ -19,6 +19,7 @@
package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring;
import java.util.Date;
+import java.util.Iterator;
import java.util.Set;
import ca.nanometrics.gflot.client.Axis;
@@ -81,6 +82,7 @@ public class LiveGraphView extends LocatableVLayout {
private SimplePlot plot;
private Timer dataLoader;
+ @SuppressWarnings("unused")
private long min, max;
public LiveGraphView(String locatorId) {
@@ -231,7 +233,12 @@ public class LiveGraphView extends LocatableVLayout {
}
public void onSuccess(Set<MeasurementData> result) {
- MeasurementDataNumeric d = (MeasurementDataNumeric) result.iterator().next();
+ Iterator<MeasurementData> i = result.iterator();
+ if (!i.hasNext()) {
+ return;
+ }
+
+ MeasurementDataNumeric d = (MeasurementDataNumeric) i.next();
handler.add(new DataPoint(d.getTimestamp(), d.getValue()));
plot.redraw();
diff --git a/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/CpuComponent.java b/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/CpuComponent.java
index d5bc264..f045126 100644
--- a/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/CpuComponent.java
+++ b/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/CpuComponent.java
@@ -124,14 +124,15 @@ public class CpuComponent implements ResourceComponent<PlatformComponent>, Measu
CpuEntry previousCpu = cpuCache.put(property, currentCpu);
previousCpu = (null == previousCpu) ? startCpuEntry : previousCpu;
- // if for some reason the delta time is excessive then toss
- // the metric, since it depends on a reasonable interval between
- // prev and curr. This can happen due to avail down or a newly
- // activated metric. Allow up to twice the metric interval.
+ // if for some reason the delta time is excessive then toss the metric, since it depends
+ // on a reasonable interval between prev and curr. This can happen due to avail down or a newly
+ // activated metric. Allow up to twice the metric interval. If the metric interval is
+ // 0 (for a live data request) then just use a 10 minute interval.
Number num = null;
long deltaTime = currentCpu.getTimestamp() - previousCpu.getTimestamp();
+ long metricInterval = (0 < request.getInterval()) ? request.getInterval() : 600000L;
- if (deltaTime <= (2 * request.getInterval())) {
+ if (deltaTime <= (2 * metricInterval)) {
// Use the same calculation that SIGAR uses to generate the percentages. The difference is that
// we use a safe "previous" cpu record.
num = getPercentage(previousCpu.getCpu(), cpu, property);
commit 238435dfb011275596e27aae58fc54cdd15d2282
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Jan 16 13:45:09 2012 -0500
[Bug 758503 - Various AS-5 plugin types have unset read-only plugin config props]
required/read-only contextPath and filename props were not being set
[reliably] at discovery time. Removed filename props, which did not seem
to be used by the plugin. Set contextPath props to required="false".
The value does not seem to be used by the plugin but the property is
at least defined in the code.
diff --git a/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml
index e1b8d25..2d1e86a 100644
--- a/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml
@@ -2278,7 +2278,6 @@
<plugin-configuration>
<c:group name="general" displayName="General">
<c:simple-property name="deploymentName" description="The name of this EAR" readOnly="true"/>
- <c:simple-property name="filename" readOnly="true"/>
</c:group>
<c:group name="advanced" displayName="Advanced" hiddenByDefault="true">
<c:simple-property name="extension" default="ear" readOnly="true"/>
@@ -2335,8 +2334,8 @@
<plugin-configuration>
<c:group name="general" displayName="General">
<c:simple-property name="deploymentName" description="the name of this WAR" readOnly="true"/>
- <c:simple-property name="filename" readOnly="true"/>
- <c:simple-property name="contextPath" description="this WAR's context path (e.g. /admin-console)" readOnly="true"/>
+ <!-- setting to required=false since this is not usually set properly at discovery time -->
+ <c:simple-property name="contextPath" description="this WAR's context path (e.g. /admin-console)" required="false" readOnly="false"/>
</c:group>
<c:group name="advanced" displayName="Advanced" hiddenByDefault="true">
<c:simple-property name="extension" default="war" readOnly="true"/>
@@ -2418,7 +2417,8 @@
<plugin-configuration>
<c:group name="general" displayName="General">
<c:simple-property name="deploymentName" description="the name of this WAR" readOnly="true"/>
- <c:simple-property name="contextPath" description="this WAR's context path (e.g. /admin-console" readOnly="true"/>
+ <!-- setting to required=false since this is not usually set properly at discovery time -->
+ <c:simple-property name="contextPath" description="this WAR's context path (e.g. /admin-console" required="false" readOnly="false"/>
</c:group>
<c:group name="ResponseTime">
<c:simple-property name="responseTimeLogFile" required="false"
@@ -2485,7 +2485,6 @@
<plugin-configuration>
<c:group name="general" displayName="General">
<c:simple-property name="deploymentName" description="the name of this EJB JAR" readOnly="true"/>
- <c:simple-property name="filename" readOnly="true"/>
</c:group>
<c:group name="advanced" displayName="Advanced" hiddenByDefault="true">
<c:simple-property name="extension" default="jar" readOnly="true"/>
@@ -2581,7 +2580,6 @@
<plugin-configuration>
<c:group name="general" displayName="General">
<c:simple-property name="deploymentName" description="the name of this EJB JAR" readOnly="true"/>
- <c:simple-property name="filename" readOnly="true"/>
</c:group>
<c:group name="advanced" displayName="Advanced" hiddenByDefault="true">
<c:simple-property name="extension" default="jar" readOnly="true"/>
@@ -2654,7 +2652,6 @@
<plugin-configuration>
<c:group name="general" displayName="General">
<c:simple-property name="deploymentName" description="the name of this EJB JAR" readOnly="true"/>
- <c:simple-property name="filename" readOnly="true"/>
</c:group>
<c:group name="advanced" displayName="Advanced" hiddenByDefault="true">
<c:simple-property name="extension" default="jar" readOnly="true"/>
@@ -2731,7 +2728,6 @@
<plugin-configuration>
<c:group name="general" displayName="General">
<c:simple-property name="deploymentName" description="the name of this EJB JAR" readOnly="true"/>
- <c:simple-property name="filename" readOnly="true"/>
</c:group>
<c:group name="advanced" displayName="Advanced" hiddenByDefault="true">
<c:simple-property name="extension" default="jar" readOnly="true"/>
@@ -2793,7 +2789,6 @@
<plugin-configuration>
<c:group name="general" displayName="General">
<c:simple-property name="deploymentName" description="the name of this RAR" readOnly="true"/>
- <c:simple-property name="filename" readOnly="true"/>
</c:group>
<c:group name="advanced" displayName="Advanced" hiddenByDefault="true">
<c:simple-property name="extension" default="rar" readOnly="true"/>
@@ -2839,7 +2834,6 @@
<plugin-configuration>
<c:group name="general" displayName="General">
<c:simple-property name="deploymentName" description="the name of this RAR" readOnly="true"/>
- <c:simple-property name="filename" readOnly="true"/>
</c:group>
<c:group name="advanced" displayName="Advanced" hiddenByDefault="true">
<c:simple-property name="extension" default="rar" readOnly="true"/>