Commit df9f7be5 authored by Frank Winkler's avatar Frank Winkler

Modified scalability script.

parent 1915e5eb
...@@ -47,13 +47,13 @@ def send_data_to_db(influx_con, hostname, send_number, sample_rate): ...@@ -47,13 +47,13 @@ def send_data_to_db(influx_con, hostname, send_number, sample_rate):
send_iterator = 0 send_iterator = 0
batch_size_iterator = 0 batch_size_iterator = 0
begin_time = int(time.time()) begin_time = int(time.time())
#total send duration per sample
send_duration = 0
while True: while True:
timestamp = int(time.time()) timestamp = int(time.time())
#total send duration per sample
send_duration = 0
hostname_it = hostname + str(node_iterator) hostname_it = hostname + str(node_iterator)
#write metrics #write metrics
...@@ -210,6 +210,9 @@ def send_data_to_db(influx_con, hostname, send_number, sample_rate): ...@@ -210,6 +210,9 @@ def send_data_to_db(influx_con, hostname, send_number, sample_rate):
if sent: if sent:
json_body = [] # new data block json_body = [] # new data block
send_iterator += 1
if send_iterator == send_number:
return max_duration
elif len(json_body) < (5 * batch_size): elif len(json_body) < (5 * batch_size):
print ("Could not sent batch, buffering for next write!") print ("Could not sent batch, buffering for next write!")
else: else:
...@@ -222,14 +225,12 @@ def send_data_to_db(influx_con, hostname, send_number, sample_rate): ...@@ -222,14 +225,12 @@ def send_data_to_db(influx_con, hostname, send_number, sample_rate):
else: else:
print (str((int(time.time()) - begin_time)/60) + "min': Write duration (" + str(send_duration) +") exceeded!") print (str((int(time.time()) - begin_time)/60) + "min': Write duration (" + str(send_duration) +") exceeded!")
send_duration = 0
node_iterator += 1 node_iterator += 1
if node_iterator == start_new_measurement: if node_iterator == start_new_measurement:
node_iterator = 0 node_iterator = 0
send_iterator += 1
if send_iterator == send_number:
return max_duration
return max_duration return max_duration
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment