Fixed issue 119
@@ -180,13 +180,18 @@ def read_out_file(_file=None, _keep=False, _iterations=1, _interval=0):
while _iterations > 0:
# TODO: Fix key for next iteration
+
+ # Pre-calculate the messages and size
msg_transferred_itr = 0 # Messages transferred in every iteration
byte_transferred_itr = 0 # Bytes transferred in every iteration
- _start_time.append(datetime.now()) # Start time of every iteration
for r in readings_list:
- loop.run_until_complete(send_to_coap(r))
msg_transferred_itr += 1
byte_transferred_itr += sys.getsizeof(r)
+
+ # Start sending the messages to server
+ _start_time.append(datetime.now()) # Start time of every iteration
+ for r in readings_list:
+ loop.run_until_complete(send_to_coap(r))
_end_time.append(datetime.now()) # End time of every iteration
_tot_msgs_transferred.append(msg_transferred_itr)
_tot_byte_transferred.append(byte_transferred_itr)
