diff options
author | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2017-08-02 14:45:09 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2017-08-04 21:07:28 +0900 |
commit | 44cd14ac81382cb8ce0fcc91ad377f2dc99d4fb8 (patch) | |
tree | e9cb92e78ae31be94e9096a5cc8310d5564f37d2 | |
parent | 6d950481f6fa048483f68e63a30f1cbeb70a7c3e (diff) |
ofp_event: Timestamp when OpenFlow event was generated
This patch introduces "timestamp" attribute for OpenFlow event classes
which shows when that event was generated by Datapath instance and nearly
equivalent to when Ryu finished receiving the message contained in that
event instance.
Suggested-by: Matthew Hayes <matthew_john_hayes@hotmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/controller/ofp_event.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ryu/controller/ofp_event.py b/ryu/controller/ofp_event.py index 6b1c8b3e..6eb8e5f8 100644 --- a/ryu/controller/ofp_event.py +++ b/ryu/controller/ofp_event.py @@ -19,10 +19,10 @@ OpenFlow event definitions. """ import inspect +import time from ryu.controller import handler from ryu import ofproto -from ryu import utils from . import event @@ -41,12 +41,14 @@ class EventOFPMsgBase(event.EventBase): msg.datapath A ryu.controller.controller.Datapath instance which describes an OpenFlow switch from which we received this OpenFlow message. + timestamp Timestamp when Datapath instance generated this event. ============ ============================================================== The msg object has some more additional members whose values are extracted from the original OpenFlow message. """ def __init__(self, msg): + self.timestamp = time.time() super(EventOFPMsgBase, self).__init__() self.msg = msg |