aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web
diff options
context:
space:
mode:
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2014-08-25 17:57:47 +0200
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2014-08-26 14:55:04 +0200
commit68e9e5a01dfa70cfee42e98daba7bc1134566a44 (patch)
treee36514b73d0184f350bdcd4fd0b9d9d77c765f25 /server/sonar-web
parent5bba55cd38c983e09767246e777d8d317942ab5d (diff)
downloadsonarqube-68e9e5a01dfa70cfee42e98daba7bc1134566a44.tar.gz
sonarqube-68e9e5a01dfa70cfee42e98daba7bc1134566a44.zip
SONAR-5484 Add detailed search information per node
Diffstat (limited to 'server/sonar-web')
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/app/models/server.rb30
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/app/views/system/index.html.erb25
2 files changed, 43 insertions, 12 deletions
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/models/server.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/models/server.rb
index e33a68466ea..d1116ecf15c 100644
--- a/server/sonar-web/src/main/webapp/WEB-INF/app/models/server.rb
+++ b/server/sonar-web/src/main/webapp/WEB-INF/app/models/server.rb
@@ -76,17 +76,12 @@ class Server
sonar_info
end
- def search_info
+ def cluster_info
search_info=[]
search_health = Java::OrgSonarServerPlatform::Platform.component(Java::OrgSonarServerSearch::SearchHealth.java_class)
- node_health = search_health.getNodeHealth()
+ node_health = search_health.getClusterHealth()
add_property(search_info, 'Cluster State') { node_health.isClusterAvailable() ? 'Available' : 'Unavailable' }
- add_property(search_info, 'JVM Heap Usage') { node_health.getJvmHeapUsedPercent() }
- add_property(search_info, 'JVM Threads') { node_health.getJvmThreads() }
- add_property(search_info, 'JVM Uptime') { Internal.i18n.ageFromNow(node_health.getJvmUpSince()) }
- add_property(search_info, 'Disk Usage') { node_health.getFsUsedPercent() }
- add_property(search_info, 'Open Files') { node_health.getOpenFiles() }
- add_property(search_info, 'CPU Load Average') { node_health.getProcessCpuPercent() }
+ add_property(search_info, 'Number of Nodes') { node_health.getNumberOfNodes() }
search_health.getIndexHealth().each do |name, index_health|
add_property(search_info, "#{name} - Document Count") { index_health.getDocumentCount() }
@@ -97,6 +92,25 @@ class Server
search_info
end
+ def nodes_info
+ nodes_info=[]
+ search_health = Java::OrgSonarServerPlatform::Platform.component(Java::OrgSonarServerSearch::SearchHealth.java_class)
+ search_health.getNodesHealth().each do |name, node_health|
+ node_info=[]
+ add_property(node_info, 'Node Name') { name }
+ add_property(node_info, 'Node Type') { node_health.isMaster() ? 'Master' : 'Slave' }
+ add_property(node_info, 'JVM Heap Usage') { node_health.getJvmHeapUsedPercent() }
+ add_property(node_info, 'JVM Threads') { node_health.getJvmThreads() }
+ add_property(node_info, 'JVM Uptime') { Internal.i18n.ageFromNow(node_health.getJvmUpSince()) }
+ add_property(node_info, 'Disk Usage') { node_health.getFsUsedPercent() }
+ add_property(node_info, 'Open Files') { node_health.getOpenFiles() }
+ add_property(node_info, 'CPU Load Average') { node_health.getProcessCpuPercent() }
+ nodes_info.push(node_info)
+ end
+
+ nodes_info
+ end
+
def sonar_plugins
sonar_plugins=[]
Java::OrgSonarServerUi::JRubyFacade.getInstance().getPluginsMetadata().to_a.select { |plugin| !plugin.isCore() }.sort.each do |plugin|
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/system/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/system/index.html.erb
index 5449aed0585..2916e4bcc7d 100644
--- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/system/index.html.erb
+++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/system/index.html.erb
@@ -60,21 +60,38 @@
<br/>
-<table class="data width100" id="search_info">
+<table class="data width100" id="cluster_info">
<thead>
<tr>
- <th colspan="2"><h2>Search Info</h2></th>
+ <th colspan="2"><h2>Search Info - Cluster</h2></th>
</tr>
</thead>
<tbody>
- <% @server.search_info.each do |data| %>
- <%= render :partial => 'row', :locals => {:title => data[0], :value => data[1], :name => 'search' } %>
+ <% @server.cluster_info.each do |data| %>
+ <%= render :partial => 'row', :locals => {:title => data[0], :value => data[1], :name => 'cluster' } %>
<% end %>
<tbody>
</table>
<br/>
+<% @server.nodes_info.each do |node_info| -%>
+<table class="data width100" id="cluster_info<%= node_info[0][1] -%>">
+<thead>
+ <tr>
+ <th colspan="2"><h2>Search Info - <%= node_info[0][1] -%></h2></th>
+ </tr>
+</thead>
+<tbody>
+ <% node_info.drop(1).each do |data| %>
+ <%= render :partial => 'row', :locals => {:title => data[0], :value => data[1], :name => 'node' } %>
+ <% end %>
+<tbody>
+</table>
+
+<br/>
+<% end -%>
+
<table class="data width100" id="memory">
<thead>
<tr>