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
c90bae3d
authored
Feb 16, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix flake8 errors
parent
dd5f6fc0
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
9 deletions
+5
-9
manage.py
+2
-2
src/collectables.py
+1
-1
src/metrics.py
+2
-6
No files found.
manage.py
View file @
c90bae3d
...
@@ -12,8 +12,8 @@ def main():
...
@@ -12,8 +12,8 @@ def main():
configuration
,
metrics
=
cnfparse
.
importConf
(
"config/client.conf"
)
configuration
,
metrics
=
cnfparse
.
importConf
(
"config/client.conf"
)
cli
=
client
.
Client
(
configuration
)
cli
=
client
.
Client
(
configuration
)
cli
.
startReporting
(
metricCollectors
=
cli
.
startReporting
(
collectables
.
collectables
.
provide
(
metrics
))
metricCollectors
=
collectables
.
collectables
.
provide
(
metrics
))
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
...
...
src/collectables.py
View file @
c90bae3d
from
metrics
import
*
from
metrics
import
std
class
collectables
:
class
collectables
:
...
...
src/metrics.py
View file @
c90bae3d
...
@@ -26,8 +26,7 @@ class Collection(object):
...
@@ -26,8 +26,7 @@ class Collection(object):
return
Metrics
(
cls
.
name
,
return
Metrics
(
cls
.
name
,
query
[
cls
.
collector_function_result_attr
])
query
[
cls
.
collector_function_result_attr
])
elif
(
isinstance
(
query
,
tuple
)):
elif
(
isinstance
(
query
,
tuple
)):
return
Metrics
(
cls
.
name
,
return
Metrics
(
cls
.
name
,
query
.
__getattribute__
(
query
.
__getattribute__
(
cls
.
collector_function_result_attr
))
cls
.
collector_function_result_attr
))
else
:
else
:
return
Metrics
(
cls
.
name
,
query
)
return
Metrics
(
cls
.
name
,
query
)
...
@@ -42,12 +41,9 @@ class std(Collection):
...
@@ -42,12 +41,9 @@ class std(Collection):
class
usage
(
Collection
.
Group
.
Metric
):
class
usage
(
Collection
.
Group
.
Metric
):
name
=
"cpu.usage"
name
=
"cpu.usage"
collector_function
=
ps
.
cpu_percent
collector_function
=
ps
.
cpu_percent
collector_function_arguments
=
{
collector_function_arguments
=
{
'interval'
:
0.0
}
'interval'
:
0.0
,
}
class
memory
(
Collection
.
Group
):
class
memory
(
Collection
.
Group
):
class
usage
(
Collection
.
Group
.
Metric
):
class
usage
(
Collection
.
Group
.
Metric
):
name
=
"memory.usage"
name
=
"memory.usage"
collector_function
=
ps
.
virtual_memory
collector_function
=
ps
.
virtual_memory
...
...
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