diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-06-30 12:56:59 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-06-30 12:56:59 +0000 |
commit | 1c2e7af6afa4be48c4d95e3b5de8005746db9bc7 (patch) | |
tree | f5f5a66a243aad501ad8715a021c161b50005013 /app/controllers/admin | |
parent | 8b675291821455d755fdeef7b2bdd0c99ce0f32f (diff) | |
parent | 98238a27c7b0e5d4c7a674a78c859150966e6f8b (diff) | |
download | gitlab-ce-1c2e7af6afa4be48c4d95e3b5de8005746db9bc7.tar.gz |
Merge branch 'issue-18886' into 'master'
Loop all disks when displaying system info. Closes #18886
See merge request !4983
Diffstat (limited to 'app/controllers/admin')
-rw-r--r-- | app/controllers/admin/system_info_controller.rb | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/app/controllers/admin/system_info_controller.rb b/app/controllers/admin/system_info_controller.rb index 3c67370b667..cc63009cdc0 100644 --- a/app/controllers/admin/system_info_controller.rb +++ b/app/controllers/admin/system_info_controller.rb @@ -1,13 +1,32 @@ class Admin::SystemInfoController < Admin::ApplicationController def show + excluded_mounts = [ + "nobrowse", + "read-only", + "ro" + ] + system_info = Vmstat.snapshot + mounts = Sys::Filesystem.mounts + + @disks = [] + mounts.each do |mount| + options = mount.options.split(', ') + + next unless excluded_mounts.each { |em| break if options.include?(em) } + + disk = Sys::Filesystem.stat(mount.mount_point) + @disks.push({ + bytes_total: disk.bytes_total, + bytes_used: disk.bytes_used, + disk_name: mount.name, + mount_path: disk.path + }) + end @cpus = system_info.cpus.length @mem_used = system_info.memory.active_bytes @mem_total = system_info.memory.total_bytes - - @disk_used = system_info.disks[0].used_bytes - @disk_total = system_info.disks[0].total_bytes end end |