-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathrun_3a.py
55 lines (42 loc) · 1.45 KB
/
run_3a.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import os
import time
import random
from config import *
from setup_nodes import *
from datetime import datetime
timestamp = time.time()
dt_object = datetime.fromtimestamp(timestamp)
dt_string = dt_object.strftime("date-%Y-%m-%d-time-%H-%M-%S")
EXP_NAME = "fig-3a-" + dt_string
NUM_ITERATIONS = 1
LOAD = [50000] #[5000, 10000, 15000, 20000, 25000, 50000, 55000] # requests/sec
def run_3a(time, op, out_folder):
# Run client (wrk2)
for i in LOAD:
cmd = "\'" + WRK2_PATH + "/wrk -t120 -c120 -d" + time + " -R" + str(i)
cmd += " --latency http://" + LISTEN_IP_LOAD_BALANCER + ":" + PORT_LOAD_BALANCER
cmd += " -s " + NIMBLE_PATH + "/experiments/" + op + ".lua"
cmd += " -- " + str(i) + "req"
cmd += " > " + out_folder + op + "-" + str(i) + ".log\'"
cmd = ssh_cmd(SSH_IP_CLIENT, cmd)
print(cmd)
os.system(cmd)
out_folder = OUTPUT_FOLDER + "/" + EXP_NAME + "/"
setup_output_folder(SSH_IP_CLIENT, out_folder)
for i in range(NUM_ITERATIONS):
teardown(False)
setup("", False)
# Creates the ledgers so that we can append to them
operation = "create"
duration = "90s"
run_3a(duration, operation, out_folder)
# Append to the ledgers
operation = "append"
duration = "30s"
run_3a(duration, operation, out_folder)
# Read from the ledgers
operation = "read"
duration = "30s"
run_3a(duration, operation, out_folder)
teardown(False)
collect_results(SSH_IP_CLIENT)