Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
monitor-client
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
4df1591d
authored
Feb 19, 2014
by
Gregory Nagy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fxd
parent
48694fe5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
src/client.py
+5
-6
src/collectables.py
+1
-0
No files found.
src/client.py
View file @
4df1591d
...
...
@@ -180,17 +180,16 @@ class Client:
%
(
self
.
name
,
len
(
running_vms
),
time
.
time
()))
for
vm
in
running_vms
:
vm_proc
=
psutil
.
Process
(
vm
[
1
])
if
((
self
.
beat
%
self
.
kvmCPU
)
is
0
)
and
vm_proc
.
is_running
():
if
(((
self
.
beat
%
self
.
kvmCPU
)
is
0
)
and
vm_proc
.
is_running
()):
mem_perc
=
vm_proc
.
get_memory_percent
()
/
100
*
vm
[
2
]
metrics
.
append
(
"vm.
%
s.memory.usage
%
f
%
d"
%
(
vm
[
0
],
vm_proc
.
get_memory_percent
()
/
100
*
vm
[
2
]),
time
.
time
())
if
((
self
.
beat
%
self
.
kvmMem
)
is
0
)
and
vm_proc
.
is_running
():
%
(
vm
[
0
],
mem_perc
,
time
.
time
()))
if
(((
self
.
beat
%
self
.
kvmMem
)
is
0
)
and
vm_proc
.
is_running
()):
systemtime
=
vm_proc
.
get_cpu_times
()
.
system
usertime
=
vm_proc
.
get_cpu_times
()
.
user
sumCpu
=
systemtime
+
usertime
metrics
.
append
(
"vm.
%
s.cpu.usage
%
f
%
d"
%
(
sumCpu
,
time
.
time
()))
%
(
vm
[
0
],
sumCpu
,
time
.
time
()))
interfaces_list
=
psutil
.
network_io_counters
(
pernic
=
True
)
if
((
self
.
beat
%
self
.
kvmNet
)
is
0
):
...
...
src/collectables.py
View file @
4df1591d
...
...
@@ -4,6 +4,7 @@ from metrics import std
class
collectables
:
__collectables
=
{
std
.
cpu
.
usage
.
name
:
[
std
.
cpu
.
usage
],
std
.
cpu
.
times
.
name
:
[
std
.
cpu
.
times
],
std
.
memory
.
usage
.
name
:
[
std
.
memory
.
usage
],
std
.
swap
.
usage
.
name
:
[
std
.
swap
.
usage
],
std
.
user
.
count
.
name
:
[
std
.
user
.
count
],
...
...
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