]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5564 - Added human readable size for Cache sizes
authorStephane Gamard <stephane.gamard@sonarsource.com>
Thu, 16 Oct 2014 14:37:40 +0000 (16:37 +0200)
committerStephane Gamard <stephane.gamard@sonarsource.com>
Thu, 16 Oct 2014 14:39:24 +0000 (16:39 +0200)
server/sonar-web/src/main/webapp/WEB-INF/app/models/server.rb

index 0e1336f16019b178277cc39c28924cc2c1257509..c179f82e6c6b4ec07444296df857a5bff097c2c6 100644 (file)
@@ -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"