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():
configuration
,
metrics
=
cnfparse
.
importConf
(
"config/client.conf"
)
cli
=
client
.
Client
(
configuration
)
cli
.
startReporting
(
metricCollectors
=
collectables
.
collectables
.
provide
(
metrics
))
cli
.
startReporting
(
metricCollectors
=
collectables
.
collectables
.
provide
(
metrics
))
if
__name__
==
"__main__"
:
...
...
src/collectables.py
View file @
c90bae3d
from
metrics
import
*
from
metrics
import
std
class
collectables
:
...
...
src/metrics.py
View file @
c90bae3d
...
...
@@ -26,8 +26,7 @@ class Collection(object):
return
Metrics
(
cls
.
name
,
query
[
cls
.
collector_function_result_attr
])
elif
(
isinstance
(
query
,
tuple
)):
return
Metrics
(
cls
.
name
,
query
.
__getattribute__
(
return
Metrics
(
cls
.
name
,
query
.
__getattribute__
(
cls
.
collector_function_result_attr
))
else
:
return
Metrics
(
cls
.
name
,
query
)
...
...
@@ -42,12 +41,9 @@ class std(Collection):
class
usage
(
Collection
.
Group
.
Metric
):
name
=
"cpu.usage"
collector_function
=
ps
.
cpu_percent
collector_function_arguments
=
{
'interval'
:
0.0
,
}
collector_function_arguments
=
{
'interval'
:
0.0
}
class
memory
(
Collection
.
Group
):
class
usage
(
Collection
.
Group
.
Metric
):
name
=
"memory.usage"
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