As per feedback
@@ -174,12 +174,14 @@ def read_out_file(_file=None, _keep=False, _iterations=1, _interval=0, send_to='
msg_transferred_itr = 0 # Messages transferred in every iteration
byte_transferred_itr = 0 # Bytes transferred in every iteration
- # Start sending the messages to server
- _start_time.append(datetime.now()) # Start time of every iteration
-
for idx, r in enumerate(readings_list):
readings_list[idx]["key"] = str(uuid.uuid4())
+ 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:
is_sent = False
if send_to == 'coap':
is_sent = loop.run_until_complete(send_to_coap(r))
@@ -189,9 +191,6 @@ def read_out_file(_file=None, _keep=False, _iterations=1, _interval=0, send_to='
if not is_sent:
break
- msg_transferred_itr += 1
- byte_transferred_itr += sys.getsizeof(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)
