@Override protected void configureModule() { add( CeConfigurationImpl.class, CeTaskLogging.class, CeDatabaseMBeanImpl.class, new JvmStateSection("Compute Engine JVM State"), new JvmPropertiesSection("Compute Engine JVM Properties"), LoggingSection.class); } }
@Test public void should_hide_attributes_without_values() { MemoryMXBean memoryBean = mock(MemoryMXBean.class, Mockito.RETURNS_DEEP_STUBS); when(memoryBean.getHeapMemoryUsage().getCommitted()).thenReturn(-1L); JvmStateSection underTest = new JvmStateSection(PROCESS_NAME); ProtobufSystemInfo.Section section = underTest.toProtobuf(memoryBean); assertThat(section.getAttributesList()).extracting("key").doesNotContain("Heap Committed (MB)"); } }
new JvmStateSection("Web JVM State"), DbSection.class, DbConnectionSection.class,
@Test public void toSystemInfoSection() { JvmStateSection underTest = new JvmStateSection(PROCESS_NAME); ProtobufSystemInfo.Section section = underTest.toProtobuf(); assertThat(section.getName()).isEqualTo(PROCESS_NAME); assertThat(section.getAttributesCount()).isGreaterThan(0); assertThat(section.getAttributesList()).extracting("key") .contains( "Max Memory (MB)", "Free Memory (MB)", "Heap Max (MB)", "System Load Average", "Threads"); }
public static Object[] forStandaloneMode() { return new Object[] { new JvmPropertiesSection("Web JVM Properties"), new JvmStateSection("Web JVM State"), DbSection.class, DbConnectionSection.class, EsStateSection.class, EsIndexesSection.class, LoggingSection.class, PluginsSection.class, SettingsSection.class, StandaloneSystemSection.class, OfficialDistribution.class, StandaloneSystemInfoWriter.class, InfoAction.class }; }
public static Object[] forClusterMode() { return new Object[] { new JvmPropertiesSection("Web JVM Properties"), new JvmStateSection("Web JVM State"), CeQueueGlobalSection.class, DbSection.class, DbConnectionSection.class, EsIndexesSection.class, EsClusterStateSection.class, GlobalSystemSection.class, LoggingSection.class, NodeSystemSection.class, PluginsSection.class, SettingsSection.class, OfficialDistribution.class, ProcessInfoProvider.class, GlobalInfoLoader.class, AppNodesInfoLoaderImpl.class, SearchNodesInfoLoaderImpl.class, ClusterSystemInfoWriter.class, InfoAction.class }; } }
@Override protected void configureModule() { add( CeConfigurationImpl.class, CeLogging.class, CeDatabaseMBeanImpl.class, new JvmStateSection("Compute Engine JVM State"), new JvmPropertiesSection("Compute Engine JVM Properties"), LoggingSection.class); } }