summaryrefslogtreecommitdiff
path: root/app/controllers/admin
diff options
context:
space:
mode:
authorJosh Frye <joshfng@gmail.com>2016-06-22 10:43:28 -0400
committerJosh Frye <joshfng@gmail.com>2016-06-28 21:35:42 -0400
commit82edef941406eef9e4be12341a064566ac848dce (patch)
tree8cd263d3c9c813c9f1fb3b23245b6f86fd0951b5 /app/controllers/admin
parentebe21acc2a2f0a569e1e10314ac9407024becafb (diff)
downloadgitlab-ce-82edef941406eef9e4be12341a064566ac848dce.tar.gz
Show basic system info on admin panel. Closes #18886
Diffstat (limited to 'app/controllers/admin')
-rw-r--r--app/controllers/admin/system_info_controller.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/controllers/admin/system_info_controller.rb b/app/controllers/admin/system_info_controller.rb
new file mode 100644
index 00000000000..a548f941dc5
--- /dev/null
+++ b/app/controllers/admin/system_info_controller.rb
@@ -0,0 +1,12 @@
+class Admin::SystemInfoController < Admin::ApplicationController
+ def show
+ 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_s('GB')
+ @mem_total = Filesize.from("#{system_info.memory.total_bytes} B").to_s('GB')
+
+ @disk_used = Filesize.from("#{system_info.disks[0].used_bytes} B").to_s('GB')
+ @disk_total = Filesize.from("#{system_info.disks[0].total_bytes} B").to_s('GB')
+ end
+end