dataplane: record wall clock time when receiving packet
time.clock() returns processor time which is not useful.
diff --git a/platforms/ovs-dummy.py b/platforms/ovs-dummy.py
index bc6f862..2dad1a5 100644
--- a/platforms/ovs-dummy.py
+++ b/platforms/ovs-dummy.py
@@ -108,7 +108,7 @@
data = self.socket.recv(n)
rxbuf += data
if len(data) == n and len(rxbuf) > 2:
- rcvtime = time.clock()
+ rcvtime = time.time()
self.logger.debug("Pkt len " + str(len(rxbuf)) +
" in at " + str(rcvtime) + " on port " +
str(self.port_number))
diff --git a/src/python/oftest/dataplane.py b/src/python/oftest/dataplane.py
index 828f584..36fdb12 100644
--- a/src/python/oftest/dataplane.py
+++ b/src/python/oftest/dataplane.py
@@ -141,7 +141,7 @@
self.kill()
break
- rcvtime = time.clock()
+ rcvtime = time.time()
self.logger.debug("Pkt len " + str(len(rcvmsg)) +
" in at " + str(rcvtime) + " on port " +
str(self.port_number))
@@ -256,9 +256,8 @@
# Enqueue packet
with self.parent.pkt_sync:
for (timestamp, rcvmsg) in self.pcap.readpkts():
- rcvtime = time.clock()
self.logger.debug("Pkt len " + str(len(rcvmsg)) +
- " in at " + str(rcvtime) + " on port " +
+ " in at " + str(timestamp) + " on port " +
str(self.port_number))
if len(self.packets) >= self.max_pkts:
@@ -266,7 +265,7 @@
self.packets.pop(0)
self.packets_discarded += 1
self.logger.debug("Discarding oldest packet to make room")
- self.packets.append((rcvmsg, rcvtime))
+ self.packets.append((rcvmsg, timestamp))
self.packets_total += 1
self.parent.pkt_sync.notify_all()