Skip to content

Commit 01acb46

Browse files
committed
feat: added logging instrumentation for tenant preprocessing param
1 parent 693e633 commit 01acb46

File tree

6 files changed

+14
-10
lines changed

6 files changed

+14
-10
lines changed

runtime/include/execution_regression.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ get_regression_prediction(struct http_session *session)
1111
/* Default Pre-processing - Extract payload size */
1212
const int payload_size = session->http_request.body_length;
1313

14-
const double regression_params[2] = {payload_size, session->paregression_paramram2};
14+
const double regression_params[2] = {payload_size, session->regression_param};
1515

1616
/* Perform Linear Regression using the factors provided by the regressor performed AoT on Matlab using training
1717
* tenant-given dataset */
@@ -23,4 +23,4 @@ get_regression_prediction(struct http_session *session)
2323
return prediction;
2424
}
2525

26-
#endif
26+
#endif

runtime/include/sandbox_perf_log.h

+8-6
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ static inline void
1313
sandbox_perf_log_print_header()
1414
{
1515
if (sandbox_perf_log == NULL) { perror("sandbox perf log"); }
16-
fprintf(sandbox_perf_log, "id,tenant,route,state,deadline,actual,queued,uninitialized,allocated,initialized,"
17-
"runnable,interrupted,preempted,"
18-
"running_sys,running_user,asleep,returned,complete,error,proc_MHz,payload_size\n");
16+
fprintf(sandbox_perf_log,
17+
"id,tenant,route,state,deadline,actual,queued,uninitialized,allocated,initialized,"
18+
"runnable,interrupted,preempted,"
19+
"running_sys,running_user,asleep,returned,complete,error,proc_MHz,payload_size,regression_param\n");
1920
}
2021

2122
/**
@@ -37,16 +38,17 @@ sandbox_perf_log_print_entry(struct sandbox *sandbox)
3738
* seperately from current linear memory size.
3839
*/
3940
fprintf(sandbox_perf_log,
40-
"%lu,%s,%s,%s,%lu,%lu,%lu,%lu,%lu,%lu,%lu,%lu,%lu,%lu,%lu,%lu,%lu,%lu,%lu,%u,%u,%d,%d\n", sandbox->id,
41-
sandbox->tenant->name, sandbox->route->route, sandbox_state_stringify(sandbox->state),
41+
"%lu,%s,%s,%s,%lu,%lu,%lu,%lu,%lu,%lu,%lu,%lu,%lu,%lu,%lu,%lu,%lu,%lu,%lu,%u,%u,%d,%d,%lf\n",
42+
sandbox->id, sandbox->tenant->name, sandbox->route->route, sandbox_state_stringify(sandbox->state),
4243
sandbox->route->relative_deadline, sandbox->total_time, queued_duration,
4344
sandbox->duration_of_state[SANDBOX_UNINITIALIZED], sandbox->duration_of_state[SANDBOX_ALLOCATED],
4445
sandbox->duration_of_state[SANDBOX_INITIALIZED], sandbox->duration_of_state[SANDBOX_RUNNABLE],
4546
sandbox->duration_of_state[SANDBOX_INTERRUPTED], sandbox->duration_of_state[SANDBOX_PREEMPTED],
4647
sandbox->duration_of_state[SANDBOX_RUNNING_SYS], sandbox->duration_of_state[SANDBOX_RUNNING_USER],
4748
sandbox->duration_of_state[SANDBOX_ASLEEP], sandbox->duration_of_state[SANDBOX_RETURNED],
4849
sandbox->duration_of_state[SANDBOX_COMPLETE], sandbox->duration_of_state[SANDBOX_ERROR],
49-
runtime_processor_speed_MHz, sandbox->response_code, 0, sandbox->payload_size);
50+
runtime_processor_speed_MHz, sandbox->response_code, 0, sandbox->payload_size,
51+
sandbox->regression_param);
5052
}
5153

5254
static inline void

runtime/include/sandbox_types.h

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ struct sandbox {
6868
deadline (cycles) */
6969
uint64_t total_time; /* Total time from Request to Response */
7070
int payload_size;
71+
double regression_param; /* Calculated in tenant preprocessing logic if provided */
7172

7273
/* System Interface State */
7374
int32_t return_value;

runtime/src/sandbox.c

+1
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ sandbox_init(struct sandbox *sandbox, struct module *module, struct http_session
155155

156156
sandbox->absolute_deadline = sandbox->timestamp_of.allocation + sandbox->route->relative_deadline;
157157
sandbox->payload_size = session->http_request.body_length;
158+
sandbox->regression_param = session->regression_param;
158159

159160
/*
160161
* Admissions Control State

tests/bash_libraries/experiment_globals.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ declare -gr SANDBOX_ROUTE_FIELD=3
4040
declare -gr SANDBOX_CPU_FREQ_FIELD=20
4141
declare -gr SANDBOX_RESPONSE_CODE_FIELD=21
4242
declare -gr SANDBOX_GUARANTEE_TYPE_FIELD=22
43-
declare -gr SANDBOX_PAYLOAD_SIZE=23
43+
# declare -gr SANDBOX_PAYLOAD_SIZE=23
44+
# declare -gr SANDBOX_REGRESSION_PARAM=24
4445

4546
# HTTP Session Perf Log Globals:
4647
declare -ga HTTP_METRICS=(http_receive http_sent http_total http_preprocess)

tests/multi-tenancy-predictions/run.sh

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ declare -r GET_JPEG_RESOLUTION="get_jpeg_resolution.wasm.so"
3333

3434
# Per route configs:
3535
declare -ar WASM_PATHS=("$CNN" "$CIFAR10" "$GOCR" "$LPD" "$RESIZE" "$EKF")
36-
declare -ar WASM_PATHS_PREPROCESSING=("$GET_JPEG_RESOLUTION" "$GET_JPEG_RESOLUTION" "$GET_JPEG_RESOLUTION" "$GET_JPEG_RESOLUTION" "$NONE")
3736
declare -ar RESP_CONTENT_TYPES=("text/plain" "text/plain" "text/plain" "text/plain" "image/jpeg" "application/octet-stream")
3837
declare -ar EXPECTED_EXEC_TIMES_us=("600000" "4000" "8900" "16700" "62000" "30")
3938
declare -ar DEADLINE_TO_EXEC_RATIOs=("500" "500" "500" "500" "500" "5000") # percentage

0 commit comments

Comments
 (0)