Commit bd8a89e9 authored by Federico Vaga's avatar Federico Vaga

sw:py: get HMQ statistics

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 2a3e5f29
......@@ -450,6 +450,21 @@ class TrtlHmq(object):
def __repr__(self):
return "{:s}".format(str(self))
def get_stats(self):
""" It gets statistics
:return: a dictionary with the statistics
:rtype: dict
"""
s = {
"message_received": 0,
"message_sent": 0,
}
for name in s:
with open(os.path.join(self.sysfspath, "statistics", name)) as f:
s[name] = int(f.read())
return s
def flush(self):
"""
It removes enqueued messages from the queue. It does it for both
......
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 to comment