Commit c90bae3d by Bach Dániel

fix flake8 errors

parent dd5f6fc0
...@@ -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__":
......
from metrics import * from metrics import std
class collectables: class collectables:
......
...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment