[rhq] etc/scripts
by John Sanda
etc/scripts/rhq48-storage-patch/rhq48-storage-patch.bat | 64 ++++++++++++++++
1 file changed, 64 insertions(+)
New commits:
commit 2ee2ef305dd71c1f2869a5a8c4e8ebe9f9bae243
Author: Michael Burman <yak(a)iki.fi>
Date: Tue Jul 16 15:58:05 2013 -0400
committing windows version of RHQ 4.8 storage patch script
diff --git a/etc/scripts/rhq48-storage-patch/rhq48-storage-patch.bat b/etc/scripts/rhq48-storage-patch/rhq48-storage-patch.bat
new file mode 100644
index 0000000..e0312dc
--- /dev/null
+++ b/etc/scripts/rhq48-storage-patch/rhq48-storage-patch.bat
@@ -0,0 +1,64 @@
+@echo off
+setlocal
+
+if /i "%4" == "" (
+ echo Usage: rhq48-storage-patch.bat ^<rhq-server-dir^> ^<storage-ip-address^> ^<cql-port^> ^<jmx-port^>
+ exit /B 1
+)
+
+set RHQ_SERVER_DIR=%1
+set CQL_HOSTNAME=%2
+set CQL_PORT=%3
+set JMX_PORT=%4
+set USERNAME="rhqadmin"
+set PASSWORD="rhqadmin"
+
+set PATCH="apache-cassandra-1.2.4-patch-1.jar"
+
+rem swap out the Cassandra jar file with the patched version
+echo Copying patch file to %RHQ_SERVER_DIR%\rhq-storage\lib
+move %RHQ_SERVER_DIR%\rhq-storage\lib\apache-cassandra-1.2.4.jar .
+copy %PATCH% %RHQ_SERVER_DIR%\rhq-storage\lib
+
+rem restart the storage node
+echo Starting RHQ Storage node
+call %RHQ_SERVER_DIR%\bin\rhqctl.bat start --storage
+
+rem sleep for a few seconds while Cassandra starts up
+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 CQLSH_PATH=%RHQ_STORAGE_BIN%\cqlsh
+set NODETOOL_PATH=%RHQ_STORAGE_BIN%\nodetool.bat
+
+rem run the CQL script
+echo Running CQL script to disable table compression
+python %CQLSH_PATH% -u %USERNAME% -p %PASSWORD% -f ./disable_compression.cql
+
+rem rewrite all sstables
+echo Rebuilding data files for system keyspace
+call %NODETOOL_PATH% -u rhqadmin -pw rhqadmin -p %JMX_PORT% upgradesstables --include-all-sstables system
+
+echo Rebuilding data files for system_traces keyspace
+call %NODETOOL_PATH% -u rhqadmin -pw rhqadmin -p %JMX_PORT% upgradesstables --include-all-sstables system_traces
+
+echo Rebuilding data files for system_auth keyspace
+call %NODETOOL_PATH% -u rhqadmin -pw rhqadmin -p %JMX_PORT% upgradesstables --include-all-sstables system_auth
+
+echo Rebuilding data files for rhq keyspace
+call %NODETOOL_PATH% -u rhqadmin -pw rhqadmin -p %JMX_PORT% upgradesstables --include-all-sstables rhq
+
+rem flush memtables and commit log to ensure no data loss prior to upgrade
+call %NODETOOL_PATH% -u rhqadmin -pw rhqadmin -p %JMX_PORT% drain
+
+echo Shutting down the RHQ Storage node
+call %RHQ_SERVER_DIR%\bin\rhqctl.bat stop --storage
+
+echo Removing patch file
+del %RHQ_SERVER_DIR%\rhq-storage\lib\%PATCH%
+move apache-cassandra-1.2.4.jar %RHQ_SERVER_DIR%\rhq-storage\lib
+
+echo Table compression has been disabled for all keyspaces. You are now ready to upgrade your RHQ installation.
+endlocal
10 years, 11 months
[rhq] modules/plugins
by Thomas Segismont
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/InterruptibleOperationsTest.java | 13 ++++++++++
1 file changed, 13 insertions(+)
New commits:
commit 9983f60ec49f72b5bb0afcfb452afde616c622a6
Author: Thomas Segismont <tsegismo(a)redhat.com>
Date: Tue Jul 16 17:51:59 2013 +0200
Fix InterruptibleOperationsTest. Mock resource context needs a ComponentInvocationContext instance.
diff --git a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/InterruptibleOperationsTest.java b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/InterruptibleOperationsTest.java
index 192117c..b0acf4d 100644
--- a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/InterruptibleOperationsTest.java
+++ b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/InterruptibleOperationsTest.java
@@ -47,6 +47,7 @@ import org.eclipse.jetty.servlet.ServletHolder;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
+import org.rhq.core.pluginapi.component.ComponentInvocationContext;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -95,6 +96,7 @@ public class InterruptibleOperationsTest {
int httpPort = setupJettyServer();
setupResourceContext(httpPort);
executorService = Executors.newSingleThreadExecutor();
+ when(resourceContext.getComponentInvocationContext()).thenReturn(new MockComponentInvocationContext());
serverComponent.start(resourceContext);
}
@@ -160,6 +162,17 @@ public class InterruptibleOperationsTest {
assertEquals(operationResult.getSimpleResult(), "Success");
}
+ private static class MockComponentInvocationContext implements ComponentInvocationContext {
+ @Override
+ public boolean isInterrupted() {
+ return false;
+ }
+
+ @Override
+ public void markInterrupted() {
+ }
+ }
+
private class RestartJetty implements Runnable {
@Override
public void run() {
10 years, 11 months
[rhq] etc/rhq-ircBot
by lkrejci
etc/rhq-ircBot/src/main/java/org/rhq/etc/ircbot/RhqIrcBotListener.java | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
New commits:
commit fb809005b42f358d3a2090993431769649ade732
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Tue Jul 16 15:54:07 2013 +0200
Updating the list of the devs in the IRC bot
diff --git a/etc/rhq-ircBot/src/main/java/org/rhq/etc/ircbot/RhqIrcBotListener.java b/etc/rhq-ircBot/src/main/java/org/rhq/etc/ircbot/RhqIrcBotListener.java
index dd22dbf..cc10d2d 100644
--- a/etc/rhq-ircBot/src/main/java/org/rhq/etc/ircbot/RhqIrcBotListener.java
+++ b/etc/rhq-ircBot/src/main/java/org/rhq/etc/ircbot/RhqIrcBotListener.java
@@ -77,8 +77,7 @@ public class RhqIrcBotListener extends ListenerAdapter<RhqIrcBot> {
private static final Set<String> JON_DEVS = new HashSet<String>();
static {
- JON_DEVS.add("ccrouch");
- JON_DEVS.add("ips");
+ JON_DEVS.add("theute");
JON_DEVS.add("jkremser");
JON_DEVS.add("jsanda");
JON_DEVS.add("jshaughn");
@@ -377,4 +376,4 @@ public class RhqIrcBotListener extends ListenerAdapter<RhqIrcBot> {
this.docspacePassword = docspacePassword;
}
-}
\ No newline at end of file
+}
10 years, 11 months
[rhq] modules/enterprise
by snegrea
modules/enterprise/server/jar/intentional-api-changes-since-4.8.0.xml | 18 ++++++++++
1 file changed, 18 insertions(+)
New commits:
commit 98258686d712608aef7a21108f6a5505ffb820b7
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Tue Jul 16 08:16:57 2013 -0500
Add justification for the api changes to the Storage Node Manager bean.
diff --git a/modules/enterprise/server/jar/intentional-api-changes-since-4.8.0.xml b/modules/enterprise/server/jar/intentional-api-changes-since-4.8.0.xml
new file mode 100644
index 0000000..a9ce322
--- /dev/null
+++ b/modules/enterprise/server/jar/intentional-api-changes-since-4.8.0.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<differences>
+
+ <difference>
+ <className>org/rhq/enterprise/server/cloud/StorageNodeManagerRemote</className>
+ <differenceType>7012</differenceType> <!-- method added to an interface -->
+ <method>org.rhq.core.domain.util.PageList findNotAcknowledgedStorageNodeAlerts(org.rhq.core.domain.auth.Subject)</method>
+ <justification>Adding a method to a remote API interface is safe. This is newly implemented functionality.</justification>
+ </difference>
+
+ <difference>
+ <className>org/rhq/enterprise/server/cloud/StorageNodeManagerRemote</className>
+ <differenceType>7012</differenceType> <!-- method added to an interface -->
+ <method>org.rhq.core.domain.util.PageList findAllStorageNodeAlerts(org.rhq.core.domain.auth.Subject)</method>
+ <justification>Adding a method to a remote API interface is safe. This is newly implemented functionality.</justification>
+ </difference>
+
+</differences>
10 years, 11 months
[rhq] modules/core modules/plugins
by Thomas Segismont
modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/inventory/ResourceContext.java | 2
modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/ResourceContainer.java | 4 +
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/StandaloneASComponent.java | 25 +++-------
3 files changed, 14 insertions(+), 17 deletions(-)
New commits:
commit 6ad3c87c08631a00cb960a4ffa4c4929329aa6d8
Author: Thomas Segismont <tsegismo(a)redhat.com>
Date: Tue Jul 16 13:42:50 2013 +0200
Bug 982804 - AS7 reload behavior includes hardcoded timeout of 20 seconds
diff --git a/modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/inventory/ResourceContext.java b/modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/inventory/ResourceContext.java
index 8c708db..41a1c41 100644
--- a/modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/inventory/ResourceContext.java
+++ b/modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/inventory/ResourceContext.java
@@ -173,6 +173,8 @@ public class ResourceContext<T extends ResourceComponent<?>> {
* @param availabilityContext a {@link AvailabilityContext} the plugin can use to interoperate with the
* plugin container inventory manager
* @param pluginContainerDeployment indicates where the plugin container is running
+ * @param componentInvocationContext a {@link ComponentInvocationContext} the plugin can use to determine if the
+ * current component invocation has been canceled or timed out.
*/
public ResourceContext(Resource resource, T parentResourceComponent, ResourceContext<?> parentResourceContext,
ResourceDiscoveryComponent<T> resourceDiscoveryComponent, SystemInfo systemInfo, File temporaryDirectory,
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/ResourceContainer.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/ResourceContainer.java
index 4cb2cff..a9fe1c2 100644
--- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/ResourceContainer.java
+++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/ResourceContainer.java
@@ -609,6 +609,8 @@ public class ResourceContainer implements Serializable {
}
private static class ComponentInvocation implements Callable {
+ private static final Log LOG = LogFactory.getLog(ComponentInvocation.class);
+
private final ResourceContainer resourceContainer;
private final Method method;
private final Object[] args;
@@ -669,6 +671,8 @@ public class ResourceContainer implements Serializable {
public void markContextInterrupted() {
localContext.markInterrupted();
+ LOG.warn("Invocation has been marked interrupted for method [" + method + "] on resource ["
+ + resourceContainer.getResource() + "]");
}
}
}
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/StandaloneASComponent.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/StandaloneASComponent.java
index d399d1b..ccb8ce0 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/StandaloneASComponent.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/StandaloneASComponent.java
@@ -18,6 +18,8 @@
*/
package org.rhq.modules.plugins.jbossas7;
+import static java.util.concurrent.TimeUnit.SECONDS;
+
import java.io.File;
import java.util.HashSet;
import java.util.Map;
@@ -184,39 +186,28 @@ public class StandaloneASComponent<T extends ResourceComponent<?>> extends BaseS
return operationResult;
}
- private boolean waitUntilReloaded() {
+ private boolean waitUntilReloaded() throws InterruptedException {
boolean reloaded = false;
- int count = 0;
-
while (!reloaded) {
Operation op = new ReadAttribute(new Address(), "release-version");
- try{
+ try {
Result res = getASConnection().execute(op);
if (res.isSuccess() && !res.isReloadRequired()) {
reloaded = true;
- } else if (count > 20) {
- break;
}
} catch (Exception e) {
//do absolutely nothing
//if an exception is thrown that means the server is still reloading, so consider this
//a single failed attempt, equivalent to res.isSuccess == false
}
-
if (!reloaded) {
- try {
- Thread.sleep(1000); // Wait 1s
- } catch (InterruptedException e) {
- // ignore
+ if (context.getComponentInvocationContext().isInterrupted()) {
+ // Operation canceled or timed out
+ throw new InterruptedException();
}
+ Thread.sleep(SECONDS.toMillis(1));
}
- count++;
}
-
- if (log.isDebugEnabled()) {
- log.debug("waitUntilReloaded: Used " + count + " delay round(s) to reload. Reload=" + reloaded);
- }
-
return reloaded;
}
10 years, 11 months
[rhq] 2 commits - modules/enterprise modules/helpers
by Heiko W. Rupp
modules/enterprise/server/plugins/alert-snmp/src/test/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpInfoTest.java | 6 ++---
modules/enterprise/server/plugins/alert-snmp/src/test/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpSenderTest.java | 5 ++--
modules/helpers/pluginGen/src/main/java/org/rhq/helpers/pluginGen/Generator.java | 11 +++++++---
modules/helpers/pluginGen/src/main/java/org/rhq/helpers/pluginGen/Prop.java | 2 -
4 files changed, 15 insertions(+), 9 deletions(-)
New commits:
commit 56f845bec82369f3032b565a8caeed751d1a4093
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Tue Jul 16 10:13:13 2013 +0200
Fix test fallout that got introduced by my changes.
diff --git a/modules/enterprise/server/plugins/alert-snmp/src/test/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpInfoTest.java b/modules/enterprise/server/plugins/alert-snmp/src/test/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpInfoTest.java
index 97b9a05..ecc995d 100644
--- a/modules/enterprise/server/plugins/alert-snmp/src/test/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpInfoTest.java
+++ b/modules/enterprise/server/plugins/alert-snmp/src/test/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpInfoTest.java
@@ -116,11 +116,11 @@ public class SnmpInfoTest {
// String representation is constrained (even not strongly).
Configuration configuration = new Configuration();
assertEquals(SnmpInfo.load(configuration).toString(), "UnknownHost:" + DEFAULT_PORT
- + " (UnknownOID) (DefaultTrapOID)");
+ + " (Unknown Binding Prefix) (DefaultTrapOID)");
configuration.setSimpleValue(PARAM_HOST, "pipo");
- assertEquals(SnmpInfo.load(configuration).toString(), "pipo:" + DEFAULT_PORT + " (UnknownOID) (DefaultTrapOID)");
+ assertEquals(SnmpInfo.load(configuration).toString(), "pipo:" + DEFAULT_PORT + " (Unknown Binding Prefix) (DefaultTrapOID)");
configuration.setSimpleValue(PARAM_PORT, "35162");
- assertEquals(SnmpInfo.load(configuration).toString(), "pipo:35162 (UnknownOID) (DefaultTrapOID)");
+ assertEquals(SnmpInfo.load(configuration).toString(), "pipo:35162 (Unknown Binding Prefix) (DefaultTrapOID)");
configuration.setSimpleValue(PARAM_VARIABLE_BINDING_PREFIX, "molo");
assertEquals(SnmpInfo.load(configuration).toString(), "pipo:35162 (molo) (DefaultTrapOID)");
configuration.setSimpleValue(PARAM_TRAP_OID, "logo");
diff --git a/modules/enterprise/server/plugins/alert-snmp/src/test/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpSenderTest.java b/modules/enterprise/server/plugins/alert-snmp/src/test/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpSenderTest.java
index 38b36d7..9583a07 100644
--- a/modules/enterprise/server/plugins/alert-snmp/src/test/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpSenderTest.java
+++ b/modules/enterprise/server/plugins/alert-snmp/src/test/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpSenderTest.java
@@ -95,6 +95,7 @@ public class SnmpSenderTest {
private AlertManagerLocal alertManager;
private TestSnmpSender snmpSender;
+ private Configuration pluginConfiguration;
@BeforeMethod
public void setUp() throws Exception {
@@ -114,7 +115,7 @@ public class SnmpSenderTest {
MockitoAnnotations.initMocks(this);
- Configuration pluginConfiguration = new Configuration();
+ pluginConfiguration = new Configuration();
pluginConfiguration.setSimpleValue("snmpVersion", "2c");
pluginConfiguration.setSimpleValue("trapOid", TEST_TRAP_OID_PLUGIN_CONFIG);
pluginConfiguration.setSimpleValue("community", "public");
@@ -153,7 +154,7 @@ public class SnmpSenderTest {
assertNotNull(result);
assertEquals(result.getState(), FAILURE);
assertEquals(result.getFailureMessages().size(), 1);
- String expectedError = SnmpInfo.load(alertParameters).error;
+ String expectedError = SnmpInfo.load(alertParameters,pluginConfiguration).error;
assertNotNull(expectedError);
assertEquals(result.getFailureMessages().get(0), expectedError);
}
commit 609c93f0d219afd19db976d55c565c95bb96d1ab
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Mon Jul 15 11:03:05 2013 +0200
Display tool tips, for pick button and choice boxes
diff --git a/modules/helpers/pluginGen/src/main/java/org/rhq/helpers/pluginGen/Generator.java b/modules/helpers/pluginGen/src/main/java/org/rhq/helpers/pluginGen/Generator.java
index 06f3fec..e7da952 100644
--- a/modules/helpers/pluginGen/src/main/java/org/rhq/helpers/pluginGen/Generator.java
+++ b/modules/helpers/pluginGen/src/main/java/org/rhq/helpers/pluginGen/Generator.java
@@ -210,11 +210,13 @@ public class Generator extends Application{
choiceBox.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<String>() {
@Override
public void changed(ObservableValue<? extends String> observableValue, String s, String newValue) {
- setPropsValue(prop.getVariableName(),newValue.equals("Yes"),propType);
+ setPropsValue(prop.getVariableName(), newValue.equals("Yes"), propType);
}
});
+ Tooltip tooltip = new Tooltip(prop.getDescription()); // TODO make this a hover listener
+ choiceBox.setTooltip(tooltip);
- root.add(choiceBox,1,row);
+ root.add(choiceBox, 1, row);
} else if (propType.equals(ResourceCategory.class)) {
final ChoiceBox choiceBox = new ChoiceBox();
for (ResourceCategory cat : ResourceCategory.values()) {
@@ -228,14 +230,17 @@ public class Generator extends Application{
setPropsValue(prop.getVariableName(),newCategory,propType);
}
});
-
+ Tooltip tooltip = new Tooltip(prop.getDescription()); // TODO make this a hover listener
+ choiceBox.setTooltip(tooltip);
root.add(choiceBox,1,row);
} else if (propType.equals(File.class)) {
// Can not add this directly, so add a button to trigger it
final Text text = new Text();
text.setText("Pick a directory");
root.add(text,1,row);
+ Tooltip tooltip = new Tooltip("Pick the (parent) directory where the plugin will be put in.");
Button pickButton = new Button("Pick");
+ pickButton.setTooltip(tooltip);
pickButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent actionEvent) {
diff --git a/modules/helpers/pluginGen/src/main/java/org/rhq/helpers/pluginGen/Prop.java b/modules/helpers/pluginGen/src/main/java/org/rhq/helpers/pluginGen/Prop.java
index 73c4cd9..4ed019a 100644
--- a/modules/helpers/pluginGen/src/main/java/org/rhq/helpers/pluginGen/Prop.java
+++ b/modules/helpers/pluginGen/src/main/java/org/rhq/helpers/pluginGen/Prop.java
@@ -38,7 +38,7 @@ public enum Prop {
DESCRIPTION("description", String.class, "Description of the type", ".*"),
DISCOVERY_CLASS("discoveryClass", String.class, "Discovery class", "[A-Z][a-zA-Z0-9]*"),
COMPONENT_CLASS("componentClass", String.class, "Discovery class", "[A-Z][a-zA-Z0-9]*"),
- IS_SINGLETON("singleton",Boolean.class,"Is this type a singleton, which means that" +
+ IS_SINGLETON("singleton",boolean.class,"Is this type a singleton, which means that" +
" there can only be one resource of that type for the given parent?",null),
HAS_METRICS("hasMetrics",boolean.class,"Does this type support taking metrics?",null),
HAS_OPERATIONS("hasOperations",boolean.class,"Does this type support operations?",null),
10 years, 11 months
[rhq] Branch 'mtho11/consolidated-metrics' - 2 commits - modules/enterprise
by mike thompson
modules/enterprise/gui/coregui/pom.xml | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/IconEnum.java | 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/graphtype/AvailabilityOverUnderGraphType.java | 11
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/D3GroupGraphListView.java | 115 +--
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java | 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/D3GraphListView.java | 308 ++++------
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsResourceView.java | 306 +++++++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsTableDataSource.java | 189 +++---
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsTableView.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsViewDataSource.java | 298 +++++++++
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties | 3
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties | 3
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties | 3
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties | 3
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ko.properties | 3
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties | 3
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties | 3
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties | 3
18 files changed, 932 insertions(+), 336 deletions(-)
New commits:
commit 9387cd53d12cda3e976b99c5a0cc1b1326a3c651
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Mon Jul 15 12:50:48 2013 -0700
Consolidated Metrics - expandable availability graph/detail.
diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml
index a227ed4..353f4d9 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -19,7 +19,7 @@
<properties>
<!-- dependency versions -->
- <gwt.version>2.5.0</gwt.version>
+ <gwt.version>${gwt.version}</gwt.version>
<smartgwt.version>3.0</smartgwt.version>
<!-- If this is too much memory to allocate to your gwt:debug process then override this property in
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/IconEnum.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/IconEnum.java
index d11467a..b48a712 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/IconEnum.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/IconEnum.java
@@ -114,6 +114,12 @@ public enum IconEnum {
STORAGE_NODE("global/StorageNode_16.png", "global/StorageNode_24.png"),
/////////////////////////////
+ // General
+ /////////////////////////////
+ EXPANDED_ICON("[SKIN]/ListGrid/row_expanded.png"),
+ COLLAPSED_ICON("[SKIN]/ListGrid/row_collapsed.png"),
+
+ /////////////////////////////
// Resource Specific Tabs
/////////////////////////////
CALLTIME("global/Recent_16.png", "global/Recent_24.png");
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 7c5f80a..bc35ccf 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
@@ -311,13 +311,6 @@ public class AvailabilityOverUnderGraphType implements AvailabilityGraphType {
});
}
- function timeFormat(formats) {
- return function(date) {
- var i = formats.length - 1, f = formats[i];
- while (!f[1](date)) f = formats[--i];
- return f[0](date);
- }
- }
function formatHovers(d) {
var timeFormatter = $wnd.d3.time.format(availChartContext.chartHoverTimeFormat),
@@ -345,8 +338,10 @@ public class AvailabilityOverUnderGraphType implements AvailabilityGraphType {
}();
- if (availChartContext.data !== undefined && availChartContext.data.length > 0) {
+ console.log("Avail Data records: "+availChartContext.data.length);
+ if (typeof availChartContext.data !== 'undefined' && availChartContext.data.length > 0) {
availabilityGraph.draw(availChartContext);
+ console.log("Availability Chart Drawn");
}
}-*/;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/D3GroupGraphListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/D3GroupGraphListView.java
index 59737ac..a9789c6 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/D3GroupGraphListView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/D3GroupGraphListView.java
@@ -21,7 +21,6 @@ package org.rhq.enterprise.gui.coregui.client.inventory.groups.detail;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
-import java.util.EnumSet;
import java.util.List;
import com.google.gwt.core.client.GWT;
@@ -35,19 +34,17 @@ import org.rhq.core.domain.measurement.DataType;
import org.rhq.core.domain.measurement.DisplayType;
import org.rhq.core.domain.measurement.MeasurementDefinition;
import org.rhq.core.domain.measurement.composite.MeasurementDataNumericHighLowComposite;
-import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.core.domain.resource.group.composite.ResourceGroupAvailability;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.inventory.AutoRefresh;
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.common.graph.MetricGraphData;
+import org.rhq.enterprise.gui.coregui.client.inventory.common.graph.graphtype.AvailabilityOverUnderGraphType;
import org.rhq.enterprise.gui.coregui.client.inventory.common.graph.graphtype.StackedBarMetricGraphImpl;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.MetricD3Graph;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.avail.AvailabilityD3GraphView;
-import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
import org.rhq.enterprise.gui.coregui.client.util.Log;
import org.rhq.enterprise.gui.coregui.client.util.async.CountDownLatch;
@@ -55,7 +52,7 @@ import org.rhq.enterprise.gui.coregui.client.util.async.CountDownLatch;
* Build the Group version of the View that shows the individual graph views.
* @author Mike Thompson
*/
-public final class D3GroupGraphListView extends AbstractD3GraphListView implements AutoRefresh{
+public final class D3GroupGraphListView extends AbstractD3GraphListView implements AutoRefresh {
private ResourceGroup resourceGroup;
private VLayout graphsVLayout;
@@ -75,7 +72,8 @@ public final class D3GroupGraphListView extends AbstractD3GraphListView implemen
addMember(buttonBarDateTimeRangeEditor);
if (showAvailabilityGraph) {
- availabilityGraph = new AvailabilityD3GraphView<AvailabilityOverUnderGraphType>(new AvailabilityOverUnderGraphType(resourceGroup.getId()));
+ availabilityGraph = new AvailabilityD3GraphView<AvailabilityOverUnderGraphType>(
+ new AvailabilityOverUnderGraphType(resourceGroup.getId()));
addMember(availabilityGraph);
}
graphsVLayout = new VLayout();
@@ -89,7 +87,6 @@ public final class D3GroupGraphListView extends AbstractD3GraphListView implemen
addMember(graphsVLayout);
}
-
public void redrawGraphs() {
this.onDraw();
}
@@ -100,68 +97,60 @@ public final class D3GroupGraphListView extends AbstractD3GraphListView implemen
private void buildGraphs() {
queryAvailability(EntityContext.forGroup(resourceGroup), buttonBarDateTimeRangeEditor.getStartTime(),
- buttonBarDateTimeRangeEditor.getEndTime(), null);
+ buttonBarDateTimeRangeEditor.getEndTime(), null);
- ResourceTypeRepository.Cache.getInstance().getResourceTypes(resourceGroup.getResourceType().getId(),
- EnumSet.of(ResourceTypeRepository.MetadataType.measurements),
- new ResourceTypeRepository.TypeLoadedCallback() {
- public void onTypesLoaded(final ResourceType type) {
+ final ArrayList<MeasurementDefinition> measurementDefinitions = new ArrayList<MeasurementDefinition>();
- final ArrayList<MeasurementDefinition> measurementDefinitions = new ArrayList<MeasurementDefinition>();
+ for (MeasurementDefinition def : resourceGroup.getResourceType().getMetricDefinitions()) {
+ if (def.getDataType() == DataType.MEASUREMENT && def.getDisplayType() == DisplayType.SUMMARY) {
+ measurementDefinitions.add(def);
+ }
+ }
- for (MeasurementDefinition def : type.getMetricDefinitions()) {
- if (def.getDataType() == DataType.MEASUREMENT && def.getDisplayType() == DisplayType.SUMMARY) {
- measurementDefinitions.add(def);
- }
- }
+ Collections.sort(measurementDefinitions, new Comparator<MeasurementDefinition>() {
+ public int compare(MeasurementDefinition o1, MeasurementDefinition o2) {
+ return new Integer(o1.getDisplayOrder()).compareTo(o2.getDisplayOrder());
+ }
+ });
- Collections.sort(measurementDefinitions, new Comparator<MeasurementDefinition>() {
- public int compare(MeasurementDefinition o1, MeasurementDefinition o2) {
- return new Integer(o1.getDisplayOrder()).compareTo(o2.getDisplayOrder());
- }
- });
+ int[] measDefIdArray = new int[measurementDefinitions.size()];
+ for (int i = 0; i < measDefIdArray.length; i++) {
+ measDefIdArray[i] = measurementDefinitions.get(i).getId();
+ }
- int[] measDefIdArray = new int[measurementDefinitions.size()];
- for (int i = 0; i < measDefIdArray.length; i++) {
- measDefIdArray[i] = measurementDefinitions.get(i).getId();
- }
+ GWTServiceLookup.getMeasurementDataService().findDataForCompatibleGroup(resourceGroup.getId(), measDefIdArray,
+ buttonBarDateTimeRangeEditor.getStartTime(), buttonBarDateTimeRangeEditor.getEndTime(), 60,
+ new AsyncCallback<List<List<MeasurementDataNumericHighLowComposite>>>() {
+ @Override
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError(MSG.view_resource_monitor_graphs_loadFailed(), caught);
+ loadingLabel.setContents(MSG.view_resource_monitor_graphs_loadFailed());
+ }
- GWTServiceLookup.getMeasurementDataService().findDataForCompatibleGroup(resourceGroup.getId(),
- measDefIdArray, buttonBarDateTimeRangeEditor.getStartTime(), buttonBarDateTimeRangeEditor.getEndTime(), 60,
- new AsyncCallback<List<List<MeasurementDataNumericHighLowComposite>>>() {
- @Override
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError(MSG.view_resource_monitor_graphs_loadFailed(),
- caught);
- loadingLabel.setContents(MSG.view_resource_monitor_graphs_loadFailed());
- }
-
- @Override
- public void onSuccess(List<List<MeasurementDataNumericHighLowComposite>> result) {
- if (result.isEmpty()) {
- loadingLabel.setContents(MSG.view_resource_monitor_graphs_noneAvailable());
- } else {
- loadingLabel.hide();
- int i = 0;
- for (List<MeasurementDataNumericHighLowComposite> data : result) {
- buildIndividualGraph(measurementDefinitions.get(i++), data);
- }
- // There is a weird timing case when availabilityGraph can be null
- if (availabilityGraph != null) {
- availabilityGraph.setGroupAvailabilityList(groupAvailabilityList);
- new Timer(){
- @Override
- public void run() {
- availabilityGraph.drawJsniChart();
- }
- }.schedule(150);
- }
+ @Override
+ public void onSuccess(List<List<MeasurementDataNumericHighLowComposite>> result) {
+ if (result.isEmpty()) {
+ loadingLabel.setContents(MSG.view_resource_monitor_graphs_noneAvailable());
+ } else {
+ loadingLabel.hide();
+ int i = 0;
+ for (List<MeasurementDataNumericHighLowComposite> data : result) {
+ buildIndividualGraph(measurementDefinitions.get(i++), data);
+ }
+ // There is a weird timing case when availabilityGraph can be null
+ if (availabilityGraph != null) {
+ availabilityGraph.setGroupAvailabilityList(groupAvailabilityList);
+ new Timer() {
+ @Override
+ public void run() {
+ availabilityGraph.drawJsniChart();
}
- }
- });
-
+ }.schedule(150);
+ }
+ }
}
});
+
}
protected void queryAvailability(final EntityContext groupContext, Long startTime, Long endTime,
@@ -197,7 +186,7 @@ public final class D3GroupGraphListView extends AbstractD3GraphListView implemen
List<MeasurementDataNumericHighLowComposite> data) {
MetricGraphData metricGraphData = MetricGraphData.createForResourceGroup(resourceGroup.getId(),
- resourceGroup.getName(), measurementDefinition, data );
+ resourceGroup.getName(), measurementDefinition, data);
StackedBarMetricGraphImpl graph = GWT.create(StackedBarMetricGraphImpl.class);
graph.setMetricGraphData(metricGraphData);
@@ -207,11 +196,9 @@ public final class D3GroupGraphListView extends AbstractD3GraphListView implemen
graphView.setWidth("95%");
graphView.setHeight(MULTI_CHART_HEIGHT);
- if(graphsVLayout != null){
+ if (graphsVLayout != null) {
graphsVLayout.addMember(graphView);
}
}
-
-
}
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 f8caf13..8e959db 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
@@ -68,8 +68,7 @@ import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitorin
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.MeasurementTableView;
-import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.table.MetricsTableView;
+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;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation.history.ResourceOperationHistoryListView;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation.schedule.ResourceOperationScheduleListView;
@@ -408,7 +407,8 @@ public class ResourceDetailView extends
viewFactory = (!visible) ? null : new ViewFactory() {
@Override
public Canvas createView() {
- return new MetricsTableView(resource.getId());
+ //return new MetricsTableView(resource.getId());
+ return new MetricsResourceView(resource);
}
};
updateSubTab(this.monitoringTab, this.monitorMetrics, visible, true, viewFactory);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/D3GraphListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/D3GraphListView.java
index 65893ce..8b9f327 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/D3GraphListView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/D3GraphListView.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
@@ -21,7 +21,6 @@ package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitori
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
-import java.util.EnumSet;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
@@ -30,7 +29,6 @@ import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.types.Overflow;
-import com.smartgwt.client.widgets.form.fields.events.ClickHandler;
import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.common.EntityContext;
@@ -41,16 +39,14 @@ import org.rhq.core.domain.measurement.MeasurementDefinition;
import org.rhq.core.domain.measurement.composite.MeasurementDataNumericHighLowComposite;
import org.rhq.core.domain.measurement.composite.MeasurementOOBComposite;
import org.rhq.core.domain.resource.Resource;
-import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
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.common.graph.MetricGraphData;
+import org.rhq.enterprise.gui.coregui.client.inventory.common.graph.graphtype.AvailabilityOverUnderGraphType;
import org.rhq.enterprise.gui.coregui.client.inventory.common.graph.graphtype.StackedBarMetricGraphImpl;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.avail.AvailabilityD3GraphView;
-import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
import org.rhq.enterprise.gui.coregui.client.util.Log;
import org.rhq.enterprise.gui.coregui.client.util.async.Command;
import org.rhq.enterprise.gui.coregui.client.util.async.CountDownLatch;
@@ -115,17 +111,17 @@ public class D3GraphListView extends AbstractD3GraphListView {
setOverflow(Overflow.HIDDEN);
}
-
@Override
protected void onDraw() {
super.onDraw();
- Log.debug("D3GraphListView.onDraw() for: " + resource.getName()+ " id: "+ resource.getId());
+ Log.debug("D3GraphListView.onDraw() for: " + resource.getName() + " id: " + resource.getId());
destroyMembers();
addMember(buttonBarDateTimeRangeEditor);
if (showAvailabilityGraph) {
- availabilityGraph = new AvailabilityD3GraphView<AvailabilityOverUnderGraphType>(new AvailabilityOverUnderGraphType(resource.getId()));
+ availabilityGraph = new AvailabilityD3GraphView<AvailabilityOverUnderGraphType>(
+ new AvailabilityOverUnderGraphType(resource.getId()));
addMember(availabilityGraph);
}
@@ -163,8 +159,8 @@ public class D3GraphListView extends AbstractD3GraphListView {
@Override
public void onSuccess(List<Availability> availList) {
- Log.debug("\nSuccessfully queried availability in: "
- + (System.currentTimeMillis() - timerStart) + " ms.");
+ Log.debug("\nSuccessfully queried availability in: " + (System.currentTimeMillis() - timerStart)
+ + " ms.");
availabilityList = availList;
if (countDownLatch != null) {
countDownLatch.countDown();
@@ -180,193 +176,179 @@ public class D3GraphListView extends AbstractD3GraphListView {
private void queryAndBuildGraphs() {
final long startTimer = System.currentTimeMillis();
- if(null != availabilityGraph){
+ if (null != availabilityGraph) {
queryAvailability(EntityContext.forResource(resource.getId()), buttonBarDateTimeRangeEditor.getStartTime(),
buttonBarDateTimeRangeEditor.getEndTime(), null);
}
- ResourceTypeRepository.Cache.getInstance().getResourceTypes(resource.getResourceType().getId(),
- EnumSet.of(ResourceTypeRepository.MetadataType.measurements),
- new ResourceTypeRepository.TypeLoadedCallback() {
- public void onTypesLoaded(final ResourceType type) {
+ final ArrayList<MeasurementDefinition> measurementDefinitions = new ArrayList<MeasurementDefinition>();
+ final ArrayList<MeasurementDefinition> summaryMeasurementDefinitions = new ArrayList<MeasurementDefinition>();
- final ArrayList<MeasurementDefinition> measurementDefinitions = new ArrayList<MeasurementDefinition>();
- final ArrayList<MeasurementDefinition> summaryMeasurementDefinitions = new ArrayList<MeasurementDefinition>();
+ for (MeasurementDefinition def : resource.getResourceType().getMetricDefinitions()) {
+ if (def.getDataType() == DataType.MEASUREMENT && def.getDisplayType() == DisplayType.SUMMARY) {
+ summaryMeasurementDefinitions.add(def);
+ }
+ measurementDefinitions.add(def);
+ }
- for (MeasurementDefinition def : type.getMetricDefinitions()) {
- if (def.getDataType() == DataType.MEASUREMENT && def.getDisplayType() == DisplayType.SUMMARY) {
- summaryMeasurementDefinitions.add(def);
- }
- measurementDefinitions.add(def);
- }
+ Collections.sort(measurementDefinitions, new Comparator<MeasurementDefinition>() {
+ @Override
+ public int compare(MeasurementDefinition o1, MeasurementDefinition o2) {
+ return new Integer(o1.getDisplayOrder()).compareTo(o2.getDisplayOrder());
+ }
+ });
+ Collections.sort(summaryMeasurementDefinitions, new Comparator<MeasurementDefinition>() {
+ @Override
+ public int compare(MeasurementDefinition o1, MeasurementDefinition o2) {
+ return new Integer(o1.getDisplayOrder()).compareTo(o2.getDisplayOrder());
+ }
+ });
+
+ int[] measDefIdArray = new int[measurementDefinitions.size()];
+ for (int i = 0; i < measDefIdArray.length; i++) {
+ measDefIdArray[i] = measurementDefinitions.get(i).getId();
+ }
- Collections.sort(measurementDefinitions, new Comparator<MeasurementDefinition>() {
- @Override
- public int compare(MeasurementDefinition o1, MeasurementDefinition o2) {
- return new Integer(o1.getDisplayOrder()).compareTo(o2.getDisplayOrder());
- }
- });
- Collections.sort(summaryMeasurementDefinitions, new Comparator<MeasurementDefinition>() {
- @Override
- public int compare(MeasurementDefinition o1, MeasurementDefinition o2) {
- return new Integer(o1.getDisplayOrder()).compareTo(o2.getDisplayOrder());
- }
- });
-
- int[] measDefIdArray = new int[measurementDefinitions.size()];
- for (int i = 0; i < measDefIdArray.length; i++) {
- measDefIdArray[i] = measurementDefinitions.get(i).getId();
+ // setting up a deferred Command to execute after all resource queries have completed (successfully or unsuccessfully)
+ // we know there are exactly 2 resources
+ final CountDownLatch countDownLatch = CountDownLatch.create(NUM_ASYNC_CALLS, new Command() {
+ @Override
+ /**
+ * Satisfied only after ALL of the metric queries AND availability have completed
+ */
+ public void execute() {
+ Log.debug("Total Time for async metrics/avail query: " + (System.currentTimeMillis() - startTimer));
+ if (null == metricsDataList || metricsDataList.isEmpty()) {
+ loadingLabel.setContents(MSG.view_resource_monitor_graphs_noneAvailable());
+ } else {
+ loadingLabel.hide();
+ if (useSummaryData) {
+ buildSummaryGraphs(metricsDataList, summaryMeasurementDefinitions, measurementDefinitions);
+ } else {
+ determineGraphsToBuild(metricsDataList, measurementDefinitions, definitionIds);
}
-
- // setting up a deferred Command to execute after all resource queries have completed (successfully or unsuccessfully)
- // we know there are exactly 2 resources
- final CountDownLatch countDownLatch = CountDownLatch.create(NUM_ASYNC_CALLS, new Command() {
- @Override
- /**
- * Satisfied only after ALL of the metric queries AND availability have completed
- */
- public void execute() {
- Log.debug("Total Time for async metrics/avail query: "
- + (System.currentTimeMillis() - startTimer));
- if (null == metricsDataList || metricsDataList.isEmpty()) {
- loadingLabel.setContents(MSG.view_resource_monitor_graphs_noneAvailable());
- } else {
- loadingLabel.hide();
- if (useSummaryData) {
- buildSummaryGraphs(metricsDataList, summaryMeasurementDefinitions,
- measurementDefinitions);
- } else {
- determineGraphsToBuild(metricsDataList, measurementDefinitions, definitionIds);
- }
- // There is a weird timing case when availabilityGraph can be null
- if (null != availabilityGraph) {
- // we only need the first metricData since we are only taking the
- // availability data set in there for the dropdowns already
- availabilityGraph.setAvailabilityList(availabilityList);
- new Timer(){
- @Override
- public void run() {
- availabilityGraph.drawJsniChart();
- }
- }.schedule(150);
- }
+ // There is a weird timing case when availabilityGraph can be null
+ if (null != availabilityGraph) {
+ // we only need the first metricData since we are only taking the
+ // availability data set in there for the dropdowns already
+ availabilityGraph.setAvailabilityList(availabilityList);
+ new Timer() {
+ @Override
+ public void run() {
+ availabilityGraph.drawJsniChart();
}
+ }.schedule(150);
+ }
+ }
- }
- });
+ }
+ });
- queryMetricData(measDefIdArray, countDownLatch);
- queryOOBMetrics(resource, countDownLatch);
- // now the countDown latch will run sometime asynchronously
+ queryMetricData(measDefIdArray, countDownLatch);
+ queryOOBMetrics(resource, countDownLatch);
+ // now the countDown latch will run sometime asynchronously
+ }
+ private void queryMetricData(final int[] measDefIdArray, final CountDownLatch countDownLatch) {
+ GWTServiceLookup.getMeasurementDataService().findDataForResource(resource.getId(), measDefIdArray,
+ buttonBarDateTimeRangeEditor.getStartTime(), buttonBarDateTimeRangeEditor.getEndTime(), 60,
+ new AsyncCallback<List<List<MeasurementDataNumericHighLowComposite>>>() {
+ @Override
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError(MSG.view_resource_monitor_graphs_loadFailed(), caught);
+ loadingLabel.setContents(MSG.view_resource_monitor_graphs_loadFailed());
+ countDownLatch.countDown();
}
- private void queryMetricData(final int[] measDefIdArray, final CountDownLatch countDownLatch) {
- GWTServiceLookup.getMeasurementDataService().findDataForResource(resource.getId(), measDefIdArray,
- buttonBarDateTimeRangeEditor.getStartTime(), buttonBarDateTimeRangeEditor.getEndTime(), 60,
- new AsyncCallback<List<List<MeasurementDataNumericHighLowComposite>>>() {
- @Override
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError(MSG.view_resource_monitor_graphs_loadFailed(),
- caught);
- loadingLabel.setContents(MSG.view_resource_monitor_graphs_loadFailed());
- countDownLatch.countDown();
- }
-
- @Override
- public void onSuccess(List<List<MeasurementDataNumericHighLowComposite>> metrics) {
- metricsDataList = metrics;
- Log.debug("Regular Metric graph data queried in: "
- + (System.currentTimeMillis() - startTimer + " ms."));
- countDownLatch.countDown();
+ @Override
+ public void onSuccess(List<List<MeasurementDataNumericHighLowComposite>> metrics) {
+ metricsDataList = metrics;
+ countDownLatch.countDown();
- }
- });
}
+ });
+ }
- private void queryOOBMetrics(final Resource resource, final CountDownLatch countDownLatch) {
+ private void queryOOBMetrics(final Resource resource, final CountDownLatch countDownLatch) {
- final long startTime = System.currentTimeMillis();
+ final long startTime = System.currentTimeMillis();
- GWTServiceLookup.getMeasurementDataService().getHighestNOOBsForResource(resource.getId(), 60,
+ GWTServiceLookup.getMeasurementDataService().getHighestNOOBsForResource(resource.getId(), 60,
- new AsyncCallback<PageList<MeasurementOOBComposite>>() {
- @Override
- public void onSuccess(PageList<MeasurementOOBComposite> measurementOOBComposites) {
+ new AsyncCallback<PageList<MeasurementOOBComposite>>() {
+ @Override
+ public void onSuccess(PageList<MeasurementOOBComposite> measurementOOBComposites) {
- measurementOOBCompositeList = measurementOOBComposites;
- Log.debug("\nSuccessfully queried "+measurementOOBCompositeList.size() +" OOB records in: " + (System.currentTimeMillis() - startTime)
- + " ms.");
- countDownLatch.countDown();
- }
+ measurementOOBCompositeList = measurementOOBComposites;
+ Log.debug("\nSuccessfully queried " + measurementOOBCompositeList.size() + " OOB records in: "
+ + (System.currentTimeMillis() - startTime) + " ms.");
+ countDownLatch.countDown();
+ }
- @Override
- public void onFailure(Throwable caught) {
- Log.debug("Error retrieving out of bound metrics for resource [" + resource.getId() + "]:"
- + caught.getMessage());
- countDownLatch.countDown();
- }
- });
+ @Override
+ public void onFailure(Throwable caught) {
+ Log.debug("Error retrieving out of bound metrics for resource [" + resource.getId() + "]:"
+ + caught.getMessage());
+ countDownLatch.countDown();
+ }
+ });
- }
+ }
- /**
- * Spin through the measurement definitions (in order) checking to see if they are in the
- * summary measurement definition set and if so build a graph.
- * @param measurementData
- * @param summaryMeasurementDefinitions
- * @param measurementDefinitions
- */
- private void buildSummaryGraphs(List<List<MeasurementDataNumericHighLowComposite>> measurementData,
- List<MeasurementDefinition> summaryMeasurementDefinitions,
- List<MeasurementDefinition> measurementDefinitions) {
- Set<Integer> summaryIds = new TreeSet<Integer>();
- for (MeasurementDefinition summaryMeasurementDefinition : summaryMeasurementDefinitions) {
- summaryIds.add(summaryMeasurementDefinition.getId());
- }
+ /**
+ * Spin through the measurement definitions (in order) checking to see if they are in the
+ * summary measurement definition set and if so build a graph.
+ * @param measurementData
+ * @param summaryMeasurementDefinitions
+ * @param measurementDefinitions
+ */
+ private void buildSummaryGraphs(List<List<MeasurementDataNumericHighLowComposite>> measurementData,
+ List<MeasurementDefinition> summaryMeasurementDefinitions, List<MeasurementDefinition> measurementDefinitions) {
+ Set<Integer> summaryIds = new TreeSet<Integer>();
+ for (MeasurementDefinition summaryMeasurementDefinition : summaryMeasurementDefinitions) {
+ summaryIds.add(summaryMeasurementDefinition.getId());
+ }
- int i = 0;
- for (MeasurementDefinition measurementDefinition : measurementDefinitions) {
- if (summaryIds.contains(measurementDefinition.getId())) {
- buildSingleGraph(measurementOOBCompositeList, measurementDefinition,
- measurementData.get(i), MULTI_CHART_HEIGHT);
- }
- i++;
- }
+ int i = 0;
+ for (MeasurementDefinition measurementDefinition : measurementDefinitions) {
+ if (summaryIds.contains(measurementDefinition.getId())) {
+ buildSingleGraph(measurementOOBCompositeList, measurementDefinition, measurementData.get(i),
+ MULTI_CHART_HEIGHT);
+ }
+ i++;
+ }
- }
+ }
- private void determineGraphsToBuild(List<List<MeasurementDataNumericHighLowComposite>> measurementData,
- List<MeasurementDefinition> measurementDefinitions, Set<Integer> definitionIds) {
- int i = 0;
- for (List<MeasurementDataNumericHighLowComposite> metric : measurementData) {
-
- for (Integer selectedDefinitionId : definitionIds) {
- final MeasurementDefinition measurementDefinition = measurementDefinitions.get(i);
- final int measurementId = measurementDefinition.getId();
-
- if (null != selectedDefinitionId) {
- // single graph case
- if (measurementId == selectedDefinitionId) {
- buildSingleGraph(measurementOOBCompositeList, measurementDefinition, metric, SINGLE_CHART_HEIGHT);
- }
- } else {
- // multiple graph case
- buildSingleGraph(measurementOOBCompositeList, measurementDefinition, metric, MULTI_CHART_HEIGHT);
- }
- }
- i++;
+ private void determineGraphsToBuild(List<List<MeasurementDataNumericHighLowComposite>> measurementData,
+ List<MeasurementDefinition> measurementDefinitions, Set<Integer> definitionIds) {
+ int i = 0;
+ for (List<MeasurementDataNumericHighLowComposite> metric : measurementData) {
+
+ for (Integer selectedDefinitionId : definitionIds) {
+ final MeasurementDefinition measurementDefinition = measurementDefinitions.get(i);
+ final int measurementId = measurementDefinition.getId();
+
+ if (null != selectedDefinitionId) {
+ // single graph case
+ if (measurementId == selectedDefinitionId) {
+ buildSingleGraph(measurementOOBCompositeList, measurementDefinition, metric,
+ SINGLE_CHART_HEIGHT);
}
+ } else {
+ // multiple graph case
+ buildSingleGraph(measurementOOBCompositeList, measurementDefinition, metric, MULTI_CHART_HEIGHT);
}
- });
-
+ }
+ i++;
+ }
}
private void buildSingleGraph(PageList<MeasurementOOBComposite> measurementOOBCompositeList,
MeasurementDefinition measurementDefinition, List<MeasurementDataNumericHighLowComposite> data, int height) {
MetricGraphData metricGraphData = MetricGraphData.createForResource(resource.getId(), resource.getName(),
- measurementDefinition, data, measurementOOBCompositeList );
+ measurementDefinition, data, measurementOOBCompositeList);
StackedBarMetricGraphImpl graph = GWT.create(StackedBarMetricGraphImpl.class);
graph.setMetricGraphData(metricGraphData);
graph.setGraphListView(this);
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
new file mode 100644
index 0000000..e4785da
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsResourceView.java
@@ -0,0 +1,306 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2013 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.table;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Set;
+
+import com.google.gwt.user.client.Timer;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.types.ExpansionMode;
+import com.smartgwt.client.types.Overflow;
+import com.smartgwt.client.types.VerticalAlignment;
+import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.HTMLFlow;
+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.grid.ListGrid;
+import com.smartgwt.client.widgets.grid.ListGridField;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+import com.smartgwt.client.widgets.grid.events.RecordExpandEvent;
+import com.smartgwt.client.widgets.grid.events.RecordExpandHandler;
+import com.smartgwt.client.widgets.layout.VLayout;
+
+import org.rhq.core.domain.common.EntityContext;
+import org.rhq.core.domain.measurement.Availability;
+import org.rhq.core.domain.measurement.MeasurementDefinition;
+import org.rhq.core.domain.measurement.composite.MeasurementDataNumericHighLowComposite;
+import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.IconEnum;
+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.MetricD3Graph;
+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;
+
+/**
+ * The consolidated metrics view showing metric graphs and availability data both in graphical and tabular form.
+ *
+ * @author Mike Thompson
+ */
+public class MetricsResourceView extends AbstractD3GraphListView {
+
+ private static final String COLLAPSED_TOOLTIP = MSG.chart_metrics_collapse_tooltip();
+ private static final String EXPANDED_TOOLTIP = MSG.chart_metrics_expand_tooltip();
+
+ private Resource resource;
+ private Set<Integer> definitionIds = null;
+ private VLayout vLayout;
+ private Img expandCollapseArrow;
+ MetricsTableListGrid metricsGrid;
+ MetricsViewDataSource dataSource;
+ EnhancedHLayout availabilityDetails;
+
+
+ public MetricsResourceView(Resource resource) {
+ super();
+ this.resource = resource;
+ dataSource = new MetricsViewDataSource(resource);
+ metricsGrid = new MetricsTableListGrid();
+
+ ArrayList<ListGridField> fields = dataSource.getListGridFields();
+ metricsGrid.setFields(fields.toArray(new ListGridField[0]));
+ metricsGrid.setCanExpandRecords(true);
+ metricsGrid.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);
+
+ }
+
+ });
+
+ }
+
+ private EnhancedHLayout createAvailabilityDetails() {
+ EnhancedHLayout hLayout = new EnhancedHLayout();
+ hLayout.addMember(new Label("Availability Details"));
+ hLayout.hide();
+ return hLayout;
+ }
+
+ public void redrawGraphs() {
+ this.onDraw();
+ }
+
+ @Override
+ protected void onDraw() {
+ super.onDraw();
+ Log.debug("MetricResourceView.onDraw() for: " + resource.getName() + " id: " + resource.getId());
+ destroyMembers();
+
+
+ vLayout = new VLayout();
+ vLayout.setOverflow(Overflow.AUTO);
+ vLayout.setWidth100();
+ vLayout.setHeight(220);
+ vLayout.addMember(buttonBarDateTimeRangeEditor);
+
+ EnhancedHLayout expandCollapseHLayout = new EnhancedHLayout();
+
+ //add expand/collapse icon
+ expandCollapseArrow = new Img(IconEnum.COLLAPSED_ICON.getIcon16x16Path(), 16, 16);
+ expandCollapseArrow.setTooltip(COLLAPSED_TOOLTIP);
+ expandCollapseArrow.setLayoutAlign(VerticalAlignment.BOTTOM);
+ expandCollapseArrow.addClickHandler(new ClickHandler() {
+ private boolean collapsed = true;
+
+ @Override
+ public void onClick(ClickEvent event) {
+ collapsed = !collapsed;
+ if (collapsed) {
+ expandCollapseArrow.setSrc(IconEnum.COLLAPSED_ICON.getIcon16x16Path());
+ expandCollapseArrow.setTooltip(COLLAPSED_TOOLTIP);
+ availabilityDetails.hide();
+ }
+ else {
+ expandCollapseArrow.setSrc(IconEnum.EXPANDED_ICON.getIcon16x16Path());
+ expandCollapseArrow.setTooltip(EXPANDED_TOOLTIP);
+ availabilityDetails.show();
+ }
+ markForRedraw();
+ }
+ });
+
+ availabilityDetails = createAvailabilityDetails();
+
+ availabilityGraph = new AvailabilityD3GraphView<AvailabilityOverUnderGraphType>(
+ new AvailabilityOverUnderGraphType(resource.getId()));
+
+ expandCollapseHLayout.addMember(expandCollapseArrow);
+ expandCollapseHLayout.addMember(availabilityGraph);
+ vLayout.addMember(expandCollapseHLayout);
+ vLayout.addMember(availabilityDetails);
+
+ vLayout.addMember(metricsGrid);
+
+ addMember(vLayout);
+
+ if (resource != null) {
+ queryAvailability(EntityContext.forResource(resource.getId()), buttonBarDateTimeRangeEditor.getStartTime(),
+ buttonBarDateTimeRangeEditor.getEndTime(), null);
+ }
+ }
+
+ @Override
+ protected void queryAvailability(final EntityContext context, Long startTime, Long endTime,
+ final CountDownLatch countDownLatch) {
+
+ final long timerStart = System.currentTimeMillis();
+
+ // now return the availability
+ GWTServiceLookup.getAvailabilityService().getAvailabilitiesForResource(context.getResourceId(), startTime,
+ endTime, new AsyncCallback<List<Availability>>() {
+ @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;
+ new Timer() {
+ @Override
+ public void run() {
+ availabilityGraph.drawJsniChart();
+ }
+ }.schedule(150);
+
+ if (countDownLatch != null) {
+ countDownLatch.countDown();
+ }
+ }
+ });
+ }
+
+ private class MetricsTableListGrid extends ListGrid {
+ public MetricsTableListGrid() {
+ super();
+
+ setCanExpandRecords(true);
+ setCanExpandMultipleRecords(true);
+ setExpansionMode(ExpansionMode.DETAIL_FIELD);
+ }
+
+ @Override
+ protected Canvas getExpansionComponent(final ListGridRecord record) {
+ final Integer definitionId = record.getAttributeAsInt(MetricsViewDataSource.FIELD_METRIC_DEF_ID);
+ final Integer resourceId = record.getAttributeAsInt(MetricsViewDataSource.FIELD_RESOURCE_ID);
+ VLayout vLayout = new VLayout();
+ vLayout.setPadding(5);
+
+ final String chartId = "rChart" + resourceId + "-" + definitionId;
+ HTMLFlow htmlFlow = new HTMLFlow(MetricD3Graph.createGraphMarkerTemplate(chartId, 200));
+ vLayout.addMember(htmlFlow);
+
+ new Timer() {
+
+ @Override
+ public void run() {
+ BrowserUtility.graphSparkLines();
+ }
+ }.schedule(150);
+
+
+ // Load the fully fetched ResourceType.
+ ResourceType resourceType = resource.getResourceType();
+
+ Set<MeasurementDefinition> definitions = resourceType.getMetricDefinitions();
+ final MeasurementDefinition measurementDefinition;
+
+ //build id mapping for measurementDefinition instances Ex. Free Memory -> MeasurementDefinition[100071]
+ final HashMap<String, MeasurementDefinition> measurementDefMap = new HashMap<String, MeasurementDefinition>();
+ for (MeasurementDefinition definition : definitions) {
+ measurementDefMap.put(definition.getDisplayName(), definition);
+ if (definition.getId() == definitionId) {
+ measurementDefinition = definition;
+ break;
+ }
+ }
+
+ int[] definitionArrayIds = new int[1];
+ definitionArrayIds[0] = definitionId;
+ GWTServiceLookup.getMeasurementDataService().findDataForResource(resourceId, definitionArrayIds,
+ measurementUserPrefs.getMetricRangePreferences().begin,
+ measurementUserPrefs.getMetricRangePreferences().end, 60,
+ new AsyncCallback<List<List<MeasurementDataNumericHighLowComposite>>>() {
+ @Override
+ public void onFailure(Throwable caught) {
+ Log.debug("Error retrieving recent metrics charting data for resource [" + resourceId + "]:"
+ + caught.getMessage());
+ }
+
+ @Override
+ public void onSuccess(List<List<MeasurementDataNumericHighLowComposite>> results) {
+ if (!results.isEmpty()) {
+
+ //load the data results for the given metric definition
+ List<MeasurementDataNumericHighLowComposite> data = results.get(0);
+ Log.debug(" *** Metric Data Results: "+data.size());
+
+// MetricGraphData metricGraphData = MetricGraphData
+// .createForResource(resourceId, resource.getName(),
+// measurementDefinition, data, null);
+//
+// StackedBarMetricGraphImpl graph = GWT
+// .create(StackedBarMetricGraphImpl.class);
+// graph.setMetricGraphData(metricGraphData);
+// final MetricD3Graph graphView = new MetricD3Graph(graph, this);
+// new Timer() {
+// @Override
+// public void run() {
+// graphView.drawJsniChart();
+//
+// }
+// }.schedule(150);
+
+ } else {
+ Log.warn("No chart data retrieving for resource [" + resourceId + "]");
+
+ }
+ }
+ });
+
+ return vLayout;
+ }
+ }
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsTableDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsTableDataSource.java
index 0586702..57e62ab 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsTableDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsTableDataSource.java
@@ -48,7 +48,9 @@ import org.rhq.enterprise.gui.coregui.client.util.preferences.MeasurementUserPre
*
* @author John Mazzitelli
* @author Mike Thompson
+ * @todo: get rid of this once we have tested the new screen out
*/
+@Deprecated
public class MetricsTableDataSource extends RPCDataSource<MetricDisplaySummary, Criteria> {
public static final String FIELD_SPARKLINE = "sparkline";
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 163b191..82fe2d2 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
@@ -76,6 +76,7 @@ import org.rhq.enterprise.gui.coregui.client.util.preferences.MeasurementUserPre
* @author John Mazzitelli
* @author Mike Thompson
*/
+@Deprecated
public class MetricsTableView extends Table<MetricsTableDataSource> implements RedrawGraphs {
private final int resourceId;
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
new file mode 100644
index 0000000..605267d
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsViewDataSource.java
@@ -0,0 +1,298 @@
+package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.table;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Set;
+
+import com.google.gwt.user.client.Timer;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.data.DSRequest;
+import com.smartgwt.client.data.DSResponse;
+import com.smartgwt.client.data.Record;
+import com.smartgwt.client.widgets.grid.CellFormatter;
+import com.smartgwt.client.widgets.grid.ListGridField;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+
+import org.rhq.core.domain.criteria.Criteria;
+import org.rhq.core.domain.measurement.DataType;
+import org.rhq.core.domain.measurement.MeasurementDefinition;
+import org.rhq.core.domain.measurement.MeasurementSchedule;
+import org.rhq.core.domain.measurement.composite.MeasurementDataNumericHighLowComposite;
+import org.rhq.core.domain.measurement.ui.MetricDisplaySummary;
+import org.rhq.core.domain.measurement.ui.MetricDisplayValue;
+import org.rhq.core.domain.resource.Resource;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.UserSessionManager;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+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.MeasurementUtility;
+import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
+import org.rhq.enterprise.gui.coregui.client.util.async.Command;
+import org.rhq.enterprise.gui.coregui.client.util.async.CountDownLatch;
+import org.rhq.enterprise.gui.coregui.client.util.preferences.MeasurementUserPreferences;
+
+/**
+ * A simple data source to read in metric data summaries for a resource.
+ * This doesn't support paging - everything is returned in one query. Since
+ * the number of metrics per resource is relatively small (never more than tens of them),
+ * we just load them all in at once.
+ *
+ * @author John Mazzitelli
+ * @author Mike Thompson
+ */
+public class MetricsViewDataSource extends RPCDataSource<MetricDisplaySummary, Criteria> {
+
+ public static final int NUMBER_OF_METRIC_POINTS = 60;
+ public static final String FIELD_SPARKLINE = "sparkline";
+ public static final String FIELD_METRIC_LABEL = "label";
+ public static final String FIELD_ALERT_COUNT = "alertCount";
+ public static final String FIELD_MIN_VALUE = "min";
+ public static final String FIELD_MAX_VALUE = "max";
+ public static final String FIELD_AVG_VALUE = "avg";
+ public static final String FIELD_LAST_VALUE = "last";
+ public static final String FIELD_METRIC_DEF_ID = "defId";
+ public static final String FIELD_METRIC_SCHED_ID = "schedId";
+ public static final String FIELD_METRIC_UNITS = "units";
+ public static final String FIELD_METRIC_NAME = "name";
+ public static final String FIELD_RESOURCE_ID = "resourceId";
+ final private Resource resource;
+ private List<MetricDisplaySummary> metricDisplaySummaries;
+ private List<List<MeasurementDataNumericHighLowComposite>> metricsDataList;
+ private MeasurementUserPreferences measurementUserPrefs;
+
+ public MetricsViewDataSource(Resource resource) {
+ this.resource = resource;
+ measurementUserPrefs = new MeasurementUserPreferences(UserSessionManager.getUserPreferences());
+ }
+
+ /**
+ * The view that contains the list grid which will display this datasource's data will call this
+ * method to get the field information which is used to control the display of the data.
+ *
+ * @return list grid fields used to display the datasource data
+ */
+ public ArrayList<ListGridField> getListGridFields() {
+ ArrayList<ListGridField> fields = new ArrayList<ListGridField>(7);
+
+ ListGridField sparklineField = new ListGridField(FIELD_SPARKLINE, "chart");
+ sparklineField.setCellFormatter(new CellFormatter() {
+ @Override
+ public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
+ if (value == null) {
+ return "";
+ }
+ String contents = "<span id='sparkline_" + resource.getId() + "-"
+ + record.getAttributeAsInt(FIELD_METRIC_DEF_ID) + "' class='dynamicsparkline' width='70' "
+ + "values='" + record.getAttribute(FIELD_SPARKLINE) + "'></span>";
+ return contents;
+
+ }
+ });
+
+ sparklineField.setWidth(80);
+ fields.add(sparklineField);
+
+ ListGridField nameField = new ListGridField(FIELD_METRIC_LABEL, MSG.common_title_name());
+ nameField.setWidth("30%");
+ fields.add(nameField);
+
+ ListGridField alertsField = new ListGridField(FIELD_ALERT_COUNT, MSG.common_title_alerts());
+ alertsField.setWidth("10%");
+ fields.add(alertsField);
+
+ ListGridField minField = new ListGridField(FIELD_MIN_VALUE, MSG.view_resource_monitor_table_min());
+ minField.setWidth("15%");
+ fields.add(minField);
+
+ ListGridField maxField = new ListGridField(FIELD_MAX_VALUE, MSG.view_resource_monitor_table_max());
+ maxField.setWidth("15%");
+ fields.add(maxField);
+
+ ListGridField avgField = new ListGridField(FIELD_AVG_VALUE, MSG.view_resource_monitor_table_avg());
+ avgField.setWidth("15%");
+ fields.add(avgField);
+
+ ListGridField lastField = new ListGridField(FIELD_LAST_VALUE, MSG.view_resource_monitor_table_last());
+ lastField.setWidth("15%");
+ fields.add(lastField);
+
+ return fields;
+ }
+
+ @Override
+ public MetricDisplaySummary copyValues(Record from) {
+ // we should never need this method - we only go in one direction
+ // if we ever need this, just have copyValues store an "object" attribute whose value is "from"
+ // which this method then just reads out. Since we don't need this now, save memory by not
+ // keeping the MetricDisplayValue around
+ return null;
+ }
+
+ @Override
+ public ListGridRecord copyValues(MetricDisplaySummary from) {
+ MeasurementUtility.formatSimpleMetrics(from);
+
+ ListGridRecord record = new ListGridRecord();
+ record.setAttribute(FIELD_SPARKLINE, getCsvMetricsForSparkline());
+ record.setAttribute(FIELD_METRIC_LABEL, from.getLabel());
+ record.setAttribute(FIELD_ALERT_COUNT, String.valueOf(from.getAlertCount()));
+ record.setAttribute(FIELD_MIN_VALUE, getMetricStringValue(from.getMinMetric()));
+ record.setAttribute(FIELD_MAX_VALUE, getMetricStringValue(from.getMaxMetric()));
+ record.setAttribute(FIELD_AVG_VALUE, getMetricStringValue(from.getAvgMetric()));
+ record.setAttribute(FIELD_LAST_VALUE, getMetricStringValue(from.getLastMetric()));
+ record.setAttribute(FIELD_METRIC_DEF_ID, from.getDefinitionId());
+ record.setAttribute(FIELD_METRIC_SCHED_ID, from.getScheduleId());
+ record.setAttribute(FIELD_METRIC_UNITS, from.getUnits());
+ record.setAttribute(FIELD_METRIC_NAME, from.getMetricName());
+ record.setAttribute(FIELD_RESOURCE_ID, resource.getId());
+ return record;
+ }
+
+ private String getCsvMetricsForSparkline() {
+ StringBuilder sb = new StringBuilder();
+ Log.debug("getCsvMetricsForSparkline.metricsDataList: " + metricsDataList.size());
+ for (List<MeasurementDataNumericHighLowComposite> measurementData : metricsDataList) {
+ for (int i = 0; i < measurementData.size(); i++) {
+ // take the last 20 values
+ if (i >= measurementData.size() - 20) {
+ if (!Double.isNaN(measurementData.get(i).getValue())) {
+ sb.append((int) measurementData.get(i).getValue());
+ sb.append(",");
+ }
+ }
+ }
+ if (sb.toString().endsWith(",")) {
+ sb.setLength(sb.length() - 1);
+ }
+ }
+ Log.debug("getCsvMetricsForSparkline: " + sb.toString());
+
+ return sb.toString();
+ }
+
+ protected String getMetricStringValue(MetricDisplayValue value) {
+ return (value != null) ? value.toString() : "";
+ }
+
+ @Override
+ protected Criteria getFetchCriteria(DSRequest request) {
+ // we don't use criterias for this datasource, just return null
+ return null;
+ }
+
+ @Override
+ protected void executeFetch(final DSRequest request, final DSResponse response, final Criteria unused) {
+
+ Log.debug("***** Fetching MetricsView data :");
+ GWTServiceLookup.getMeasurementScheduleService().findSchedulesForResourceAndType(resource.getId(),
+ DataType.MEASUREMENT, null, true, new AsyncCallback<ArrayList<MeasurementSchedule>>() {
+ @Override
+ public void onSuccess(ArrayList<MeasurementSchedule> measurementSchedules) {
+ int[] scheduleIds = new int[measurementSchedules.size()];
+ int i = 0;
+ for (MeasurementSchedule measurementSchedule : measurementSchedules) {
+ scheduleIds[i++] = measurementSchedule.getId();
+ }
+
+ final CountDownLatch countDownLatch = CountDownLatch.create(2, new Command() {
+
+ @Override
+ public void execute() {
+ response.setData(buildRecords(metricDisplaySummaries));
+ processResponse(request.getRequestId(), response);
+
+ new Timer() {
+
+ @Override
+ public void run() {
+ BrowserUtility.graphSparkLines();
+ }
+ }.schedule(150);
+ Log.debug("*** Finished CountdownLatch for metrics loaded: " + metricsDataList.size());
+ }
+ });
+
+ queryResourceMetrics(resource, measurementUserPrefs.getMetricRangePreferences().begin,
+ measurementUserPrefs.getMetricRangePreferences().end, countDownLatch);
+ queryMetricDisplaySummaries(scheduleIds, measurementUserPrefs.getMetricRangePreferences().begin,
+ measurementUserPrefs.getMetricRangePreferences().end, countDownLatch);
+ }
+
+ @Override
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Cannot load schedules", caught);
+ }
+ });
+ }
+
+ private void queryMetricDisplaySummaries(int[] scheduleIds, Long startTime, Long endTime,
+ final CountDownLatch countDownLatch) {
+ GWTServiceLookup.getMeasurementChartsService().getMetricDisplaySummariesForResource(resource.getId(),
+ scheduleIds, startTime, endTime, new AsyncCallback<ArrayList<MetricDisplaySummary>>() {
+ @Override
+ public void onSuccess(ArrayList<MetricDisplaySummary> metricDisplaySummaries) {
+ setMetricDisplaySummaries(metricDisplaySummaries);
+ countDownLatch.countDown();
+ }
+
+ @Override
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Cannot load metrics", caught);
+ countDownLatch.countDown();
+ }
+ }
+
+ );
+ }
+
+ void setMetricDisplaySummaries(List<MetricDisplaySummary> metricDisplaySummaries) {
+ this.metricDisplaySummaries = metricDisplaySummaries;
+ }
+
+ public void queryResourceMetrics(final Resource resource, Long startTime, Long endTime,
+ final CountDownLatch countDownLatch) {
+ Set<MeasurementDefinition> definitions = resource.getResourceType().getMetricDefinitions();
+
+ //build id mapping for measurementDefinition instances Ex. Free Memory -> MeasurementDefinition[100071]
+ final HashMap<String, MeasurementDefinition> measurementDefMap = new HashMap<String, MeasurementDefinition>();
+ for (MeasurementDefinition definition : definitions) {
+ measurementDefMap.put(definition.getDisplayName(), definition);
+ }
+ //bundle definition ids for asynch call.
+ int[] definitionArrayIds = new int[definitions.size()];
+ final String[] displayOrder = new String[definitions.size()];
+ measurementDefMap.keySet().toArray(displayOrder);
+ //sort the charting data ex. Free Memory, Free Swap Space,..System Load
+ Arrays.sort(displayOrder);
+
+ //organize definitionArrayIds for ordered request on server.
+ int index = 0;
+ for (String definitionToDisplay : displayOrder) {
+ definitionArrayIds[index++] = measurementDefMap.get(definitionToDisplay).getId();
+ }
+
+ GWTServiceLookup.getMeasurementDataService().findDataForResource(resource.getId(), definitionArrayIds,
+ startTime, endTime, NUMBER_OF_METRIC_POINTS,
+ new AsyncCallback<List<List<MeasurementDataNumericHighLowComposite>>>() {
+ @Override
+ public void onFailure(Throwable caught) {
+ Log.warn("Error retrieving recent metrics charting data for resource [" + resource.getId() + "]:"
+ + caught.getMessage());
+ }
+
+ @Override
+ public void onSuccess(List<List<MeasurementDataNumericHighLowComposite>> measurementDataList) {
+
+ if (!measurementDataList.isEmpty()) {
+ metricsDataList = measurementDataList;
+ Log.debug("*** Setting metricsDataList.size: " + metricsDataList.size());
+ countDownLatch.countDown();
+ }
+ }
+ });
+
+ }
+}
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
index 84e9c6e..ee4f817 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
@@ -20,6 +20,9 @@ chart_hover_period_label = Period
chart_hover_start_label = Start
chart_hover_time_format = %I:%M:%S %p
chart_ie_not_supported = Charting is not available for this browser.
+chart_metrics= Metrics
+chart_metrics_collapse_tooltip= Click here to see additional tabular availability data.
+chart_metrics_expand_tooltip= Click here to collapse additional availability detail.
chart_no_data_label = No Data
chart_single_value_label = Value
chart_slider_button_bar_day = Day
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties
index d6a102b..058da5a 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties
@@ -48,6 +48,9 @@ chart_hover_date_format = %d.%m.%y
##chart_hover_start_label = Start
chart_hover_time_format = %H:%M:%S
##chart_ie_not_supported = Charting is not available for this browser.
+##chart_metrics= Metrics
+##chart_metrics_collapse_tooltip= Click here to see additional tabular availability data.
+##chart_metrics_expand_tooltip= Click here to collapse additional availability detail.
##chart_no_data_label = No Data
##chart_single_value_label = Value
##chart_slider_button_bar_day = Day
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
index bd8e0b4..06f0040 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
@@ -23,6 +23,9 @@ chart_hover_period_label = Zeitraum
chart_hover_start_label = Start
chart_hover_time_format = %H:%M:%S
chart_ie_not_supported = Charting ist bei diesem Browser nicht unterstützt
+##chart_metrics= Metrics
+##chart_metrics_collapse_tooltip= Click here to see additional tabular availability data.
+##chart_metrics_expand_tooltip= Click here to collapse additional availability detail.
chart_no_data_label = Keine Daten vorhanden
##chart_single_value_label = Value
chart_slider_button_bar_day = Tag
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
index 9237f76..80bb10e 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
@@ -24,6 +24,9 @@
##chart_hover_date_format = %m/%d/%y
##chart_hover_time_format = %I:%M:%S %p
##chart_ie_not_supported = Charting is not available for this browser.
+##chart_metrics= Metrics
+##chart_metrics_collapse_tooltip= Click here to see additional tabular availability data.
+##chart_metrics_expand_tooltip= Click here to collapse additional availability detail.
##chart_no_data_label = No Data
##chart_single_value_label = Value
##chart_slider_button_bar_minute = Min
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ko.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ko.properties
index bd34f9b..45e9d84 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ko.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ko.properties
@@ -22,6 +22,9 @@
##chart_hover_date_format = %m/%d/%y
##chart_hover_time_format = %I:%M:%S %p
##chart_ie_not_supported = Charting is not available for this browser.
+##chart_metrics= Metrics
+##chart_metrics_collapse_tooltip= Click here to see additional tabular availability data.
+##chart_metrics_expand_tooltip= Click here to collapse additional availability detail.
##chart_no_data_label = No Data
##chart_single_value_label = Value
##chart_slider_button_bar_minute = Min
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
index 1330eb7..4fc33cd 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
@@ -21,6 +21,9 @@
##chart_hover_date_format = %m/%d/%y
##chart_hover_time_format = %I:%M:%S %p
##chart_ie_not_supported = Charting is not available for this browser.
+##chart_metrics= Metrics
+##chart_metrics_collapse_tooltip= Click here to see additional tabular availability data.
+##chart_metrics_expand_tooltip= Click here to collapse additional availability detail.
##chart_no_data_label = No Data
##chart_single_value_label = Value
##chart_slider_button_bar_minute = Min
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties
index 72a287b..9e68d15 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties
@@ -21,6 +21,9 @@
##chart_hover_date_format = %m/%d/%y
##chart_hover_time_format = %I:%M:%S %p
##chart_ie_not_supported = Charting is not available for this browser.
+##chart_metrics= Metrics
+##chart_metrics_collapse_tooltip= Click here to see additional tabular availability data.
+##chart_metrics_expand_tooltip= Click here to collapse additional availability detail.
##chart_no_data_label = No Data
##chart_single_value_label = Value
##chart_slider_button_bar_minute = Min
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
index 10f9b0a..d8363ba 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
@@ -21,6 +21,9 @@
##chart_hover_date_format = %m/%d/%y
##chart_hover_time_format = %I:%M:%S %p
##chart_ie_not_supported = Charting is not available for this browser.
+##chart_metrics= Metrics
+##chart_metrics_collapse_tooltip= Click here to see additional tabular availability data.
+##chart_metrics_expand_tooltip= Click here to collapse additional availability detail.
##chart_no_data_label = No Data
##chart_single_value_label = Value
##chart_slider_button_bar_minute = Min
commit 2574ddc2499670da832610c58a6706688a76f45b
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Fri Jul 12 11:06:48 2013 -0700
Consolidated Metrics expandable tree grid detail chart display.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsTableDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsTableDataSource.java
index 1d04c36..0586702 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsTableDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsTableDataSource.java
@@ -89,7 +89,6 @@ public class MetricsTableDataSource extends RPCDataSource<MetricDisplaySummary,
if (value == null) {
return "";
}
- //String formattedValue = StringUtility.escapeHtml(value.toString());
String contents = "<span id='sparkline_" + resourceId + "-"
+ record.getAttributeAsInt(FIELD_METRIC_DEF_ID) + "' class='dynamicsparkline' width='70' "
+ "values='" + record.getAttribute(FIELD_SPARKLINE) + "'></span>";
@@ -158,25 +157,25 @@ public class MetricsTableDataSource extends RPCDataSource<MetricDisplaySummary,
}
private String getCsvMetricsForSparkline() {
- StringBuilder sb = new StringBuilder();
- Log.debug("getCsvMetricsForSparkline.metricsDataList: "+metricsDataList.size());
- for (List<MeasurementDataNumericHighLowComposite> measurementData: metricsDataList) {
- int i = 0;
- for (MeasurementDataNumericHighLowComposite measurementDataComposite : measurementData) {
- // take the last 10 values
- if(i >= 50) {
- sb.append(measurementDataComposite.getValue());
- sb.append(",");
- i++;
+ StringBuilder sb = new StringBuilder();
+ Log.debug("getCsvMetricsForSparkline.metricsDataList: " + metricsDataList.size());
+ for (List<MeasurementDataNumericHighLowComposite> measurementData : metricsDataList) {
+ for (int i = 0; i < measurementData.size(); i++) {
+ // take the last 20 values
+ if (i >= measurementData.size() - 20) {
+ if (!Double.isNaN(measurementData.get(i).getValue())) {
+ sb.append((int) measurementData.get(i).getValue());
+ sb.append(",");
+ }
}
}
- if(sb.toString().endsWith(",")){
+ if (sb.toString().endsWith(",")) {
sb.setLength(sb.length() - 1);
}
}
- Log.debug("getCsvMetricsForSparkline: "+sb.toString());
+ Log.debug("getCsvMetricsForSparkline: " + sb.toString());
- return sb.toString();
+ return sb.toString();
}
protected String getMetricStringValue(MetricDisplayValue value) {
@@ -216,28 +215,28 @@ public class MetricsTableDataSource extends RPCDataSource<MetricDisplaySummary,
BrowserUtility.graphSparkLines();
}
}.schedule(150);
- Log.debug("*** Finished CountdownLatch for metrics loaded: "+ metricsDataList.size());
+ Log.debug("*** Finished CountdownLatch for metrics loaded: " + metricsDataList.size());
}
});
retrieveResourceMetrics(resourceId, countDownLatch);
- GWTServiceLookup.getMeasurementChartsService().
- getMetricDisplaySummariesForResource(resourceId, scheduleIds,
- measurementUserPrefs.getMetricRangePreferences().begin, measurementUserPrefs.getMetricRangePreferences().end,
- new AsyncCallback<ArrayList<MetricDisplaySummary>>() {
- @Override
- public void onSuccess(ArrayList<MetricDisplaySummary> metricDisplaySummaries) {
- setMetricDisplaySummaries(metricDisplaySummaries);
- countDownLatch.countDown();
- }
+ GWTServiceLookup.getMeasurementChartsService().getMetricDisplaySummariesForResource(resourceId,
+ scheduleIds, measurementUserPrefs.getMetricRangePreferences().begin,
+ measurementUserPrefs.getMetricRangePreferences().end,
+ new AsyncCallback<ArrayList<MetricDisplaySummary>>() {
+ @Override
+ public void onSuccess(ArrayList<MetricDisplaySummary> metricDisplaySummaries) {
+ setMetricDisplaySummaries(metricDisplaySummaries);
+ countDownLatch.countDown();
+ }
- @Override
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Cannot load metrics", caught);
- countDownLatch.countDown();
+ @Override
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Cannot load metrics", caught);
+ countDownLatch.countDown();
+ }
}
- }
);
}
@@ -253,86 +252,82 @@ public class MetricsTableDataSource extends RPCDataSource<MetricDisplaySummary,
this.metricDisplaySummaries = metricDisplaySummaries;
}
-
-
- public void retrieveResourceMetrics(final Integer resourceId, final CountDownLatch countDownLatch){
+ public void retrieveResourceMetrics(final Integer resourceId, final CountDownLatch countDownLatch) {
ResourceCriteria criteria = new ResourceCriteria();
criteria.addFilterId(resourceId);
//locate the resource
GWTServiceLookup.getResourceService().findResourceCompositesByCriteria(criteria,
- new AsyncCallback<PageList<ResourceComposite>>() {
- @Override
- public void onFailure(Throwable caught) {
- Log.debug("Error retrieving resource resource composite for resource [" + resourceId + "]:"
- + caught.getMessage());
- }
+ new AsyncCallback<PageList<ResourceComposite>>() {
+ @Override
+ public void onFailure(Throwable caught) {
+ Log.debug("Error retrieving resource resource composite for resource [" + resourceId + "]:"
+ + caught.getMessage());
+ }
- @Override
- public void onSuccess(PageList<ResourceComposite> resourceCompositePageList) {
- if (!resourceCompositePageList.isEmpty()) {
- final ResourceComposite resourceComposite = resourceCompositePageList.get(0);
- final Resource resource = resourceComposite.getResource();
- // Load the fully fetched ResourceType.
- ResourceType resourceType = resource.getResourceType();
- ResourceTypeRepository.Cache.getInstance().getResourceTypes(
- resourceType.getId(),
- EnumSet.of(ResourceTypeRepository.MetadataType.measurements),
- new ResourceTypeRepository.TypeLoadedCallback() {
- public void onTypesLoaded(ResourceType type) {
- resource.setResourceType(type);
- //metric definitions
- Set<MeasurementDefinition> definitions = type.getMetricDefinitions();
-
- //build id mapping for measurementDefinition instances Ex. Free Memory -> MeasurementDefinition[100071]
- final HashMap<String, MeasurementDefinition> measurementDefMap = new HashMap<String, MeasurementDefinition>();
- for (MeasurementDefinition definition : definitions) {
- measurementDefMap.put(definition.getDisplayName(), definition);
- }
- //bundle definition ids for asynch call.
- int[] definitionArrayIds = new int[definitions.size()];
- final String[] displayOrder = new String[definitions.size()];
- measurementDefMap.keySet().toArray(displayOrder);
- //sort the charting data ex. Free Memory, Free Swap Space,..System Load
- Arrays.sort(displayOrder);
-
- //organize definitionArrayIds for ordered request on server.
- int index = 0;
- for (String definitionToDisplay : displayOrder) {
- definitionArrayIds[index++] = measurementDefMap.get(definitionToDisplay)
- .getId();
+ @Override
+ public void onSuccess(PageList<ResourceComposite> resourceCompositePageList) {
+ if (!resourceCompositePageList.isEmpty()) {
+ final ResourceComposite resourceComposite = resourceCompositePageList.get(0);
+ final Resource resource = resourceComposite.getResource();
+ // Load the fully fetched ResourceType.
+ ResourceType resourceType = resource.getResourceType();
+ ResourceTypeRepository.Cache.getInstance().getResourceTypes(resourceType.getId(),
+ EnumSet.of(ResourceTypeRepository.MetadataType.measurements),
+ new ResourceTypeRepository.TypeLoadedCallback() {
+ public void onTypesLoaded(ResourceType type) {
+ resource.setResourceType(type);
+ //metric definitions
+ Set<MeasurementDefinition> definitions = type.getMetricDefinitions();
+
+ //build id mapping for measurementDefinition instances Ex. Free Memory -> MeasurementDefinition[100071]
+ final HashMap<String, MeasurementDefinition> measurementDefMap = new HashMap<String, MeasurementDefinition>();
+ for (MeasurementDefinition definition : definitions) {
+ measurementDefMap.put(definition.getDisplayName(), definition);
+ }
+ //bundle definition ids for asynch call.
+ int[] definitionArrayIds = new int[definitions.size()];
+ final String[] displayOrder = new String[definitions.size()];
+ measurementDefMap.keySet().toArray(displayOrder);
+ //sort the charting data ex. Free Memory, Free Swap Space,..System Load
+ Arrays.sort(displayOrder);
+
+ //organize definitionArrayIds for ordered request on server.
+ int index = 0;
+ for (String definitionToDisplay : displayOrder) {
+ definitionArrayIds[index++] = measurementDefMap.get(definitionToDisplay)
+ .getId();
+ }
+
+ GWTServiceLookup.getMeasurementDataService().findDataForResource(resourceId,
+ definitionArrayIds, measurementUserPrefs.getMetricRangePreferences().begin,
+ measurementUserPrefs.getMetricRangePreferences().end, 60,
+ new AsyncCallback<List<List<MeasurementDataNumericHighLowComposite>>>() {
+ @Override
+ public void onFailure(Throwable caught) {
+ Log.warn("Error retrieving recent metrics charting data for resource ["
+ + resourceId + "]:" + caught.getMessage());
}
+ @Override
+ public void onSuccess(
+ List<List<MeasurementDataNumericHighLowComposite>> measurementDataList) {
- GWTServiceLookup.getMeasurementDataService().findDataForResource(resourceId, definitionArrayIds,
- measurementUserPrefs.getMetricRangePreferences().begin,
- measurementUserPrefs.getMetricRangePreferences().end, 60,
- new AsyncCallback<List<List<MeasurementDataNumericHighLowComposite>>>() {
- @Override
- public void onFailure(Throwable caught) {
- Log.warn("Error retrieving recent metrics charting data for resource ["
- + resourceId + "]:" + caught.getMessage());
- }
-
- @Override
- public void onSuccess(List<List<MeasurementDataNumericHighLowComposite>> measurementDataList) {
-
- if (!measurementDataList.isEmpty()) {
- metricsDataList = measurementDataList;
- Log.debug("*** Setting metricsDataList.size: "+metricsDataList.size());
- countDownLatch.countDown();
- }
+ if (!measurementDataList.isEmpty()) {
+ metricsDataList = measurementDataList;
+ Log.debug("*** Setting metricsDataList.size: "
+ + metricsDataList.size());
+ countDownLatch.countDown();
}
- });
-
-
+ }
+ });
- }
- });
- }
+ }
+ });
}
- });
+ }
+ });
}
}
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 cee9d8d..163b191 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
@@ -285,7 +285,7 @@ public class MetricsTableView extends Table<MetricsTableDataSource> implements R
setCanExpandRecords(true);
setCanExpandMultipleRecords(true);
- setExpansionMode(ExpansionMode.RELATED);
+ setExpansionMode(ExpansionMode.DETAIL_FIELD);
}
@Override
10 years, 11 months
[rhq] modules/common
by John Sanda
modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java | 71 ++--------
1 file changed, 18 insertions(+), 53 deletions(-)
New commits:
commit f24eb1cfcb98ce8c1c4a9edb00453aef60c7e7dd
Author: John Sanda <jsanda(a)redhat.com>
Date: Mon Jul 15 22:06:57 2013 -0400
copy cassandra-jvm.properties on upgrade. we're no longer using cassandra-env.sh.
diff --git a/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java b/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
index 9a6a1c0..2fec2dc 100644
--- a/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
+++ b/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
@@ -25,10 +25,8 @@
package org.rhq.storage.installer;
-import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
-import java.io.FileReader;
import java.io.IOException;
import java.net.InetAddress;
import java.util.ArrayList;
@@ -37,6 +35,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
+import java.util.Properties;
import javax.management.MBeanServerConnection;
import javax.management.ObjectName;
@@ -65,6 +64,7 @@ import org.rhq.cassandra.DeploymentOptions;
import org.rhq.cassandra.DeploymentOptionsFactory;
import org.rhq.cassandra.installer.RMIContextFactory;
import org.rhq.core.util.PropertiesFileUpdate;
+import org.rhq.core.util.StringUtil;
import org.rhq.core.util.exception.ThrowableUtil;
import org.rhq.core.util.file.FileUtil;
@@ -244,24 +244,19 @@ public class StorageInstaller {
deployer.updateFilePerms();
// For upgrades we will copy the existing cassandra.yaml,
- // log4j-server.properties, and cassandra-env.sh file from the existing
+ // log4j-server.properties, and cassandra-jvm.properties from the existing
// storage node installation. Going forward though we need to add support
- // for merging in the existing cassandra.yaml with the new one. We also
- // need to do something about cassandra-env.sh. There is no easy to parse
- // it and merge in changes which is problematic since that is where heap
- // settings and JMX port and other JMV options are specified. Maybe we can
- // replace it with a cassandra-in.sh that is essentially a properties file
- // which we can easily parse and update.
+ // for merging in the existing cassandra.yaml with the new one.
File oldConfDir = new File(existingStorageDir, "conf");
File newConfDir = new File(storageBasedir, "conf");
String cassandraYaml = "cassandra.yaml";
- String cassandraEnv = "cassandra-env.sh";
- File cassandraEnvFile = new File(newConfDir, cassandraEnv);
+ String cassandraJvmProps = "cassandra-jvm.properties";
+ File cassandraJvmPropsFile = new File(newConfDir, cassandraJvmProps);
String log4j = "log4j-server.properties";
replaceFile(new File(oldConfDir, cassandraYaml), new File(newConfDir, cassandraYaml));
- replaceFile(new File(oldConfDir, cassandraEnv), cassandraEnvFile);
+ replaceFile(new File(oldConfDir, cassandraJvmProps), cassandraJvmPropsFile);
replaceFile(new File(oldConfDir, log4j), new File(newConfDir, log4j));
log.info("Finished installing RHQ Storage Node.");
@@ -274,7 +269,7 @@ public class StorageInstaller {
hostname = (String) config.get("listen_address");
- jmxPort = parseJmxPort(cassandraEnvFile);
+ jmxPort = parseJmxPort(cassandraJvmPropsFile);
} else {
if (cmdLine.hasOption("dir")) {
File basedir = new File(cmdLine.getOptionValue("dir"));
@@ -666,56 +661,26 @@ public class StorageInstaller {
}
}
- private int parseJmxPort(File cassandraEnvFile) {
+ private int parseJmxPort(File cassandraJvmOptsFile) {
Integer port = null;
if (isWindows()) {
// TODO
return defaultJmxPort;
} else {
- BufferedReader reader = null;
try {
- reader = new BufferedReader(new FileReader(cassandraEnvFile));
- String line = reader.readLine();
-
- while (line != null) {
- if (line.startsWith("JMX_PORT")) {
- int startIndex = line.indexOf("JMX_PORT=\"") + 1;
- int endIndex = line.lastIndexOf("\"");
-
- if (startIndex == -1 || endIndex == -1) {
- log.error("Failed to parse the JMX port. Make sure that you have the JMX port defined on its "
- + "own line as follows, JMX_PORT=\"<jmx-port>\"");
- throw new RuntimeException("Cannot determine JMX port");
- }
- try {
- port = Integer.parseInt(line.substring(startIndex, endIndex));
- } catch (NumberFormatException e) {
- log.error("The JMX port must be an integer. [" + port + "] is an invalid value");
- throw new RuntimeException("The JMX port has an invalid value");
- }
- return port;
- }
- line = reader.readLine();
+ Properties properties = new Properties();
+ properties.load(new FileInputStream(cassandraJvmOptsFile));
+
+ String jmxPort = properties.getProperty("jmx_port");
+ if (StringUtil.isEmpty(jmxPort)) {
+ log.error("The property [jmx_port] is undefined.");
+ throw new RuntimeException("Cannot determine JMX port");
}
- log.error("Failed to parse the JMX port. Make sure that you have the JMX port defined on its "
- + "own line as follows, JMX_PORT=\"<jmx-port>\"");
- throw new RuntimeException("Cannot determine JMX port");
+
+ return Integer.parseInt(jmxPort);
} catch (IOException e) {
log.error("Failed to parse JMX port. There was an unexpected IO error", e);
throw new RuntimeException("Failed to parse JMX port due to IO error: " + e.getMessage());
- } finally {
- try {
- if (reader != null) {
- reader.close();
- }
- } catch (IOException e) {
- if (log.isDebugEnabled()) {
- log.debug("An error occurred closing the " + BufferedReader.class.getName() + " used to "
- + "parse the JMX port", e);
- } else {
- log.warn("There was error closing the reader used to parse the JMX port: " + e.getMessage());
- }
- }
}
}
}
10 years, 11 months
[rhq] etc/scripts
by John Sanda
etc/scripts/rhq48-storage-patch/rhq48-storage-patch.sh | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
New commits:
commit 27138835d3ac9fb10fe18519fbe441fc1979387e
Author: John Sanda <jsanda(a)redhat.com>
Date: Mon Jul 15 21:47:34 2013 -0400
fixing bug in script
diff --git a/etc/scripts/rhq48-storage-patch/rhq48-storage-patch.sh b/etc/scripts/rhq48-storage-patch/rhq48-storage-patch.sh
index 7c0b88a..33984d1 100755
--- a/etc/scripts/rhq48-storage-patch/rhq48-storage-patch.sh
+++ b/etc/scripts/rhq48-storage-patch/rhq48-storage-patch.sh
@@ -19,6 +19,9 @@ CQL_HOSTNAME=$2
CQL_PORT=$3
JMX_PORT=$4
+export CQLSH_HOST=$2
+export CQL_PORT=$3
+
PATCH="apache-cassandra-1.2.4-patch-1.jar"
# swap out the Cassandra jar file with the patched version
@@ -36,8 +39,6 @@ sleep 3
# run the CQL script
echo "Running CQL script to disable table compression"
-export CQLSH_HOST=$CQLSH_HOST
-export CQL_PORT=$CQL_PORT
$RHQ_SERVER_DIR/rhq-storage/bin/cqlsh -u rhqadmin -p rhqadmin -f ./disable_compression.cql
# rewrite all sstables
10 years, 11 months
[rhq] modules/plugins
by John Sanda
modules/plugins/rhq-storage/src/main/java/org/rhq/plugins/storage/StorageNodeConfigDelegate.java | 69 ++++++++--
1 file changed, 60 insertions(+), 9 deletions(-)
New commits:
commit 34514a874e079e19736bbc0fd71db099a1b9b25a
Author: John Sanda <jsanda(a)redhat.com>
Date: Mon Jul 15 16:23:06 2013 -0400
make parsing of heap options more robust
diff --git a/modules/plugins/rhq-storage/src/main/java/org/rhq/plugins/storage/StorageNodeConfigDelegate.java b/modules/plugins/rhq-storage/src/main/java/org/rhq/plugins/storage/StorageNodeConfigDelegate.java
index a0220ba..8d1771d 100644
--- a/modules/plugins/rhq-storage/src/main/java/org/rhq/plugins/storage/StorageNodeConfigDelegate.java
+++ b/modules/plugins/rhq-storage/src/main/java/org/rhq/plugins/storage/StorageNodeConfigDelegate.java
@@ -32,18 +32,13 @@ public class StorageNodeConfigDelegate implements ConfigurationFacet {
Configuration config = new Configuration();
- String heapMinProp = properties.getProperty("heap_min");
- String heapMaxProp = properties.getProperty("heap_max");
- String heapNewProp = properties.getProperty("heap_new");
- String threadStackSizeProp = properties.getProperty("thread_stack_size");
String heapDumpOnOOMError = properties.getProperty("heap_dump_on_OOMError");
String heapDumpDir = properties.getProperty("heap_dump_dir");
- config.put(new PropertySimple("minHeapSize", heapMinProp.substring(4)));
- config.put(new PropertySimple("maxHeapSize", heapMaxProp.substring(4)));
- config.put(new PropertySimple("heapNewSize", heapNewProp.substring(4)));
- config.put(new PropertySimple("threadStackSize", threadStackSizeProp.substring(4,
- threadStackSizeProp.length() - 1)));
+ config.put(new PropertySimple("minHeapSize", getHeapMinProp(properties)));
+ config.put(new PropertySimple("maxHeapSize", getHeapMaxProp(properties)));
+ config.put(new PropertySimple("heapNewSize", getHeapNewProp(properties)));
+ config.put(new PropertySimple("threadStackSize", getStackSizeProp(properties)));
if (!StringUtil.isEmpty(heapDumpOnOOMError)) {
config.put(new PropertySimple("heapDumpOnOOMError", true));
@@ -61,6 +56,62 @@ public class StorageNodeConfigDelegate implements ConfigurationFacet {
return config;
}
+ private String getHeapMinProp(Properties properties) {
+ String value = properties.getProperty("heap_min");
+
+ if (StringUtil.isEmpty(value)) {
+ return "";
+ }
+
+ if (!value.startsWith("-Xms")) {
+ return value;
+ }
+
+ return value.substring(4);
+ }
+
+ private String getHeapMaxProp(Properties properties) {
+ String value = properties.getProperty("heap_max");
+
+ if (StringUtil.isEmpty(value)) {
+ return "";
+ }
+
+ if (!value.startsWith("-Xmx")) {
+ return value;
+ }
+
+ return value.substring(4);
+ }
+
+ private String getHeapNewProp(Properties properties) {
+ String value = properties.getProperty("heap_new");
+
+ if (StringUtil.isEmpty(value)) {
+ return "";
+ }
+
+ if (!value.startsWith("-Xmn")) {
+ return value;
+ }
+
+ return value.substring(4);
+ }
+
+ private String getStackSizeProp(Properties properties) {
+ String value = properties.getProperty("thread_stack_size");
+
+ if (StringUtil.isEmpty(value)) {
+ return "";
+ }
+
+ if (!(value.startsWith("-Xss") || value.endsWith("k") || value.length() > 5)) {
+ return value;
+ }
+
+ return value.substring(4, value.length() - 1);
+ }
+
@Override
public void updateResourceConfiguration(ConfigurationUpdateReport configurationUpdateReport) {
try {
10 years, 11 months