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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
242aa5bd
Commit
242aa5bd
authored
Jun 23, 2016
by
Josh Frye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Round figures for system info
parent
a8cf89a7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
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
No files found.
app/controllers/admin/system_info_controller.rb
View file @
242aa5bd
...
@@ -3,10 +3,10 @@ class Admin::SystemInfoController < Admin::ApplicationController
...
@@ -3,10 +3,10 @@ class Admin::SystemInfoController < Admin::ApplicationController
system_info
=
Vmstat
.
snapshot
system_info
=
Vmstat
.
snapshot
@load
=
system_info
.
load_average
.
collect
{
|
v
|
v
.
round
(
2
)
}.
join
(
', '
)
@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_used
=
Filesize
.
from
(
"
#{
system_info
.
memory
.
active_bytes
}
B"
).
to_
f
(
'GB'
).
round
@mem_total
=
Filesize
.
from
(
"
#{
system_info
.
memory
.
total_bytes
}
B"
).
to_
s
(
'GB'
)
@mem_total
=
Filesize
.
from
(
"
#{
system_info
.
memory
.
total_bytes
}
B"
).
to_
f
(
'GB'
).
round
@disk_used
=
Filesize
.
from
(
"
#{
system_info
.
disks
[
0
].
used_bytes
}
B"
).
to_
s
(
'GB'
)
@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_
s
(
'GB'
)
@disk_total
=
Filesize
.
from
(
"
#{
system_info
.
disks
[
0
].
total_bytes
}
B"
).
to_
f
(
'GB'
).
round
end
end
end
end
app/views/admin/system_info/show.html.haml
View file @
242aa5bd
...
@@ -14,9 +14,9 @@
...
@@ -14,9 +14,9 @@
.light-well
.light-well
%h4
Memory
%h4
Memory
.data
.data
%h1
=
"
#{
@mem_used
}
/
#{
@mem_total
}
"
%h1
=
"
#{
@mem_used
}
GB /
#{
@mem_total
}
GB
"
.col-sm-4
.col-sm-4
.light-well
.light-well
%h4
Disk
%h4
Disk
.data
.data
%h1
=
"
#{
@disk_used
}
/
#{
@disk_total
}
"
%h1
=
"
#{
@disk_used
}
GB /
#{
@disk_total
}
GB
"
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