Minor bug

This commit is contained in:
Jordi Arranz 2023-01-09 12:58:10 +00:00
parent 4470145d3c
commit 97ef9905ac
1 changed files with 3 additions and 4 deletions

View File

@ -129,7 +129,7 @@ def make_payload_dist(dist_type, min_size, max_size):
while(size % 2) != 0: while(size % 2) != 0:
size = int(rtnorm.rtnorm(min_size, max_size, sigma=σ, mu=μ, size=1)) size = int(rtnorm.rtnorm(min_size, max_size, sigma=σ, mu=μ, size=1))
return size return make_payload(size)
G_LOGGER.error('Unknown distribution type %s') G_LOGGER.error('Unknown distribution type %s')
@ -236,7 +236,7 @@ def main():
# Check end condition # Check end condition
elapsed_s = time.time() - s_time elapsed_s = time.time() - s_time
if elapsed_s >= config['general']['simulation_time']: if elapsed_s >= config['general']['simulation_time']:
G_LOGGER.info('Simulation ended. Sent %d messages (%d bytes) in %ds. an avg. bandwitdth of %dBps' %(msg_cnt, bytes_cnt, elapsed_s, bytes_cnt / elapsed_s)) G_LOGGER.info('Simulation ended. Sent %d messages (%d bytes) in %ds.' %(msg_cnt, bytes_cnt, elapsed_s))
break break
# Send message # Send message
@ -245,7 +245,7 @@ def main():
if msg_elapsed <= next_time_to_msg: if msg_elapsed <= next_time_to_msg:
continue continue
G_LOGGER.debug('Time Δ: %d ms.' %((msg_elapsed - next_time_to_msg) * 1000.0)) G_LOGGER.debug('Time Δ: %.6f ms.' %((msg_elapsed - next_time_to_msg) * 1000.0))
# Reference: https://rfc.vac.dev/spec/16/#get_waku_v2_relay_v1_messages # Reference: https://rfc.vac.dev/spec/16/#get_waku_v2_relay_v1_messages
node_address = 'http://%s/' %random.choice(emitters) node_address = 'http://%s/' %random.choice(emitters)
@ -282,7 +282,6 @@ def main():
last_msg_time = time.time() last_msg_time = time.time()
msg_cnt += 1 msg_cnt += 1
bytes_cnt += len(payload) / 2 - 2
# Pull messages # Pull messages
# get_waku_v2_relay_v1_messagesget_waku_v2_relay_v1_messages # get_waku_v2_relay_v1_messagesget_waku_v2_relay_v1_messages