Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Łukasz Nowak
slapos.core
Commits
6f14fd1e
Commit
6f14fd1e
authored
Sep 03, 2015
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup! psutil >= 2.0.0 is required because of API changes introduced in this version.
parent
49be11d5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
slapos/collect/reporter.py
slapos/collect/reporter.py
+1
-1
slapos/collect/snapshot.py
slapos/collect/snapshot.py
+6
-6
No files found.
slapos/collect/reporter.py
View file @
6f14fd1e
...
...
@@ -191,7 +191,7 @@ class ConsumptionReport(object):
reference
=
self
.
computer_id
,
category
=
""
)
core_amount
=
psutil
.
NUM_CPUS
core_amount
=
psutil
.
cpu_count
()
for
user
in
self
.
user_list
:
partition_cpu_load_percent
=
self
.
_getPartitionCPULoadAverage
(
user
,
date_scope
)
if
partition_cpu_load_percent
is
not
None
:
...
...
slapos/collect/snapshot.py
View file @
6f14fd1e
...
...
@@ -52,15 +52,15 @@ class ProcessSnapshot(_Snapshot):
# Save full command line from the process.
self
.
process
=
"%s-%s"
%
(
process
.
pid
,
process
.
create_time
())
# CPU percentage, we will have to get actual absolute value
self
.
cpu_percent
=
self
.
process_object
.
get_
cpu_percent
(
None
)
self
.
cpu_percent
=
self
.
process_object
.
cpu_percent
(
None
)
# CPU Time
self
.
cpu_time
=
sum
(
process
.
get_
cpu_times
())
self
.
cpu_time
=
sum
(
process
.
cpu_times
())
# Thread number, might not be really relevant
self
.
cpu_num_threads
=
process
.
get_num_threads
()
self
.
cpu_num_threads
=
process
.
num_threads
()
# Memory percentage
self
.
memory_percent
=
process
.
get_
memory_percent
()
self
.
memory_percent
=
process
.
memory_percent
()
# Resident Set Size, virtual memory size is not accouned for
self
.
memory_rss
=
process
.
get_
memory_info
()[
0
]
self
.
memory_rss
=
process
.
memory_info
()[
0
]
# Byte count, Read and write. OSX NOT SUPPORTED
self
.
io_rw_counter
=
ui_counter_list
[
2
]
+
ui_counter_list
[
3
]
# Read + write IO cycles
...
...
@@ -69,7 +69,7 @@ class ProcessSnapshot(_Snapshot):
def
update_cpu_percent
(
self
):
if
self
.
process_object
.
is_running
():
# CPU percentage, we will have to get actual absolute value
self
.
cpu_percent
=
self
.
process_object
.
get_
cpu_percent
()
self
.
cpu_percent
=
self
.
process_object
.
cpu_percent
()
class
SystemSnapshot
(
_Snapshot
):
""" Take a snapshot from current system usage
...
...
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