From 7459c00588580ae30d4891e8a22213150eb69ca1 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Mon, 25 Sep 2017 22:45:22 +0200 Subject: [PATCH] SONAR-9802 add section "CE Logging" to standalone mode of api/system/info --- .../sonar-ce/src/main/java/org/sonar/ce/CeQueueModule.java | 2 ++ .../org/sonar/ce/container/ComputeEngineContainerImpl.java | 4 +--- .../sonar/ce/container/ComputeEngineContainerImplTest.java | 2 +- .../server/platform/monitoring/StandaloneSystemSection.java | 2 -- .../server/platform/monitoring/WebSystemInfoModule.java | 1 + .../platform/monitoring/StandaloneSystemSectionTest.java | 6 ------ 6 files changed, 5 insertions(+), 12 deletions(-) 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 2811aa16c44..f1776dd8c78 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 @@ -26,6 +26,7 @@ import org.sonar.ce.queue.InternalCeQueueImpl; import org.sonar.core.platform.Module; import org.sonar.process.systeminfo.JvmPropertiesSection; import org.sonar.process.systeminfo.JvmStateSection; +import org.sonar.server.platform.monitoring.cluster.LoggingSection; public class CeQueueModule extends Module { @Override @@ -39,6 +40,7 @@ public class CeQueueModule extends Module { CeTasksMBeanImpl.class, new JvmStateSection("Compute Engine JVM State"), new JvmPropertiesSection("Compute Engine JVM Properties"), + LoggingSection.class, // 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 3cf5f769c7f..9d777bc0e7d 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 @@ -127,7 +127,6 @@ 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.DbSection; -import org.sonar.server.platform.monitoring.cluster.LoggingSection; import org.sonar.server.platform.monitoring.cluster.ProcessInfoProvider; import org.sonar.server.plugins.InstalledPluginReferentialFactory; import org.sonar.server.plugins.ServerExtensionInstaller; @@ -431,8 +430,7 @@ public class ComputeEngineContainerImpl implements ComputeEngineContainer { // system info DbSection.class, - ProcessInfoProvider.class, - LoggingSection.class); + ProcessInfoProvider.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 c10b6f94c6d..9f4b1ac07e1 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 - + 6 // content of CeQueueModule + + 7 // content of CeQueueModule + 4 // content of CeHttpModule + 3 // content of CeTaskCommonsModule + 4 // content of ProjectAnalysisTaskModule diff --git a/server/sonar-server/src/main/java/org/sonar/server/platform/monitoring/StandaloneSystemSection.java b/server/sonar-server/src/main/java/org/sonar/server/platform/monitoring/StandaloneSystemSection.java index 799fcbb4023..90f8b838bd6 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/platform/monitoring/StandaloneSystemSection.java +++ b/server/sonar-server/src/main/java/org/sonar/server/platform/monitoring/StandaloneSystemSection.java @@ -129,8 +129,6 @@ public class StandaloneSystemSection extends BaseSectionMBean implements SystemS setAttribute(protobuf, "Home Dir", config.get(ProcessProperties.PATH_HOME).orElse(null)); setAttribute(protobuf, "Data Dir", config.get(ProcessProperties.PATH_DATA).orElse(null)); setAttribute(protobuf, "Temp Dir", config.get(ProcessProperties.PATH_TEMP).orElse(null)); - setAttribute(protobuf, "Logs Dir", config.get(ProcessProperties.PATH_LOGS).orElse(null)); - setAttribute(protobuf, "Logs Level", getLogLevel()); setAttribute(protobuf, "Processors", Runtime.getRuntime().availableProcessors()); return protobuf.build(); } diff --git a/server/sonar-server/src/main/java/org/sonar/server/platform/monitoring/WebSystemInfoModule.java b/server/sonar-server/src/main/java/org/sonar/server/platform/monitoring/WebSystemInfoModule.java index 9335402242a..a8eb7a8a5dc 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/platform/monitoring/WebSystemInfoModule.java +++ b/server/sonar-server/src/main/java/org/sonar/server/platform/monitoring/WebSystemInfoModule.java @@ -46,6 +46,7 @@ public class WebSystemInfoModule { DbConnectionSection.class, EsStateSection.class, EsIndexesSection.class, + LoggingSection.class, PluginsSection.class, SettingsSection.class, StandaloneSystemSection.class, diff --git a/server/sonar-server/src/test/java/org/sonar/server/platform/monitoring/StandaloneSystemSectionTest.java b/server/sonar-server/src/test/java/org/sonar/server/platform/monitoring/StandaloneSystemSectionTest.java index 33fdb132a4c..50730c7a928 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/platform/monitoring/StandaloneSystemSectionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/platform/monitoring/StandaloneSystemSectionTest.java @@ -123,12 +123,6 @@ public class StandaloneSystemSectionTest { assertThatAttributeIs(protobuf, "Official Distribution", false); } - @Test - public void get_log_level() throws Exception { - ProtobufSystemInfo.Section protobuf = underTest.toProtobuf(); - assertThatAttributeIs(protobuf, "Logs Level", "DEBUG"); - } - @Test public void get_realm() throws Exception { SecurityRealm realm = mock(SecurityRealm.class); -- 2.39.5