[rhq] 2 commits - modules/plugins
by Thomas Segismont
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java | 55 ++++++++--
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/helper/HostConfiguration.java | 24 ++--
2 files changed, 65 insertions(+), 14 deletions(-)
New commits:
commit bf8587569567d261791f272a672f5722d7dca8c0
Author: Thomas Segismont <tsegismo(a)redhat.com>
Date: Thu Jul 18 23:37:57 2013 +0200
[as7] Fix domain api version discovery
Look for the first node of type element instead of simply calling getFirstChild
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/helper/HostConfiguration.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/helper/HostConfiguration.java
index 329246e..3c71135 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/helper/HostConfiguration.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/helper/HostConfiguration.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2012 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,11 +13,14 @@
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.modules.plugins.jbossas7.helper;
+import static org.rhq.core.util.StringUtil.EMPTY_STRING;
+import static org.w3c.dom.Node.ELEMENT_NODE;
+
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
@@ -33,6 +36,7 @@ import javax.xml.xpath.XPathFactory;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.w3c.dom.Document;
+import org.w3c.dom.Node;
import org.rhq.core.pluginapi.util.CommandLineOption;
import org.rhq.modules.plugins.jbossas7.AS7CommandLine;
@@ -234,11 +238,15 @@ public class HostConfiguration {
}
public String getDomainApiVersion() {
-
- String version = document.getFirstChild().getAttributes().getNamedItem("xmlns").getTextContent();
-
- version = version.substring(version.lastIndexOf(':')+1);
- return version;
+ // Look for the first child node of type element (<host> in domain mode or <server> in standalone mode)
+ // We can't just call getFirstChild because first child could be a node of type comment
+ for (Node childNode = document.getFirstChild(); childNode != null; childNode = childNode.getNextSibling()) {
+ if (childNode.getNodeType() == ELEMENT_NODE) {
+ String xmlns = childNode.getAttributes().getNamedItem("xmlns").getTextContent();
+ return xmlns.substring(xmlns.lastIndexOf(':') + 1);
+ }
+ }
+ return EMPTY_STRING;
}
/**
commit 5283e5356d2ca4bda6e3aeea9d323c186030baa9
Author: Thomas Segismont <tsegismo(a)redhat.com>
Date: Thu Jul 18 09:41:39 2013 +0200
Bug 969621 - EAP 6 managed plug-in is unable to discover EAP servers when more then one is running on a single host
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java
index cc13406..cd9f276 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2012 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,8 @@
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.modules.plugins.jbossas7;
@@ -42,6 +42,7 @@ import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.PropertyList;
import org.rhq.core.domain.configuration.PropertyMap;
import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.resource.ResourceUpgradeReport;
import org.rhq.core.pluginapi.event.log.LogFileEventResourceComponentHelper;
import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
@@ -49,6 +50,8 @@ import org.rhq.core.pluginapi.inventory.ManualAddFacet;
import org.rhq.core.pluginapi.inventory.ProcessScanResult;
import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+import org.rhq.core.pluginapi.upgrade.ResourceUpgradeContext;
+import org.rhq.core.pluginapi.upgrade.ResourceUpgradeFacet;
import org.rhq.core.pluginapi.util.CommandLineOption;
import org.rhq.core.pluginapi.util.FileUtils;
import org.rhq.core.pluginapi.util.JavaCommandLine;
@@ -66,12 +69,15 @@ import org.rhq.modules.plugins.jbossas7.json.Result;
* Abstract base discovery component for the two server types - "JBossAS7 Host Controller" and
* "JBossAS7 Standalone Server".
*/
-public abstract class BaseProcessDiscovery implements ResourceDiscoveryComponent, ManualAddFacet {
+public abstract class BaseProcessDiscovery implements ResourceDiscoveryComponent, ManualAddFacet, ResourceUpgradeFacet {
private static final String JBOSS_AS_PREFIX = "jboss-as-";
private static final String JBOSS_EAP_PREFIX = "jboss-eap-";
private static final String WILDFLY_PREFIX = "wildfly-";
+ private static final String LOCAL_RESOURCE_KEY_PREFIX = "hostConfig: ";
+ private static final String REMOTE_RESOURCE_KEY_PREFIX = "hostPort: ";
+
private static final String HOME_DIR_SYSPROP = "jboss.home.dir";
private static final String RHQADMIN = "rhqadmin";
@@ -202,7 +208,7 @@ public abstract class BaseProcessDiscovery implements ResourceDiscoveryComponent
setStartScriptPluginConfigProps(process, commandLine, pluginConfig, agentProcess);
setUserAndPasswordPluginConfigProps(serverPluginConfig, hostConfig, baseDir);
- String key = baseDir.getPath();
+ String key = createKeyForLocalResource(serverPluginConfig);
HostPort hostPort = hostConfig.getDomainControllerHostPort(commandLine);
String name = buildDefaultResourceName(hostPort, managementHostPort, productType);
String description = buildDefaultResourceDescription(hostPort, productType);
@@ -455,7 +461,7 @@ public abstract class BaseProcessDiscovery implements ResourceDiscoveryComponent
HostPort managementHostPort = new HostPort(false);
managementHostPort.host = hostname;
managementHostPort.port = port;
- String key = hostname + ":" + port;
+ String key = createKeyForRemoteResource(hostname + ":" + port);
String name = buildDefaultResourceName(hostPort, managementHostPort, productType);
String version = productInfo.getProductVersion();
String description = buildDefaultResourceDescription(hostPort, productType);
@@ -469,6 +475,43 @@ public abstract class BaseProcessDiscovery implements ResourceDiscoveryComponent
return detail;
}
+ @Override
+ public ResourceUpgradeReport upgrade(ResourceUpgradeContext inventoriedResource) {
+ String currentResourceKey = inventoriedResource.getResourceKey();
+ Configuration pluginConfiguration = inventoriedResource.getPluginConfiguration();
+ ServerPluginConfiguration serverPluginConfiguration = new ServerPluginConfiguration(pluginConfiguration);
+
+ if (currentResourceKey.startsWith(LOCAL_RESOURCE_KEY_PREFIX)
+ || currentResourceKey.startsWith(REMOTE_RESOURCE_KEY_PREFIX)) {
+ // Resource key already in right format
+ return null;
+ }
+
+ ResourceUpgradeReport report = new ResourceUpgradeReport();
+
+ if (new File(currentResourceKey).isDirectory()) {
+ // Old key format for a local resource (key is base dir)
+ report.setNewResourceKey(createKeyForLocalResource(serverPluginConfiguration));
+ } else if (currentResourceKey.contains(":")) {
+ // Old key format for a remote (manually added) resource (key is base dir)
+ report.setNewResourceKey(createKeyForRemoteResource(currentResourceKey));
+ } else {
+ log.warn("Unknown format, cannot upgrade resource key [" + currentResourceKey + "]");
+ return null;
+ }
+
+ return report;
+ }
+
+ private String createKeyForRemoteResource(String hostPort) {
+ return REMOTE_RESOURCE_KEY_PREFIX + hostPort;
+ }
+
+ private String createKeyForLocalResource(ServerPluginConfiguration serverPluginConfiguration) {
+ return LOCAL_RESOURCE_KEY_PREFIX
+ + serverPluginConfiguration.getHostConfigFile().getAbsolutePath();
+ }
+
private <T>T getServerAttribute(ASConnection connection, String attributeName) {
Operation op = new ReadAttribute(null, attributeName);
Result res = connection.execute(op);
10 years, 10 months
[rhq] Branch 'mtho11/consolidated-metrics' - modules/enterprise
by mike thompson
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java | 28 ----------
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/avail/ResourceAvailabilityView.java | 2
2 files changed, 4 insertions(+), 26 deletions(-)
New commits:
commit 67ad82c393152417d419ebb3c7682f09a9a27f2a
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Thu Jul 18 09:51:38 2013 -0700
Consolidated Metrics - Remove 'Graph' and 'Availability' from monitor second level tabs.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
index 8e959db..08d1fd5 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
@@ -66,7 +66,6 @@ import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.inventory
import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.inventory.ResourceAgentView;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.CalltimeView;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.D3GraphListView;
-import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.avail.ResourceAvailabilityView;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.schedules.ResourceSchedulesView;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.table.MetricsResourceView;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.traits.TraitsView;
@@ -129,10 +128,8 @@ public class ResourceDetailView extends
private SubTab summaryActivity;
private SubTab summaryTimeline;
- private SubTab monitorGraphs;
private SubTab monitorMetrics;
private SubTab monitorTraits;
- private SubTab monitorAvail;
private SubTab monitorSched;
private SubTab monitorCallTime;
private SubTab inventoryChildren;
@@ -196,16 +193,11 @@ public class ResourceDetailView extends
monitoringTab = new TwoLevelTab(new ViewName("Monitoring", MSG.view_tabs_common_monitoring()),
IconEnum.SUSPECT_METRICS);
- monitorGraphs = new SubTab(monitoringTab, new ViewName("Graphs", MSG.view_tabs_common_graphs()), null);
-
monitorMetrics = new SubTab(monitoringTab, new ViewName("Metrics", "Metrics"), null);
monitorTraits = new SubTab(monitoringTab, new ViewName("Traits", MSG.view_tabs_common_traits()), null);
- monitorAvail = new SubTab(monitoringTab, new ViewName("Availability", MSG.view_tabs_common_availability()),
- null);
monitorSched = new SubTab(monitoringTab, new ViewName("Schedules", MSG.view_tabs_common_schedules()), null);
monitorCallTime = new SubTab(monitoringTab, new ViewName("CallTime", MSG.view_tabs_common_calltime()), null);
- monitoringTab.registerSubTabs(monitorGraphs, monitorMetrics, monitorTraits, monitorAvail,
- monitorSched, monitorCallTime);
+ monitoringTab.registerSubTabs( monitorMetrics, monitorTraits, monitorSched, monitorCallTime);
tabs.add(monitoringTab);
eventsTab = new TwoLevelTab(new ViewName("Events", MSG.view_tabs_common_events()), IconEnum.EVENTS);
@@ -395,23 +387,14 @@ public class ResourceDetailView extends
boolean visibleToIE8 = !BrowserUtility.isBrowserPreIE9();
- viewFactory = (!visibleToIE8) ? null : new ViewFactory() {
- @Override
- public Canvas createView() {
- return createD3GraphListView();
- }
- };
- updateSubTab(this.monitoringTab, this.monitorGraphs, visible, visibleToIE8, viewFactory);
-
// visible = same test as above
viewFactory = (!visible) ? null : new ViewFactory() {
@Override
public Canvas createView() {
- //return new MetricsTableView(resource.getId());
return new MetricsResourceView(resource);
}
};
- updateSubTab(this.monitoringTab, this.monitorMetrics, visible, true, viewFactory);
+ updateSubTab(this.monitoringTab, this.monitorMetrics, visible, visibleToIE8, viewFactory);
visible = hasMetricsOfType(this.resourceComposite, DataType.TRAIT);
viewFactory = (!visible) ? null : new ViewFactory() {
@@ -422,13 +405,6 @@ public class ResourceDetailView extends
};
updateSubTab(this.monitoringTab, this.monitorTraits, visible, true, viewFactory);
- updateSubTab(this.monitoringTab, this.monitorAvail, true, true, new ViewFactory() {
- @Override
- public Canvas createView() {
- return new ResourceAvailabilityView(resourceComposite);
- }
- });
-
updateSubTab(this.monitoringTab, this.monitorSched, hasMetricsOfType(this.resourceComposite, null), true,
new ViewFactory() {
@Override
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/avail/ResourceAvailabilityView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/avail/ResourceAvailabilityView.java
index 6719070..3d1c881 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/avail/ResourceAvailabilityView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/avail/ResourceAvailabilityView.java
@@ -62,7 +62,9 @@ import org.rhq.enterprise.gui.coregui.client.util.enhanced.EnhancedVLayout;
*
* @author Jay Shaughnessy
* @author John Mazzitelli
+ * @see org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.table.ResourceMetricAvailabilityView
*/
+@Deprecated
public class ResourceAvailabilityView extends EnhancedVLayout {
private ResourceComposite resourceComposite;
10 years, 10 months
[rhq] Branch 'mtho11/consolidated-metrics' - modules/enterprise
by mike thompson
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsResourceView.java | 18 ++--
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsTableView.java | 43 +++++-----
2 files changed, 34 insertions(+), 27 deletions(-)
New commits:
commit ec43cec8eb7ed5099b8fadafe60db8a128446ef9
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Thu Jul 18 09:19:09 2013 -0700
Consolidated Metrics -Bug fix for collapsing of detail graphs fails to refresh the sparkline graphs.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsResourceView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsResourceView.java
index 99ad1e6..5784ed4 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsResourceView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsResourceView.java
@@ -38,6 +38,7 @@ import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractD3GraphListView;
import org.rhq.enterprise.gui.coregui.client.inventory.common.graph.graphtype.AvailabilityOverUnderGraphType;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.avail.AvailabilityD3GraphView;
+import org.rhq.enterprise.gui.coregui.client.util.BrowserUtility;
import org.rhq.enterprise.gui.coregui.client.util.Log;
import org.rhq.enterprise.gui.coregui.client.util.async.CountDownLatch;
import org.rhq.enterprise.gui.coregui.client.util.enhanced.EnhancedHLayout;
@@ -70,6 +71,16 @@ public class MetricsResourceView extends AbstractD3GraphListView {
this.onDraw();
}
+ public void refreshGraphs(){
+ new Timer() {
+ @Override
+ public void run() {
+ availabilityGraph.drawJsniChart();
+ BrowserUtility.graphSparkLines();
+ }
+ }.schedule(150);
+ }
+
@Override
protected void onDraw() {
super.onDraw();
@@ -108,12 +119,7 @@ public class MetricsResourceView extends AbstractD3GraphListView {
availabilityDetails.show();
}
- new Timer() {
- @Override
- public void run() {
- availabilityGraph.drawJsniChart();
- }
- }.schedule(150);
+ refreshGraphs();
}
});
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsTableView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsTableView.java
index 3cb9233..25e430b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsTableView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsTableView.java
@@ -40,6 +40,8 @@ import com.smartgwt.client.widgets.events.CloseClickHandler;
import com.smartgwt.client.widgets.grid.ListGrid;
import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.grid.ListGridRecord;
+import com.smartgwt.client.widgets.grid.events.RecordCollapseEvent;
+import com.smartgwt.client.widgets.grid.events.RecordCollapseHandler;
import com.smartgwt.client.widgets.grid.events.RecordExpandEvent;
import com.smartgwt.client.widgets.grid.events.RecordExpandHandler;
import com.smartgwt.client.widgets.layout.VLayout;
@@ -99,26 +101,9 @@ public class MetricsTableView extends Table<MetricsViewDataSource> implements Re
protected void configureTable() {
ArrayList<ListGridField> fields = getDataSource().getListGridFields();
setListGridFields(fields.toArray(new ListGridField[0]));
- this.getListGrid().setCanExpandRecords(true);
- this.getListGrid().addRecordExpandHandler(new RecordExpandHandler() {
- @Override
- public void onRecordExpand(RecordExpandEvent recordExpandEvent) {
- Log.debug("Record Expanded: "
- + recordExpandEvent.getRecord().getAttribute(MetricsViewDataSource.FIELD_METRIC_LABEL));
- new Timer() {
-
- @Override
- public void run() {
- BrowserUtility.graphSparkLines();
- }
- }.schedule(150);
-
- }
-
- });
addTableAction(MSG.view_measureTable_getLive(), new ShowLiveDataTableAction(this));
- //addTableAction(MSG.view_measureTable_addToDashboard(), new AddToDashboardTableAction(this));
+ addTableAction(MSG.view_measureTable_addToDashboard(), new AddToDashboardTableAction(this));
}
@@ -284,6 +269,21 @@ public class MetricsTableView extends Table<MetricsViewDataSource> implements Re
setCanExpandRecords(true);
setCanExpandMultipleRecords(true);
setExpansionMode(ExpansionMode.DETAIL_FIELD);
+ addRecordExpandHandler(new RecordExpandHandler() {
+ @Override
+ public void onRecordExpand(RecordExpandEvent recordExpandEvent) {
+ Log.debug("Record Expanded: "
+ + recordExpandEvent.getRecord().getAttribute(MetricsViewDataSource.FIELD_METRIC_LABEL));
+ redrawGraphs();
+ }
+
+ });
+ addRecordCollapseHandler(new RecordCollapseHandler() {
+ @Override
+ public void onRecordCollapse(RecordCollapseEvent recordCollapseEvent) {
+ redrawGraphs();
+ }
+ });
}
@Override
@@ -295,7 +295,8 @@ public class MetricsTableView extends Table<MetricsViewDataSource> implements Re
final String chartId = "rChart-" + resourceId + "-" + definitionId;
Log.debug("getExpansionComponent for: " + chartId);
- HTMLFlow htmlFlow = new HTMLFlow(MetricD3Graph.createGraphMarkerTemplate(chartId, TREEVIEW_DETAIL_CHART_HEIGHT));
+ HTMLFlow htmlFlow = new HTMLFlow(MetricD3Graph.createGraphMarkerTemplate(chartId,
+ TREEVIEW_DETAIL_CHART_HEIGHT));
vLayout.addMember(htmlFlow);
int[] definitionArrayIds = new int[1];
@@ -316,7 +317,6 @@ public class MetricsTableView extends Table<MetricsViewDataSource> implements Re
//load the data results for the given metric definition
List<MeasurementDataNumericHighLowComposite> measurementList = results.get(0);
- Log.debug("getExpansionComponent MeasurementList.size: " + measurementList.size());
MeasurementDefinition measurementDefinition = null;
for (MeasurementDefinition definition : resource.getResourceType().getMetricDefinitions()) {
@@ -336,12 +336,13 @@ public class MetricsTableView extends Table<MetricsViewDataSource> implements Re
@Override
public void run() {
graphView.drawJsniChart();
+ BrowserUtility.graphSparkLines();
}
}.schedule(150);
} else {
- Log.warn("No chart data retrieving for resource [" + resourceId + "-"+definitionId+"]");
+ Log.warn("No chart data retrieving for resource [" + resourceId + "-" + definitionId + "]");
}
}
10 years, 10 months
[rhq] modules/enterprise
by John Sanda
modules/enterprise/server/jar/pom.xml | 8 ++++++++
modules/enterprise/server/server-metrics/pom.xml | 12 ------------
2 files changed, 8 insertions(+), 12 deletions(-)
New commits:
commit e6fa8c734c2bfee9ad46a2b7683d4c86b4897e5c
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu Jul 18 07:23:34 2013 -0400
take 2 at dependency clean up
JNA libraries were getting pulled into the ear as transitive dependencies. JNA
is used by the cassandra-ccm-core module to shutdown Cassandra. This
functionality though is only used in test code.
diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml
index c648685..f418afc 100644
--- a/modules/enterprise/server/jar/pom.xml
+++ b/modules/enterprise/server/jar/pom.xml
@@ -77,6 +77,14 @@
<groupId>org.rhq</groupId>
<artifactId>rhq-core-plugin-api</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>net.java.dev.jna</groupId>
+ <artifactId>jna</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>net.java.dev.jna</groupId>
+ <artifactId>platform</artifactId>
+ </exclusion>
</exclusions>
</dependency>
diff --git a/modules/enterprise/server/server-metrics/pom.xml b/modules/enterprise/server/server-metrics/pom.xml
index 2245978..97496f7 100644
--- a/modules/enterprise/server/server-metrics/pom.xml
+++ b/modules/enterprise/server/server-metrics/pom.xml
@@ -47,18 +47,6 @@
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>rhq-cassandra-ccm-core</artifactId>
- <version>${project.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.cassandra</groupId>
- <artifactId>cassandra-clientutil</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>${project.groupId}</groupId>
<artifactId>rhq-cassandra-ccm-testng</artifactId>
<version>${project.version}</version>
<scope>test</scope>
10 years, 10 months
[rhq] modules/enterprise
by snegrea
modules/enterprise/server/jar/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 375f6f66fcc9214cc3d13605c17859ac11e3fd45
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Jul 18 05:04:00 2013 -0500
Temporary fix for the server jar name for dev profile (it was still using the old name).
diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml
index 7c236c7..c648685 100644
--- a/modules/enterprise/server/jar/pom.xml
+++ b/modules/enterprise/server/jar/pom.xml
@@ -776,7 +776,7 @@
<properties>
<rhq.rootDir>../../../..</rhq.rootDir>
<rhq.containerDir>${rhq.rootDir}/${rhq.devContainerServerPath}</rhq.containerDir>
- <rhq.deploymentName>${project.build.finalName}-ejb3.jar</rhq.deploymentName>
+ <rhq.deploymentName>rhq-server.jar</rhq.deploymentName>
<rhq.deploymentDir>${rhq.containerDir}/${rhq.earDeployDir}/${rhq.deploymentName}</rhq.deploymentDir>
</properties>
10 years, 10 months
[rhq] Changes to 'bug/969621'
by Thomas Segismont
New branch 'bug/969621' available with the following commits:
commit a6b58593992b008c1e9fa988d24b0bde71d395b1
Author: Thomas Segismont <tsegismo(a)redhat.com>
Date: Thu Jul 18 09:41:39 2013 +0200
Bug 969621 - EAP 6 managed plug-in is unable to discover EAP servers when more then one is running on a single host
10 years, 10 months
[rhq] modules/enterprise
by John Sanda
modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/test/AbstractEJB3Test.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit b59d1684eb12c4e1c5a78309b4ec40eeb461b7d5
Author: John Sanda <jsanda(a)redhat.com>
Date: Wed Jul 17 20:17:14 2013 -0400
fix test ear deployment error that resulted from renaming server jar
The ear deployment was failing because classes were not getting added to the
rhq-server.jar in the test ear.
diff --git a/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/test/AbstractEJB3Test.java b/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/test/AbstractEJB3Test.java
index 4dfbd46..2fd8624 100644
--- a/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/test/AbstractEJB3Test.java
+++ b/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/test/AbstractEJB3Test.java
@@ -341,7 +341,7 @@ public abstract class AbstractEJB3Test extends Arquillian {
// merge rhq.ear into testEar but include only the EJB jars and the supporting libraries. Note that we
// don't include the services sar because tests are responsible for prepare/unprepare of all required services,
// we don't want the production services performing any unexpected work.
- testEar = testEar.merge(rhqEar, Filters.include("/lib.*|/rhq.*ejb3\\.jar.*"));
+ testEar = testEar.merge(rhqEar, Filters.include("/lib.*|/rhq.*ejb3\\.jar.*|/rhq-server.jar.*"));
// remove startup beans and shutdown listeners, we don't want this to be a full server deployment. The tests
// start/stop what they need, typically with test services or mocks.
testEar.delete(ArchivePaths
@@ -413,7 +413,7 @@ public abstract class AbstractEJB3Test extends Arquillian {
//System.out.println("** The Deployment EAR: " + testEar.toString(true) + "\n");
// Save the test EAR to a zip file for inspection (set file explicitly)
- //exportZip(testEar, new File("c:/temp/test-ear.ear"));
+ exportZip(testEar, new File("/Users/jsanda/tmp/test-ear.ear"));
return testEar;
}
10 years, 10 months
[rhq] Branch 'mtho11/consolidated-metrics' - modules/enterprise
by mike thompson
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/graphtype/AvailabilityOverUnderGraphType.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsResourceView.java | 36 +++-------
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsViewDataSource.java | 26 ++-----
3 files changed, 23 insertions(+), 41 deletions(-)
New commits:
commit a80e5b2dbcd84b6ece2bd9eb02a9901035e89961
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Wed Jul 17 15:23:54 2013 -0700
Consolidated Metrics - Additional misc. bug fixes.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/graphtype/AvailabilityOverUnderGraphType.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/graphtype/AvailabilityOverUnderGraphType.java
index bc35ccf..811a579 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/graphtype/AvailabilityOverUnderGraphType.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/graphtype/AvailabilityOverUnderGraphType.java
@@ -344,7 +344,7 @@ public class AvailabilityOverUnderGraphType implements AvailabilityGraphType {
console.log("Availability Chart Drawn");
}
- }-*/;
+ }-*/;
public String getChartId() {
return String.valueOf(entityId);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsResourceView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsResourceView.java
index 9273e0b..99ad1e6 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsResourceView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsResourceView.java
@@ -25,7 +25,6 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.types.VerticalAlignment;
import com.smartgwt.client.widgets.Img;
-import com.smartgwt.client.widgets.Label;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
import com.smartgwt.client.widgets.layout.VLayout;
@@ -57,23 +56,15 @@ public class MetricsResourceView extends AbstractD3GraphListView {
private VLayout vLayout;
private Img expandCollapseArrow;
private MetricsTableView metricsTableView;
- private MetricsViewDataSource dataSource;
private ResourceMetricAvailabilityView availabilityDetails;
public MetricsResourceView(Resource resource) {
super();
this.resource = resource;
- dataSource = new MetricsViewDataSource(resource);
metricsTableView = new MetricsTableView(resource, this);
availabilityDetails = new ResourceMetricAvailabilityView(resource);
}
- private EnhancedHLayout createAvailabilityDetails() {
- EnhancedHLayout hLayout = new EnhancedHLayout();
- hLayout.addMember(new Label("Availability Details"));
- hLayout.hide();
- return hLayout;
- }
public void redrawGraphs() {
this.onDraw();
@@ -91,6 +82,10 @@ public class MetricsResourceView extends AbstractD3GraphListView {
vLayout.setHeight100();
vLayout.addMember(buttonBarDateTimeRangeEditor);
+
+ availabilityGraph = new AvailabilityD3GraphView<AvailabilityOverUnderGraphType>(
+ new AvailabilityOverUnderGraphType(resource.getId()));
+
EnhancedHLayout expandCollapseHLayout = new EnhancedHLayout();
//add expand/collapse icon
@@ -111,15 +106,18 @@ public class MetricsResourceView extends AbstractD3GraphListView {
expandCollapseArrow.setSrc(IconEnum.EXPANDED_ICON.getIcon16x16Path());
expandCollapseArrow.setTooltip(EXPANDED_TOOLTIP);
availabilityDetails.show();
+
}
- markForRedraw();
+ new Timer() {
+ @Override
+ public void run() {
+ availabilityGraph.drawJsniChart();
+ }
+ }.schedule(150);
}
});
- availabilityGraph = new AvailabilityD3GraphView<AvailabilityOverUnderGraphType>(
- new AvailabilityOverUnderGraphType(resource.getId()));
-
expandCollapseHLayout.addMember(expandCollapseArrow);
expandCollapseHLayout.addMember(availabilityGraph);
vLayout.addMember(expandCollapseHLayout);
@@ -138,8 +136,7 @@ public class MetricsResourceView extends AbstractD3GraphListView {
}
@Override
- protected void queryAvailability(final EntityContext context, Long startTime, Long endTime,
- final CountDownLatch countDownLatch) {
+ protected void queryAvailability(final EntityContext context, Long startTime, Long endTime, CountDownLatch notUsed ) {
final long timerStart = System.currentTimeMillis();
@@ -149,26 +146,19 @@ public class MetricsResourceView extends AbstractD3GraphListView {
@Override
public void onFailure(Throwable caught) {
CoreGUI.getErrorHandler().handleError(MSG.view_resource_monitor_availability_loadFailed(), caught);
- if (countDownLatch != null) {
- countDownLatch.countDown();
- }
}
@Override
public void onSuccess(List<Availability> availList) {
Log.debug("\nSuccessfully queried availability in: " + (System.currentTimeMillis() - timerStart)
+ " ms.");
- availabilityList = availList;
+ availabilityGraph.setAvailabilityList(availList);
new Timer() {
@Override
public void run() {
availabilityGraph.drawJsniChart();
}
}.schedule(150);
-
- if (countDownLatch != null) {
- countDownLatch.countDown();
- }
}
});
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsViewDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsViewDataSource.java
index d8bfb64..a03ad1a 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsViewDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsViewDataSource.java
@@ -154,41 +154,35 @@ public class MetricsViewDataSource extends RPCDataSource<MetricDisplaySummary, C
private String getCsvMetricsForSparkline(int definitionId) {
StringBuilder sb = new StringBuilder();
- Log.debug("getCsvMetricsForSparkline.metricsDataList("+definitionId+"): " + metricsDataList.size());
List<MeasurementDataNumericHighLowComposite> selectedMetricsList = getMeasurementsForMeasurementDefId(definitionId);
for (int i = 0; i < selectedMetricsList.size(); i++) {
- // take the last 20 values
- //if (i >= selectedMetricsList.size() - 20) {
- MeasurementDataNumericHighLowComposite measurementData = selectedMetricsList.get(i);
- if (!Double.isNaN(measurementData.getValue())) {
- sb.append((int) measurementData.getValue());
- sb.append(",");
- }
- //}
+ MeasurementDataNumericHighLowComposite measurementData = selectedMetricsList.get(i);
+ if (!Double.isNaN(measurementData.getValue())) {
+ sb.append((int) measurementData.getValue());
+ sb.append(",");
}
+ }
if (sb.toString().endsWith(",")) {
sb.setLength(sb.length() - 1);
}
- Log.debug("getCsvMetricsForSparkline: " + sb.toString());
return sb.toString();
}
- List<MeasurementDataNumericHighLowComposite> getMeasurementsForMeasurementDefId(int definitionId){
- List<MeasurementDataNumericHighLowComposite> selectedMetricsDataList;
+ List<MeasurementDataNumericHighLowComposite> getMeasurementsForMeasurementDefId(int definitionId) {
int selectedIndex = 0;
// find the ordinal position as specified when querying the metrics
for (int i = 0; i < definitionArrayIds.length; i++) {
- if(definitionArrayIds[i] == definitionId){
+ if (definitionArrayIds[i] == definitionId) {
selectedIndex = i;
break;
}
}
- return metricsDataList.get(selectedIndex);
+ return metricsDataList.get(selectedIndex);
}
protected String getMetricStringValue(MetricDisplayValue value) {
@@ -197,7 +191,7 @@ public class MetricsViewDataSource extends RPCDataSource<MetricDisplaySummary, C
@Override
protected Criteria getFetchCriteria(DSRequest request) {
- // we don't use criterias for this datasource, just return null
+ // NOTE: we don't use criterias for this datasource, just return null
return null;
}
@@ -228,7 +222,6 @@ public class MetricsViewDataSource extends RPCDataSource<MetricDisplaySummary, C
BrowserUtility.graphSparkLines();
}
}.schedule(150);
- Log.debug("Finished CountdownLatch for metrics loaded: " + metricsDataList.size());
}
});
@@ -305,7 +298,6 @@ public class MetricsViewDataSource extends RPCDataSource<MetricDisplaySummary, C
if (!measurementDataList.isEmpty()) {
metricsDataList = measurementDataList;
- Log.debug("Retrieved metrics metricsDataList.size: " + metricsDataList.size());
countDownLatch.countDown();
}
}
10 years, 10 months
[rhq] etc/scripts
by Jay Shaughnessy
etc/scripts/rhq48-storage-patch/rhq48-storage-patch.bat | 48 ++++++++++++++--
1 file changed, 44 insertions(+), 4 deletions(-)
New commits:
commit c855df20b787a6db0a7b9aed7b1fb5597eb0e2d6
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Jul 17 17:09:55 2013 -0400
Work on the windows rhq48 cassandra upgrade patch
diff --git a/etc/scripts/rhq48-storage-patch/rhq48-storage-patch.bat b/etc/scripts/rhq48-storage-patch/rhq48-storage-patch.bat
index e0312dc..c190503 100644
--- a/etc/scripts/rhq48-storage-patch/rhq48-storage-patch.bat
+++ b/etc/scripts/rhq48-storage-patch/rhq48-storage-patch.bat
@@ -1,14 +1,54 @@
@echo off
+
+rem ===========================================================================
+rem RHQ Storage Node (Cassandra) Windows 4.8.0 upgrade patch script
+rem
+rem WHO NEEDS TO RUN THE PATCH?
+rem
+rem Run this patch script if you are:
+rem - Running RHQ 4.8.0 on Windows
+rem - Planning to upgrade and maintain your Storage node data
+rem
+rem PREQUISITES:
+rem
+rem This patch requires the installation of Python. Download Python 2.7.5 from:
+rem
+rem http://www.python.org/download/releases/2.7.5/
+rem
+rem Install as directed. Note that Python will need to be on your PATH to run this patch. Also,
+rem this patch will not work with Python3.
+rem
+rem Edit <rhq-install-dir>\rhq-storage\conf\cassandra.yaml to ensure the following is true:
+rem
+rem start_rpc: true
+rem
+rem Note the setting of rpc_port. By default it is 9160, which is fine.
+rem
+rem RUNNING THE PATCH:
+rem
+rem > cd <patch-dir>
+rem > rhq48-storage-patch.bat <rhq-480-server-dir> <storage-node-ip-address> <thrift-rpc-port> <jmx-port>
+rem
+rem For example:
+rem > rhq48-storage-patch.bat c:\rhq-server-4.8.0 127.0.0.1 9160 7299
+rem
+rem Review the output carefully. There should be no errors (be careful, the script may still have completed).
+rem If errors are encountered fix the issue and rerun the patch.
+rem
+rem When done, you can again edit cassandra.yaml and reset start_rpc: false
+rem
+rem ===========================================================================
+
setlocal
if /i "%4" == "" (
- echo Usage: rhq48-storage-patch.bat ^<rhq-server-dir^> ^<storage-ip-address^> ^<cql-port^> ^<jmx-port^>
+ echo Usage: rhq48-storage-patch.bat ^<rhq-server-dir^> ^<storage-ip-address^> ^<thrift-rpc-port^> ^<jmx-port^>
exit /B 1
)
set RHQ_SERVER_DIR=%1
-set CQL_HOSTNAME=%2
-set CQL_PORT=%3
+set CQLSH_HOST=%2
+set CQLSH_PORT=%3
set JMX_PORT=%4
set USERNAME="rhqadmin"
set PASSWORD="rhqadmin"
@@ -29,7 +69,7 @@ echo Waiting for RHQ Storage Node to start up..
rem Sleep is not implemented in all Windows prompts, this one won't work in Vista
choice /n /c y /d y /t 3
-set RHQ_STORAGE_BIN=%RHQ_SERVER_DIR%\rhq-storage\bin\
+set RHQ_STORAGE_BIN=%RHQ_SERVER_DIR%\rhq-storage\bin
set CQLSH_PATH=%RHQ_STORAGE_BIN%\cqlsh
set NODETOOL_PATH=%RHQ_STORAGE_BIN%\nodetool.bat
10 years, 10 months