3
3
if [ -n " $__experiment_server_globals_sh__ " ]; then return ; fi
4
4
__experiment_server_globals_sh__=$( date)
5
5
6
+ # App WASM so files:
7
+ declare -r FIBONACCI=" fibonacci.wasm.so"
8
+ declare -r EKF=" gps_ekf.wasm.so"
9
+ declare -r CIFAR10=" cifar10.wasm.so"
10
+ declare -r GOCR=" gocr.wasm.so"
11
+ declare -r LPD=" license_plate_detection.wasm.so"
12
+ declare -r RESIZE=" resize_image.wasm.so"
13
+ declare -r CNN=" cnn_face_detection.wasm.so"
14
+
6
15
# The global configs for the scripts
7
16
declare -gr SERVER_LOG_FILE=" perf.log"
8
17
declare -gr SERVER_HTTP_LOG_FILE=" http_perf.log"
9
18
declare -gr HEY_OPTS=" -disable-compression -disable-keepalive -disable-redirects"
10
19
11
- # Globals to fill during run_init in run.sh, to use in base and generate_spec
12
- declare -A ports=()
13
- declare -A repl_periods=()
14
- declare -A max_budgets=()
15
- declare -A wasm_paths=()
16
- declare -A expected_execs=()
17
- declare -A deadlines=()
18
- declare -A resp_content_types=()
19
- declare -A arg_opts_hey=()
20
- declare -A arg_opts_lt=()
21
- declare -A args=()
22
- declare -A concurrencies=()
23
- declare -A rpss=()
24
- declare -a workloads=()
25
- declare -A workload_tids=()
26
- declare -A workload_deadlines=()
27
- declare -A workload_vars=()
28
-
29
20
# Sandbox Perf Log Globals:
30
21
declare -ga SANDBOX_METRICS=(total queued uninitialized allocated initialized runnable interrupted preempted running_sys running_user asleep returned complete error)
31
22
declare -gA SANDBOX_METRICS_FIELDS=(
@@ -48,6 +39,7 @@ declare -gr SANDBOX_TENANT_NAME_FIELD=2
48
39
declare -gr SANDBOX_ROUTE_FIELD=3
49
40
declare -gr SANDBOX_CPU_FREQ_FIELD=20
50
41
declare -gr SANDBOX_RESPONSE_CODE_FIELD=21
42
+ declare -gr SANDBOX_GUARANTEE_TYPE_FIELD=22
51
43
52
44
# HTTP Session Perf Log Globals:
53
45
declare -ga HTTP_METRICS=(http_receive http_sent http_total)
@@ -59,110 +51,3 @@ declare -gA HTTP_METRICS_FIELDS=(
59
51
declare -gr HTTP_TENANT_NAME_FIELD=1
60
52
declare -gr HTTP_ROUTE_FIELD=2
61
53
declare -gr HTTP_CPU_FREQ_FIELD=9
62
-
63
- assert_run_experiments_args () {
64
- if (( $# != 3 )) ; then
65
- panic " invalid number of arguments \" $# \" "
66
- return 1
67
- elif [[ -z " $1 " ]]; then
68
- panic " hostname \" $1 \" was empty"
69
- return 1
70
- elif [[ ! -d " $2 " ]]; then
71
- panic " directory \" $2 \" does not exist"
72
- return 1
73
- elif [[ -z " $3 " ]]; then
74
- panic " load gen \" $3 \" was empty"
75
- return 1
76
- fi
77
- }
78
-
79
- assert_process_client_results_args () {
80
- if (( $# != 1 )) ; then
81
- error_msg " invalid number of arguments ($# , expected 1)"
82
- return 1
83
- elif ! [[ -d " $1 " ]]; then
84
- error_msg " directory $1 does not exist"
85
- return 1
86
- fi
87
- }
88
-
89
- assert_process_server_results_args () {
90
- if (( $# != 1 )) ; then
91
- panic " invalid number of arguments \" $# \" "
92
- return 1
93
- elif [[ ! -d " $1 " ]]; then
94
- panic " directory \" $1 \" does not exist"
95
- return 1
96
- fi
97
- }
98
-
99
- load_value () {
100
- local result=$1
101
- if [ " $result " = " ?" ]; then
102
- result=$2
103
- fi
104
- echo " $result "
105
- }
106
-
107
- run_init () {
108
- for var in " ${VARYING[@]} " ; do
109
- for t_idx in " ${! TENANT_IDS[@]} " ; do
110
- local tenant_id=${TENANT_IDS[$t_idx]}
111
- local tenant=$( printf " %s-%03d" " $tenant_id " " $var " )
112
- local port=$(( INIT_PORTS[t_idx]+ var))
113
- local repl_period=$( load_value ${MTDS_REPL_PERIODS_us[$t_idx]} $var )
114
- local budget=$( load_value ${MTDS_MAX_BUDGETS_us[$t_idx]} $var )
115
-
116
- # TENANTS+=("$tenant")
117
- ports+=([$tenant ]=$port )
118
- repl_periods+=([$tenant ]=$repl_period )
119
- max_budgets+=([$tenant ]=$budget )
120
-
121
- local t_routes r_expected_execs r_deadlines r_arg_opts_hey r_arg_opts_lt r_args r_loads
122
-
123
- IFS=' ' read -r -a t_routes <<< " ${ROUTES[$t_idx]}"
124
- IFS=' ' read -r -a r_wasm_paths <<< " ${WASM_PATHS[$t_idx]}"
125
- IFS=' ' read -r -a r_expected_execs <<< " ${EXPECTED_EXEC_TIMES_us[$t_idx]}"
126
- IFS=' ' read -r -a r_deadlines <<< " ${DEADLINES_us[$t_idx]}"
127
- IFS=' ' read -r -a r_resp_content_types <<< " ${RESP_CONTENT_TYPES[$t_idx]}"
128
-
129
- IFS=' ' read -r -a r_arg_opts_hey <<< " ${ARG_OPTS_HEY[$t_idx]}"
130
- IFS=' ' read -r -a r_arg_opts_lt <<< " ${ARG_OPTS_LT[$t_idx]}"
131
- IFS=' ' read -r -a r_args <<< " ${ARGS[$t_idx]}"
132
- IFS=' ' read -r -a r_loads <<< " ${LOADS[$t_idx]}"
133
-
134
- for r_idx in " ${! t_routes[@]} " ; do
135
- local route=${t_routes[$r_idx]}
136
- local wasm_path=${r_wasm_paths[$r_idx]}
137
- local expected=${r_expected_execs[$r_idx]}
138
- local deadline=${r_deadlines[$r_idx]}
139
- local resp_content_type=${r_resp_content_types[$r_idx]}
140
- local arg_opt_hey=${r_arg_opts_hey[$r_idx]}
141
- local arg_opt_lt=${r_arg_opts_lt[$r_idx]}
142
- local arg=${r_args[$r_idx]}
143
- local load=$( load_value ${r_loads[$r_idx]} $var )
144
-
145
- local workload=" $tenant -$route "
146
-
147
- # Divide as float, cast the result to int (Loadtest is okay floats, HEY is not)
148
- local con=$( echo " x = $NWORKERS * $deadline / $expected * $load / 100; x/1" | bc)
149
- local rps=$(( 1000000 * con / deadline))
150
- # local rps=$(echo "x = 1000000 * $con / $deadline; x/1" | bc)
151
-
152
- wasm_paths+=([$workload ]=$wasm_path )
153
- expected_execs+=([$workload ]=$expected )
154
- deadlines+=([$workload ]=$deadline )
155
- resp_content_types+=([$workload ]=$resp_content_type )
156
- arg_opts_hey+=([$workload ]=$arg_opt_hey )
157
- arg_opts_lt+=([$workload ]=$arg_opt_lt )
158
- args+=([$workload ]=$arg )
159
- concurrencies+=([$workload ]=$con )
160
- rpss+=([$workload ]=$rps )
161
- workloads+=(" $workload " )
162
- workload_tids+=([$workload ]=$tenant_id )
163
- workload_deadlines+=([$workload ]=$deadline )
164
- workload_vars+=([$workload ]=$var )
165
- done
166
- done
167
- done
168
- }
0 commit comments