summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjboltz88 <boltz.justin@gmail.com>2017-05-23 01:09:52 -0500
committerjboltz88 <boltz.justin@gmail.com>2017-05-29 15:46:25 -0500
commitf547a473d80288757d8ce8d8d7ba11df616b691d (patch)
treeb8281f3df42506f8ae01722ccedc4a5760800f66
parentad47f2094bf61867d2b5e4c24540c7c5b8a6358d (diff)
downloadgitlab-ce-f547a473d80288757d8ce8d8d7ba11df616b691d.tar.gz
31616-add-uptime-of-gitlab-instance-in-admin-area
-rw-r--r--app/views/admin/system_info/show.html.haml5
-rw-r--r--changelogs/unreleased/31616-add-uptime-of-gitlab-instance-in-admin-area.yml4
-rw-r--r--config/initializers/server_uptime.rb1
-rw-r--r--spec/features/admin/admin_system_info_spec.rb3
4 files changed, 13 insertions, 0 deletions
diff --git a/app/views/admin/system_info/show.html.haml b/app/views/admin/system_info/show.html.haml
index 2e5f120c4e4..9b9559c7fe5 100644
--- a/app/views/admin/system_info/show.html.haml
+++ b/app/views/admin/system_info/show.html.haml
@@ -31,3 +31,8 @@
%h1 #{number_to_human_size(disk[:bytes_used])} / #{number_to_human_size(disk[:bytes_total])}
%p= disk[:disk_name]
%p= disk[:mount_path]
+ .col-sm-4
+ .light-well
+ %h4 Uptime
+ .data
+ %h1= time_ago_with_tooltip(Rails.application.config.booted_at)
diff --git a/changelogs/unreleased/31616-add-uptime-of-gitlab-instance-in-admin-area.yml b/changelogs/unreleased/31616-add-uptime-of-gitlab-instance-in-admin-area.yml
new file mode 100644
index 00000000000..6dc48d6b2d8
--- /dev/null
+++ b/changelogs/unreleased/31616-add-uptime-of-gitlab-instance-in-admin-area.yml
@@ -0,0 +1,4 @@
+---
+title: Add server uptime to System Info page in admin dashboard
+merge_request: 11590
+author: Justin Boltz
diff --git a/config/initializers/server_uptime.rb b/config/initializers/server_uptime.rb
new file mode 100644
index 00000000000..46bf242e143
--- /dev/null
+++ b/config/initializers/server_uptime.rb
@@ -0,0 +1 @@
+Rails.application.config.booted_at = Time.now
diff --git a/spec/features/admin/admin_system_info_spec.rb b/spec/features/admin/admin_system_info_spec.rb
index 1df972843e2..15482347886 100644
--- a/spec/features/admin/admin_system_info_spec.rb
+++ b/spec/features/admin/admin_system_info_spec.rb
@@ -20,6 +20,7 @@ describe 'Admin System Info' do
expect(page).to have_content 'CPU 2 cores'
expect(page).to have_content 'Memory 4 GB / 16 GB'
expect(page).to have_content 'Disks'
+ expect(page).to have_content 'Uptime'
end
end
@@ -34,6 +35,7 @@ describe 'Admin System Info' do
expect(page).to have_content 'CPU Unable to collect CPU info'
expect(page).to have_content 'Memory 4 GB / 16 GB'
expect(page).to have_content 'Disks'
+ expect(page).to have_content 'Uptime'
end
end
@@ -48,6 +50,7 @@ describe 'Admin System Info' do
expect(page).to have_content 'CPU 2 cores'
expect(page).to have_content 'Memory Unable to collect memory info'
expect(page).to have_content 'Disks'
+ expect(page).to have_content 'Uptime'
end
end
end