These patches introduce a new option "--with-timestamp" which enables to
get timestamp when Ryu received the OpenFlow message.
This feature is suggested by Matthew on the following post.
[Ryu-devel] Event receive timestamps
With this option, we can get the received time of each message.
$ git diff
diff --git a/ryu/app/simple_switch_13.py b/ryu/app/simple_switch_13.py
index 3e7c598..056510e 100644
--- a/ryu/app/simple_switch_13.py
+++ b/ryu/app/simple_switch_13.py
@@ -89,6 +89,7 @@ class SimpleSwitch13(app_manager.RyuApp):
self.mac_to_port.setdefault(dpid, {})
self.logger.info("packet in %s %s %s %s", dpid, src, dst, in_port)
+ self.logger.info('with timestamp: %s', getattr(ev, 'timestamp', None))
# learn a mac address to avoid FLOOD next time.
self.mac_to_port[dpid][src] = in_port
$ ryu-manager ryu/app/simple_switch_13.py --with-timestamp
...(snip)...
packet in 1 4e:94:3b:80:26:6f 33:33:00:00:00:16 1
with timestamp: 1500946087.7320635
...(snip)...
Please note this feature is only enabled with "--with-timestamp" option
in order to avoid changing the existing features.
IWASE Yusuke (2):
flags: Move option definitions from each apps
flags: Option to enable timestamp
ryu/app/wsgi.py | 13 ---
ryu/cmd/manager.py | 8 +-
ryu/controller/controller.py | 29 -------
ryu/controller/ofp_event.py | 42 ++++++----
ryu/flags.py | 122 ++++++++++++++++++++++++++++-
ryu/lib/ovs/bridge.py | 6 --
ryu/services/protocols/ovsdb/manager.py | 31 +-------
ryu/services/protocols/vrrp/rpc_manager.py | 10 +--
ryu/topology/switches.py | 14 ----
9 files changed, 158 insertions(+), 117 deletions(-)
--
2.7.4
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel