Commit dd5f6fc0 by Gregory Nagy

flake8 and synchronized memory reporter function (celery collector)

parent 0a10962e
......@@ -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
......
......@@ -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):
......
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