Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
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
101f5a4b
authored
Feb 16, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix __collectFromVMs()
parent
c90bae3d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
35 deletions
+31
-35
src/client.py
+31
-35
No files found.
src/client.py
View file @
101f5a4b
...
...
@@ -185,56 +185,52 @@ class Client:
if
((
self
.
beat
%
self
.
kvmCPU
)
is
0
)
and
vm_proc
.
is_running
():
metrics
.
append
((
"vm."
+
vm
[
0
]
+
"."
+
"memory.usage"
+
"
%
d
"
%
(
"
%
f
"
%
(
vm_proc
.
get_memory_percent
()
/
100
*
vm
[
2
])
+
"
%
d"
%
(
time
.
time
())
))
if
((
self
.
beat
%
self
.
kvmMem
)
is
0
)
and
vm_proc
.
is_running
():
metrics
.
append
((
"vm."
+
vm
[
0
]
+
"."
+
"cpu.usage"
+
"
%
d
"
%
(
vm_proc
.
get_cpu_times
()
.
system
+
"
%
f
"
%
(
vm_proc
.
get_cpu_times
()
.
system
+
vm_proc
.
get_cpu_times
()
.
user
)
+
"
%
d"
%
(
time
.
time
())
))
interfaces_list
=
psutil
.
network_io_counters
(
pernic
=
True
)
if
((
self
.
beat
%
self
.
kvmNet
)
is
0
)
and
vm_proc
.
is_running
()
:
if
((
self
.
beat
%
self
.
kvmNet
)
is
0
):
for
vm
in
running_vms
:
interfaces_list_enum
=
enumerate
(
interfaces_list
)
for
iname_index
,
iname
in
interfaces_list_enum
:
if
vm
[
0
]
in
iname
:
metrics
.
append
((
"vm."
+
vm
[
0
]
+
"."
+
"network.packages_sent"
+
"
%
d"
%
interfaces_list
[
iname
]
.
packets_sent
+
"."
+
iname
+
"
%
d"
%
(
time
.
time
())
))
metrics
.
append
((
"vm."
+
vm
[
0
]
+
"."
+
"network.packages_recv"
+
"
%
d"
%
interfaces_list
[
iname
]
.
packets_recv
+
"."
+
iname
+
"
%
d"
%
(
time
.
time
())
))
metrics
.
append
((
"vm."
+
vm
[
0
]
+
"."
+
"network"
".bytes_sent"
+
"
%
d"
%
interfaces_list
[
iname
]
.
bytes_sent
+
"."
+
iname
+
"
%
d"
%
(
time
.
time
())
))
metrics
.
append
((
"vm."
+
vm
[
0
]
+
"."
+
"network"
".bytes_recv"
+
"
%
d"
%
interfaces_list
[
iname
]
.
bytes_recv
+
"."
+
iname
+
"
%
d"
%
(
time
.
time
())
))
metrics
.
append
(
(
'vm.
%(name)
s.network.packets_sent_
%(interface)
s '
'
%(data)
f
%(time)
d'
)
%
{
'name'
:
vm
[
0
],
'interface'
:
iname
,
'time'
:
time
.
time
(),
'data'
:
interfaces_list
[
iname
]
.
packets_sent
})
metrics
.
append
(
(
'vm.
%(name)
s.network.packets_recv_
%(interface)
s '
'
%(data)
f
%(time)
d'
)
%
{
'name'
:
vm
[
0
],
'interface'
:
iname
,
'time'
:
time
.
time
(),
'data'
:
interfaces_list
[
iname
]
.
packets_recv
})
metrics
.
append
(
(
'vm.
%(name)
s.network.bytes_sent_
%(interface)
s '
'
%(data)
f
%(time)
d'
)
%
{
'name'
:
vm
[
0
],
'interface'
:
iname
,
'time'
:
time
.
time
(),
'data'
:
interfaces_list
[
iname
]
.
bytes_sent
})
metrics
.
append
(
(
'vm.
%(name)
s.network.bytes_recv_
%(interface)
s '
'
%(data)
f
%(time)
d'
)
%
{
'name'
:
vm
[
0
],
'interface'
:
iname
,
'time'
:
time
.
time
(),
'data'
:
interfaces_list
[
iname
]
.
bytes_recv
})
return
metrics
def
getMaxFrequency
(
self
,
metricCollectors
=
[]):
...
...
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