From 50a29c569f8448a939877de1918ab3ff937366b8 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 19 Sep 2017 22:12:00 +0200 Subject: [PATCH] SONAR-9802 complete system info page --- .../main/java/org/sonar/ce/CeQueueModule.java | 6 +- .../container/ComputeEngineContainerImpl.java | 14 +- .../ComputeEngineContainerImplTest.java | 2 +- server/sonar-main/pom.xml | 2 + server/sonar-process/pom.xml | 1 + .../cluster/hz/DistributedAnswerTest.java | 55 ++++ .../cluster/StartableHazelcastMember.java | 9 +- .../sonar/server/health/ClusterHealth.java | 7 + .../platform/monitoring/EsStateSection.java | 46 ++-- .../monitoring/StandaloneSystemSection.java | 9 +- .../monitoring/WebSystemInfoModule.java | 8 +- .../cluster/AppNodesInfoLoaderImpl.java | 9 +- .../cluster/GlobalSystemSection.java | 10 +- .../monitoring/cluster/LoggingSection.java | 55 ++++ .../platform/monitoring/cluster/NodeInfo.java | 39 ++- .../monitoring/cluster/NodeSystemSection.java | 16 +- .../cluster/SearchNodesInfoLoader.java} | 25 +- .../cluster/SearchNodesInfoLoaderImpl.java | 66 +++++ .../platformlevel/PlatformLevel4.java | 2 - .../server/platform/ws/BaseInfoWsAction.java | 101 ++++++++ .../server/platform/ws/ClusterInfoAction.java | 238 ++++-------------- .../sonar/server/platform/ws/InfoAction.java | 78 ++---- .../platform/ws/StandaloneInfoAction.java | 168 ------------- .../cluster/StartableHazelcastMemberTest.java | 106 ++++++++ .../server/health/ClusterHealthTest.java | 26 ++ .../StandaloneSystemSectionTest.java | 19 +- .../server/platform/ws/InfoActionTest.java | 6 +- .../server/platform/ws/SystemWsTest.java | 7 +- server/sonar-web/src/main/js/api/system.ts | 23 +- .../js/apps/system/__tests__/utils-test.ts | 21 +- .../main/js/apps/system/components/App.tsx | 14 +- .../system/components/ChangeLogLevelForm.tsx | 5 +- .../system/components/ClusterSysInfos.tsx | 2 +- .../system/components/StandaloneSysInfos.tsx | 6 +- .../__tests__/ClusterSysInfos-test.tsx | 53 +++- .../__tests__/StandaloneSysInfos-test.tsx | 16 +- .../ChangeLogLevelForm-test.tsx.snap | 4 +- .../ClusterSysInfos-test.tsx.snap | 23 +- .../StandaloneSysInfos-test.tsx.snap | 18 +- .../components/info-items/HealthCard.tsx | 4 +- .../components/info-items/HealthCauseItem.tsx | 6 +- .../components/info-items/HealthItem.tsx | 4 +- .../info-items/__tests__/HealthCard-test.tsx | 2 +- .../__tests__/HealthCauseItem-test.tsx | 6 +- .../info-items/__tests__/HealthItem-test.tsx | 13 +- .../__snapshots__/HealthCard-test.tsx.snap | 12 +- .../__snapshots__/HealthItem-test.tsx.snap | 18 +- .../src/main/js/apps/system/utils.ts | 140 ++++++----- .../js/components/common/StatusIndicator.css | 2 +- .../org/sonarqube/pageobjects/Navigation.java | 4 + .../sonarqube/pageobjects/SystemInfoPage.java | 44 ++++ .../pageobjects/SystemInfoPageItem.java | 87 +++++++ .../sonarqube/tests/cluster/ClusterTest.java | 2 +- .../tests/serverSystem/SystemInfoTest.java | 35 ++- .../tests/user/RealmAuthenticationTest.java | 8 +- .../ServerSystemTest/system_info.html | 80 ------ .../system-info.html | 44 ---- 57 files changed, 968 insertions(+), 858 deletions(-) create mode 100644 server/sonar-server/src/main/java/org/sonar/server/platform/monitoring/cluster/LoggingSection.java rename server/{sonar-ce/src/main/java/org/sonar/ce/monitoring/CeSystemInfoModule.java => sonar-server/src/main/java/org/sonar/server/platform/monitoring/cluster/SearchNodesInfoLoader.java} (57%) create mode 100644 server/sonar-server/src/main/java/org/sonar/server/platform/monitoring/cluster/SearchNodesInfoLoaderImpl.java create mode 100644 server/sonar-server/src/main/java/org/sonar/server/platform/ws/BaseInfoWsAction.java delete mode 100644 server/sonar-server/src/main/java/org/sonar/server/platform/ws/StandaloneInfoAction.java create mode 100644 server/sonar-server/src/test/java/org/sonar/server/cluster/StartableHazelcastMemberTest.java create mode 100644 tests/src/test/java/org/sonarqube/pageobjects/SystemInfoPage.java create mode 100644 tests/src/test/java/org/sonarqube/pageobjects/SystemInfoPageItem.java delete mode 100644 tests/src/test/resources/serverSystem/ServerSystemTest/system_info.html delete mode 100644 tests/src/test/resources/user/ExternalAuthenticationTest/system-info.html diff --git a/server/sonar-ce/src/main/java/org/sonar/ce/CeQueueModule.java b/server/sonar-ce/src/main/java/org/sonar/ce/CeQueueModule.java index d8f37cd5e11..2811aa16c44 100644 --- a/server/sonar-ce/src/main/java/org/sonar/ce/CeQueueModule.java +++ b/server/sonar-ce/src/main/java/org/sonar/ce/CeQueueModule.java @@ -24,6 +24,8 @@ import org.sonar.ce.monitoring.CeTasksMBeanImpl; import org.sonar.ce.queue.CeQueueInitializer; import org.sonar.ce.queue.InternalCeQueueImpl; import org.sonar.core.platform.Module; +import org.sonar.process.systeminfo.JvmPropertiesSection; +import org.sonar.process.systeminfo.JvmStateSection; public class CeQueueModule extends Module { @Override @@ -35,7 +37,9 @@ public class CeQueueModule extends Module { // queue monitoring CEQueueStatusImpl.class, CeTasksMBeanImpl.class, - + new JvmStateSection("Compute Engine JVM State"), + new JvmPropertiesSection("Compute Engine JVM Properties"), + // init queue state and queue processing CeQueueInitializer.class); } diff --git a/server/sonar-ce/src/main/java/org/sonar/ce/container/ComputeEngineContainerImpl.java b/server/sonar-ce/src/main/java/org/sonar/ce/container/ComputeEngineContainerImpl.java index 79f042caf3d..b62dca5b430 100644 --- a/server/sonar-ce/src/main/java/org/sonar/ce/container/ComputeEngineContainerImpl.java +++ b/server/sonar-ce/src/main/java/org/sonar/ce/container/ComputeEngineContainerImpl.java @@ -49,7 +49,6 @@ import org.sonar.ce.StandaloneCeDistributedInformation; import org.sonar.ce.cleaning.CeCleaningModule; import org.sonar.ce.db.ReadOnlyPropertiesDao; import org.sonar.ce.log.CeProcessLogging; -import org.sonar.ce.monitoring.CeSystemInfoModule; import org.sonar.ce.platform.ComputeEngineExtensionInstaller; import org.sonar.ce.queue.CeQueueCleaner; import org.sonar.ce.queue.PurgeCeActivities; @@ -127,6 +126,9 @@ import org.sonar.server.platform.UrlSettings; import org.sonar.server.platform.WebServerImpl; import org.sonar.server.platform.db.migration.MigrationConfigurationModule; import org.sonar.server.platform.db.migration.version.DatabaseVersion; +import org.sonar.server.platform.monitoring.DatabaseSection; +import org.sonar.server.platform.monitoring.cluster.ProcessInfoProvider; +import org.sonar.server.platform.monitoring.cluster.LoggingSection; import org.sonar.server.plugins.InstalledPluginReferentialFactory; import org.sonar.server.plugins.ServerExtensionInstaller; import org.sonar.server.plugins.privileged.PrivilegedPluginsBootstraper; @@ -423,8 +425,14 @@ public class ComputeEngineContainerImpl implements ComputeEngineContainer { if (props.valueAsBoolean(ProcessProperties.CLUSTER_ENABLED)) { container.add( StartableHazelcastMember.class, - CeDistributedInformationImpl.class); - container.add(CeSystemInfoModule.forClusterMode()); + + // system health + CeDistributedInformationImpl.class, + + // system info + DatabaseSection.class, + ProcessInfoProvider.class, + LoggingSection.class); } else { container.add(StandaloneCeDistributedInformation.class); } diff --git a/server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java b/server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java index 640b8e76c43..4cf1cac4434 100644 --- a/server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java +++ b/server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java @@ -131,7 +131,7 @@ public class ComputeEngineContainerImplTest { CONTAINER_ITSELF + 73 // level 4 + 4 // content of CeConfigurationModule - + 4 // content of CeQueueModule + + 6 // content of CeQueueModule + 4 // content of CeHttpModule + 3 // content of CeTaskCommonsModule + 4 // content of ProjectAnalysisTaskModule diff --git a/server/sonar-main/pom.xml b/server/sonar-main/pom.xml index 27e46c81cfb..eba72bb7f62 100644 --- a/server/sonar-main/pom.xml +++ b/server/sonar-main/pom.xml @@ -12,6 +12,8 @@ sonar-main SonarQube :: Main Process + Server process used to bootstrap Elasticsearch, Web Server and + Compute Engine processes. Could be merged with sonar-application.