Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
mock-turtle
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
hdl-core-lib
mock-turtle
Commits
bd8a89e9
Commit
bd8a89e9
authored
May 03, 2018
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw:py: get HMQ statistics
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
2a3e5f29
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
PyMockTurtle.py
software/lib/PyMockTurtle/PyMockTurtle/PyMockTurtle.py
+15
-0
No files found.
software/lib/PyMockTurtle/PyMockTurtle/PyMockTurtle.py
View file @
bd8a89e9
...
...
@@ -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
...
...
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