aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2017-10-04 10:47:03 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2017-10-04 15:34:19 +0200
commit92509d3e37cc6b5f857e255e861854f0006223c0 (patch)
treec3f6a8dc77c6c254a588bf9183969843a303fdff /server
parentcfbf9f6d521245460c515c77833823a8b56d0ef9 (diff)
downloadsonarqube-92509d3e37cc6b5f857e255e861854f0006223c0.tar.gz
sonarqube-92509d3e37cc6b5f857e255e861854f0006223c0.zip
SONAR-9802 add hostname to ES nodes in clustered System Info
Diffstat (limited to 'server')
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/platform/monitoring/cluster/SearchNodesInfoLoaderImpl.java1
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/platform/monitoring/cluster/SearchNodesInfoLoaderImplTest.java1
2 files changed, 2 insertions, 0 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/platform/monitoring/cluster/SearchNodesInfoLoaderImpl.java b/server/sonar-server/src/main/java/org/sonar/server/platform/monitoring/cluster/SearchNodesInfoLoaderImpl.java
index 08703a608b3..9ed9b9f7d1d 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/platform/monitoring/cluster/SearchNodesInfoLoaderImpl.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/platform/monitoring/cluster/SearchNodesInfoLoaderImpl.java
@@ -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");
diff --git a/server/sonar-server/src/test/java/org/sonar/server/platform/monitoring/cluster/SearchNodesInfoLoaderImplTest.java b/server/sonar-server/src/test/java/org/sonar/server/platform/monitoring/cluster/SearchNodesInfoLoaderImplTest.java
index ebb96e3f6ba..0f3caf947e4 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/platform/monitoring/cluster/SearchNodesInfoLoaderImplTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/platform/monitoring/cluster/SearchNodesInfoLoaderImplTest.java
@@ -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);