OLD | NEW |
1 import time | 1 import time |
2 import os | 2 import os |
3 | 3 |
4 | 4 |
5 def _notify_cassandra( | 5 def _notify_cassandra( |
6 latency_notifier_path, net, node_a, node_b, delay, ycsb_node | 6 latency_notifier_path, net, node_a, node_b, delay, ycsb_node |
7 ): | 7 ): |
8 hosts = net.hosts | 8 hosts = net.hosts |
9 node_a_ip = net.getNodeByName(node_a).IP() | 9 node_a_ip = net.getNodeByName(node_a).IP() |
10 node_b_ip = net.getNodeByName(node_b).IP() | 10 node_b_ip = net.getNodeByName(node_b).IP() |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 link.intf1.reconfig(delay=delay, jitter=jitter, distribution='normal
') | 63 link.intf1.reconfig(delay=delay, jitter=jitter, distribution='normal
') |
64 link.intf2.reconfig(delay=delay, jitter=jitter, distribution='normal
') | 64 link.intf2.reconfig(delay=delay, jitter=jitter, distribution='normal
') |
65 | 65 |
66 if send_cassandra_notifications: | 66 if send_cassandra_notifications: |
67 _notify_cassandra( | 67 _notify_cassandra( |
68 notifier_path, net=net, node_a=node_a, | 68 notifier_path, net=net, node_a=node_a, |
69 node_b=node_b, delay=delay, ycsb_node=ycsb_node | 69 node_b=node_b, delay=delay, ycsb_node=ycsb_node |
70 ) | 70 ) |
71 | 71 |
72 # Update this in the file | 72 # Update this in the file |
73 current_timestamp = int(time.time()) | 73 current_timestamp = int(round(float(time.time()),3)) |
74 (wrote, exception) = _write_latency_udpate_to_file( | 74 (wrote, exception) = _write_latency_udpate_to_file( |
75 output_dir, current_timestamp, node_a, node_b, delay, index | 75 output_dir, current_timestamp, node_a, node_b, delay, index |
76 ) | 76 ) |
77 if not wrote: | 77 if not wrote: |
78 print("Error: {}".format(exception)) | 78 print("Error: {}".format(exception)) |
79 return | 79 return |
80 | 80 |
81 print( | 81 print( |
82 "Delay updating, notify cassandra, log update done for link %s" | 82 "Delay updating, notify cassandra, log update done for link %s" |
83 % str(link) | 83 % str(link) |
(...skipping 13 matching lines...) Expand all Loading... |
97 output_dir=output_dir, | 97 output_dir=output_dir, |
98 notifier_path=notifier_path, | 98 notifier_path=notifier_path, |
99 node_a=link_latency_conf['node_a'], | 99 node_a=link_latency_conf['node_a'], |
100 node_b=link_latency_conf['node_b'], | 100 node_b=link_latency_conf['node_b'], |
101 delay=link_latency_conf['delay_conf'][index], | 101 delay=link_latency_conf['delay_conf'][index], |
102 jitter=link_latency_conf['jitter_conf'][index] if use_jitter else 2, | 102 jitter=link_latency_conf['jitter_conf'][index] if use_jitter else 2, |
103 ycsb_node=conf['workload_1']['execute_on_host'], | 103 ycsb_node=conf['workload_1']['execute_on_host'], |
104 index=index, | 104 index=index, |
105 send_cassandra_notifications = conf['notify_cassandra'] | 105 send_cassandra_notifications = conf['notify_cassandra'] |
106 ) | 106 ) |
OLD | NEW |