]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-9802 add hostname to ES nodes in clustered System Info
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Wed, 4 Oct 2017 08:47:03 +0000 (10:47 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Wed, 4 Oct 2017 13:34:19 +0000 (15:34 +0200)
server/sonar-server/src/main/java/org/sonar/server/platform/monitoring/cluster/SearchNodesInfoLoaderImpl.java
server/sonar-server/src/test/java/org/sonar/server/platform/monitoring/cluster/SearchNodesInfoLoaderImplTest.java

index 08703a608b35d93344d4e2f73bb8c552df5c1ec3..9ed9b9f7d1d9d3147875c3b2e4ec1f86946b72d1 100644 (file)
@@ -54,6 +54,7 @@ public class SearchNodesInfoLoaderImpl implements SearchNodesInfoLoader {
   private static NodeInfo toNodeInfo(NodeStats stat) {
     String nodeName = stat.getNode().getName();
     NodeInfo info = new NodeInfo(nodeName);
+    info.setHost(stat.getHostname());
 
     ProtobufSystemInfo.Section.Builder section = ProtobufSystemInfo.Section.newBuilder();
     section.setName("Search State");
index ebb96e3f6ba735776ad564f402f8011641e0f1a7..0f3caf947e4b47592c7c12fb095502e2468a9e4b 100644 (file)
@@ -42,6 +42,7 @@ public class SearchNodesInfoLoaderImplTest {
     assertThat(nodes).hasSize(1);
     NodeInfo node = nodes.iterator().next();
     assertThat(node.getName()).isNotEmpty();
+    assertThat(node.getHost()).isNotEmpty();
     assertThat(node.getSections()).hasSize(1);
     ProtobufSystemInfo.Section stateSection = node.getSections().get(0);