Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
13ba3bd4
Commit
13ba3bd4
authored
Jun 23, 2016
by
Josh Frye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use number_to_human_size for system info and remove dependency on Filesize gem.
parent
242aa5bd
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
10 deletions
+7
-10
Gemfile
Gemfile
+0
-1
Gemfile.lock
Gemfile.lock
+0
-2
app/controllers/admin/system_info_controller.rb
app/controllers/admin/system_info_controller.rb
+4
-4
app/views/admin/system_info/show.html.haml
app/views/admin/system_info/show.html.haml
+2
-2
app/views/layouts/nav/_admin.html.haml
app/views/layouts/nav/_admin.html.haml
+1
-1
No files found.
Gemfile
View file @
13ba3bd4
...
...
@@ -349,4 +349,3 @@ gem 'health_check', '~> 1.5.1'
# System information
gem
'
vmstat
'
,
'~> 2.1.0'
gem
'
filesize
'
,
'~> 0.1.1'
Gemfile.lock
View file @
13ba3bd4
...
...
@@ -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)
...
...
app/controllers/admin/system_info_controller.rb
View file @
13ba3bd4
...
...
@@ -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
app/views/admin/system_info/show.html.haml
View file @
13ba3bd4
...
...
@@ -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
)
}
"
app/views/layouts/nav/_admin.html.haml
View file @
13ba3bd4
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment