aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src
diff options
context:
space:
mode:
authorStephane Gamard <stephane.gamard@sonarsource.com>2014-10-16 16:37:40 +0200
committerStephane Gamard <stephane.gamard@sonarsource.com>2014-10-16 16:39:24 +0200
commit84c7aabe6ea304acaa96f14911b712bab02b51b8 (patch)
tree2278a835cdc55bbf7fc9d8b81adec6b1e5727f0d /server/sonar-web/src
parenta877b71af86ebe09be14042400f1ec9bc10a2ff1 (diff)
downloadsonarqube-84c7aabe6ea304acaa96f14911b712bab02b51b8.tar.gz
sonarqube-84c7aabe6ea304acaa96f14911b712bab02b51b8.zip
SONAR-5564 - Added human readable size for Cache sizes
Diffstat (limited to 'server/sonar-web/src')
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/app/models/server.rb6
1 files changed, 4 insertions, 2 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 0e1336f1601..c179f82e6c6 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
@@ -17,6 +17,8 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
+include ActionView::Helpers::NumberHelper
+
class Server
def info
@@ -106,8 +108,8 @@ class Server
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() }
- add_property(node_info, 'Field Cache Size') { "#{ format_double(node_health.getFieldCacheMemory() / 1000.0)} KB" }
- add_property(node_info, 'Filter Cache Size') { "#{ format_double(node_health.getFilterCacheMemory() / 1000.0)} KB" }
+ add_property(node_info, 'Field Cache Size') { number_to_human_size(node_health.getFieldCacheMemory()) }
+ add_property(node_info, 'Filter Cache Size') { number_to_human_size(node_health.getFilterCacheMemory()) }
node_health.getPerformanceStats().each do |performance|
message = performance.getStatus() == "ERROR" || performance.getStatus() == "WARN" ? "- #{performance.getStatus()}: #{performance.getMessage()}" : "";
if performance.getName().include? "Eviction"