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
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Rafael Monnerat
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
Show 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):
...
@@ -191,7 +191,7 @@ class ConsumptionReport(object):
reference
=
self
.
computer_id
,
reference
=
self
.
computer_id
,
category
=
""
)
category
=
""
)
core_amount
=
psutil
.
NUM_CPUS
core_amount
=
psutil
.
cpu_count
()
for
user
in
self
.
user_list
:
for
user
in
self
.
user_list
:
partition_cpu_load_percent
=
self
.
_getPartitionCPULoadAverage
(
user
,
date_scope
)
partition_cpu_load_percent
=
self
.
_getPartitionCPULoadAverage
(
user
,
date_scope
)
if
partition_cpu_load_percent
is
not
None
:
if
partition_cpu_load_percent
is
not
None
:
...
...
slapos/collect/snapshot.py
View file @
6f14fd1e
...
@@ -52,15 +52,15 @@ class ProcessSnapshot(_Snapshot):
...
@@ -52,15 +52,15 @@ class ProcessSnapshot(_Snapshot):
# Save full command line from the process.
# Save full command line from the process.
self
.
process
=
"%s-%s"
%
(
process
.
pid
,
process
.
create_time
())
self
.
process
=
"%s-%s"
%
(
process
.
pid
,
process
.
create_time
())
# CPU percentage, we will have to get actual absolute value
# 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
# CPU Time
self
.
cpu_time
=
sum
(
process
.
get_
cpu_times
())
self
.
cpu_time
=
sum
(
process
.
cpu_times
())
# Thread number, might not be really relevant
# Thread number, might not be really relevant
self
.
cpu_num_threads
=
process
.
get_num_threads
()
self
.
cpu_num_threads
=
process
.
num_threads
()
# Memory percentage
# 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
# 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
# Byte count, Read and write. OSX NOT SUPPORTED
self
.
io_rw_counter
=
ui_counter_list
[
2
]
+
ui_counter_list
[
3
]
self
.
io_rw_counter
=
ui_counter_list
[
2
]
+
ui_counter_list
[
3
]
# Read + write IO cycles
# Read + write IO cycles
...
@@ -69,7 +69,7 @@ class ProcessSnapshot(_Snapshot):
...
@@ -69,7 +69,7 @@ class ProcessSnapshot(_Snapshot):
def
update_cpu_percent
(
self
):
def
update_cpu_percent
(
self
):
if
self
.
process_object
.
is_running
():
if
self
.
process_object
.
is_running
():
# CPU percentage, we will have to get actual absolute value
# 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
):
class
SystemSnapshot
(
_Snapshot
):
""" Take a snapshot from current system usage
""" 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