diff --git a/Gemfile b/Gemfile index ffc3514a198fd4290ccf2eea1291844983aa2227..a2386770992b5fd774f6e398b94c25765798be11 100644 --- a/Gemfile +++ b/Gemfile @@ -349,4 +349,3 @@ gem 'health_check', '~> 1.5.1' # System information gem 'vmstat', '~> 2.1.0' -gem 'filesize', '~> 0.1.1' diff --git a/Gemfile.lock b/Gemfile.lock index afc1dce1710f3a01291384bedeb3740b95fb15d3..c1d2f1fdf5a129e4dc90ede0b840b41c964bc17e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -207,7 +207,6 @@ GEM multi_json ffaker (2.0.0) ffi (1.9.10) - filesize (0.1.1) flay (2.6.1) ruby_parser (~> 3.0) sexp_processor (~> 4.0) @@ -851,7 +850,6 @@ DEPENDENCIES email_spec (~> 1.6.0) factory_girl_rails (~> 4.6.0) ffaker (~> 2.0.0) - filesize (~> 0.1.1) flay flog fog-aws (~> 0.9) diff --git a/app/controllers/admin/system_info_controller.rb b/app/controllers/admin/system_info_controller.rb index ab05ed2612a759aae502796c40fd5d77445415b2..b7333139c57a8dc3f37e973640a6ab0a505a6f9d 100644 --- a/app/controllers/admin/system_info_controller.rb +++ b/app/controllers/admin/system_info_controller.rb @@ -3,10 +3,10 @@ class Admin::SystemInfoController < Admin::ApplicationController system_info = Vmstat.snapshot @load = system_info.load_average.collect { |v| v.round(2) }.join(', ') - @mem_used = Filesize.from("#{system_info.memory.active_bytes} B").to_f('GB').round - @mem_total = Filesize.from("#{system_info.memory.total_bytes} B").to_f('GB').round + @mem_used = system_info.memory.active_bytes + @mem_total = system_info.memory.total_bytes - @disk_used = Filesize.from("#{system_info.disks[0].used_bytes} B").to_f('GB').round - @disk_total = Filesize.from("#{system_info.disks[0].total_bytes} B").to_f('GB').round + @disk_used = system_info.disks[0].used_bytes + @disk_total = system_info.disks[0].total_bytes end end diff --git a/app/views/admin/system_info/show.html.haml b/app/views/admin/system_info/show.html.haml index 316a94f4d4166eae2601a4aef0f2e50a3baf8936..542498cfb22982f022ff364b943bb86a7cf72a4c 100644 --- a/app/views/admin/system_info/show.html.haml +++ b/app/views/admin/system_info/show.html.haml @@ -14,9 +14,9 @@ .light-well %h4 Memory .data - %h1= "#{@mem_used}GB / #{@mem_total}GB" + %h1= "#{number_to_human_size(@mem_used)} / #{number_to_human_size(@mem_total)}" .col-sm-4 .light-well %h4 Disk .data - %h1= "#{@disk_used}GB / #{@disk_total}GB" + %h1= "#{number_to_human_size(@disk_used)} / #{number_to_human_size(@disk_total)}" diff --git a/app/views/layouts/nav/_admin.html.haml b/app/views/layouts/nav/_admin.html.haml index e6c5ec06252a75fd48b976338911fef62ebe0b86..5ee8772882ec68a9e31a00c7c06344cc79da6865 100644 --- a/app/views/layouts/nav/_admin.html.haml +++ b/app/views/layouts/nav/_admin.html.haml @@ -10,7 +10,7 @@ %span Overview = nav_link(controller: %w(system_info background_jobs logs health_check)) do - = link_to admin_background_jobs_path, title: 'Monitoring' do + = link_to admin_system_info_path, title: 'Monitoring' do %span Monitoring = nav_link(controller: :broadcast_messages) do