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
Commit
dd5f6fc0
authored
Feb 07, 2014
by
Gregory Nagy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flake8 and synchronized memory reporter function (celery collector)
parent
0a10962e
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
1 deletions
+10
-1
src/client.py
+4
-0
src/cnfparse.py
+0
-0
src/collectables.py
+0
-0
src/metrics.py
+6
-1
No files found.
src/client.py
View file @
dd5f6fc0
...
...
@@ -208,6 +208,7 @@ class Client:
"."
+
"network.packages_sent"
+
"
%
d"
%
interfaces_list
[
iname
]
.
packets_sent
+
"."
+
iname
+
"
%
d"
%
(
time
.
time
())
))
metrics
.
append
((
"vm."
+
...
...
@@ -215,6 +216,7 @@ class Client:
"."
+
"network.packages_recv"
+
"
%
d"
%
interfaces_list
[
iname
]
.
packets_recv
+
"."
+
iname
+
"
%
d"
%
(
time
.
time
())
))
metrics
.
append
((
"vm."
+
...
...
@@ -222,6 +224,7 @@ class Client:
".bytes_sent"
+
"
%
d"
%
interfaces_list
[
iname
]
.
bytes_sent
+
"."
+
iname
+
"
%
d"
%
(
time
.
time
())
))
metrics
.
append
((
"vm."
+
...
...
@@ -229,6 +232,7 @@ class Client:
".bytes_recv"
+
"
%
d"
%
interfaces_list
[
iname
]
.
bytes_recv
+
"."
+
iname
+
"
%
d"
%
(
time
.
time
())
))
return
metrics
...
...
src/cnfparse.py
View file @
dd5f6fc0
src/collectables.py
View file @
dd5f6fc0
src/metrics.py
View file @
dd5f6fc0
...
...
@@ -9,7 +9,9 @@ Metrics = collections.namedtuple("Metrics", ["name", "value"])
class
Collection
(
object
):
class
Group
(
object
):
class
Metric
(
object
):
name
=
"unknown"
collector_function
=
0
...
...
@@ -34,7 +36,9 @@ class Collection(object):
class
std
(
Collection
):
class
cpu
(
Collection
.
Group
):
class
usage
(
Collection
.
Group
.
Metric
):
name
=
"cpu.usage"
collector_function
=
ps
.
cpu_percent
...
...
@@ -43,9 +47,10 @@ class std(Collection):
}
class
memory
(
Collection
.
Group
):
class
usage
(
Collection
.
Group
.
Metric
):
name
=
"memory.usage"
collector_function
=
ps
.
virtmem_usage
collector_function
=
ps
.
virtual_memory
collector_function_result_attr
=
"percent"
class
swap
(
Collection
.
Group
):
...
...
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