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
Commit
101f5a4b
authored
Feb 16, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix __collectFromVMs()
parent
c90bae3d
Show 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:
...
@@ -185,56 +185,52 @@ class Client:
if
((
self
.
beat
%
self
.
kvmCPU
)
is
0
)
and
vm_proc
.
is_running
():
if
((
self
.
beat
%
self
.
kvmCPU
)
is
0
)
and
vm_proc
.
is_running
():
metrics
.
append
((
"vm."
+
metrics
.
append
((
"vm."
+
vm
[
0
]
+
"."
+
"memory.usage"
+
vm
[
0
]
+
"."
+
"memory.usage"
+
"
%
d
"
%
(
"
%
f
"
%
(
vm_proc
.
get_memory_percent
()
/
100
*
vm
[
2
])
vm_proc
.
get_memory_percent
()
/
100
*
vm
[
2
])
+
"
%
d"
%
(
time
.
time
())
+
"
%
d"
%
(
time
.
time
())
))
))
if
((
self
.
beat
%
self
.
kvmMem
)
is
0
)
and
vm_proc
.
is_running
():
if
((
self
.
beat
%
self
.
kvmMem
)
is
0
)
and
vm_proc
.
is_running
():
metrics
.
append
((
"vm."
+
metrics
.
append
((
"vm."
+
vm
[
0
]
+
"."
+
"cpu.usage"
+
vm
[
0
]
+
"."
+
"cpu.usage"
+
"
%
d
"
%
(
vm_proc
.
get_cpu_times
()
.
system
+
"
%
f
"
%
(
vm_proc
.
get_cpu_times
()
.
system
+
vm_proc
.
get_cpu_times
()
.
user
)
vm_proc
.
get_cpu_times
()
.
user
)
+
"
%
d"
%
(
time
.
time
())
+
"
%
d"
%
(
time
.
time
())
))
))
interfaces_list
=
psutil
.
network_io_counters
(
interfaces_list
=
psutil
.
network_io_counters
(
pernic
=
True
)
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
:
for
vm
in
running_vms
:
interfaces_list_enum
=
enumerate
(
interfaces_list
)
interfaces_list_enum
=
enumerate
(
interfaces_list
)
for
iname_index
,
iname
in
interfaces_list_enum
:
for
iname_index
,
iname
in
interfaces_list_enum
:
if
vm
[
0
]
in
iname
:
if
vm
[
0
]
in
iname
:
metrics
.
append
((
"vm."
+
metrics
.
append
(
vm
[
0
]
+
(
'vm.
%(name)
s.network.packets_sent_
%(interface)
s '
"."
+
"network.packages_sent"
+
'
%(data)
f
%(time)
d'
)
%
{
"
%
d"
%
interfaces_list
[
'name'
:
vm
[
0
],
iname
]
.
packets_sent
'interface'
:
iname
,
+
"."
+
iname
'time'
:
time
.
time
(),
+
"
%
d"
%
(
time
.
time
())
'data'
:
interfaces_list
[
iname
]
.
packets_sent
})
))
metrics
.
append
(
metrics
.
append
((
"vm."
+
(
'vm.
%(name)
s.network.packets_recv_
%(interface)
s '
vm
[
0
]
+
'
%(data)
f
%(time)
d'
)
%
{
"."
+
"network.packages_recv"
+
'name'
:
vm
[
0
],
"
%
d"
%
interfaces_list
[
'interface'
:
iname
,
iname
]
.
packets_recv
'time'
:
time
.
time
(),
+
"."
+
iname
'data'
:
interfaces_list
[
iname
]
.
packets_recv
})
+
"
%
d"
%
(
time
.
time
())
metrics
.
append
(
))
(
'vm.
%(name)
s.network.bytes_sent_
%(interface)
s '
metrics
.
append
((
"vm."
+
'
%(data)
f
%(time)
d'
)
%
{
vm
[
0
]
+
"."
+
"network"
'name'
:
vm
[
0
],
".bytes_sent"
+
'interface'
:
iname
,
"
%
d"
%
interfaces_list
[
'time'
:
time
.
time
(),
iname
]
.
bytes_sent
'data'
:
interfaces_list
[
iname
]
.
bytes_sent
})
+
"."
+
iname
metrics
.
append
(
+
"
%
d"
%
(
time
.
time
())
(
'vm.
%(name)
s.network.bytes_recv_
%(interface)
s '
))
'
%(data)
f
%(time)
d'
)
%
{
metrics
.
append
((
"vm."
+
'name'
:
vm
[
0
],
vm
[
0
]
+
"."
+
"network"
'interface'
:
iname
,
".bytes_recv"
+
'time'
:
time
.
time
(),
"
%
d"
%
interfaces_list
[
'data'
:
interfaces_list
[
iname
]
.
bytes_recv
})
iname
]
.
bytes_recv
+
"."
+
iname
+
"
%
d"
%
(
time
.
time
())
))
return
metrics
return
metrics
def
getMaxFrequency
(
self
,
metricCollectors
=
[]):
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