implement multiple linear chain

main
xiaosuGW 3 years ago
parent b648b62bfe
commit 44e4026df2

@ -405,6 +405,7 @@ module_new_from_json(char *file_name)
uint32_t expected_execution_us = 0; uint32_t expected_execution_us = 0;
int admissions_percentile = 50; int admissions_percentile = 50;
bool is_active = false; bool is_active = false;
bool is_tail_module = false;
int32_t request_count = 0; int32_t request_count = 0;
int32_t response_count = 0; int32_t response_count = 0;
int j = 1; int j = 1;
@ -453,6 +454,15 @@ module_new_from_json(char *file_name)
} else { } else {
panic("Expected active key to be a JSON boolean, was %s\n", val); panic("Expected active key to be a JSON boolean, was %s\n", val);
} }
} else if (strcmp(key, "tail_module") == 0) {
assert(tokens[i + j + 1].type == JSMN_PRIMITIVE);
if (val[0] == 't') {
is_tail_module = true;
} else if (val[0] == 'f') {
is_tail_module = false;
} else {
panic("Expected tail_module key to be a JSON boolean, was %s\n", val);
}
} else if (strcmp(key, "relative-deadline-us") == 0) { } else if (strcmp(key, "relative-deadline-us") == 0) {
int64_t buffer = strtoll(val, NULL, 10); int64_t buffer = strtoll(val, NULL, 10);
if (buffer < 0 || buffer > (int64_t)RUNTIME_RELATIVE_DEADLINE_US_MAX) if (buffer < 0 || buffer > (int64_t)RUNTIME_RELATIVE_DEADLINE_US_MAX)
@ -563,6 +573,11 @@ module_new_from_json(char *file_name)
tail_module = module; tail_module = module;
tail_module->next_module = NULL; tail_module->next_module = NULL;
/* if this is the tail module, reset tail_module to NULL to build another new chain */
if (is_tail_module) {
tail_module = NULL;
}
module_set_http_info(module, request_count, request_headers, request_content_type, module_set_http_info(module, request_count, request_headers, request_content_type,
response_count, reponse_headers, response_content_type); response_count, reponse_headers, response_content_type);
module_count++; module_count++;

@ -0,0 +1,90 @@
{
"active": true,
"name": "resize",
"path": "resize_wasm.so",
"port": 10000,
"relative-deadline-us": 50000,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/jpeg",
"http-req-size": 1024000,
"http-resp-headers": [],
"http-resp-size": 1024000,
"http-resp-content-type": "image/png"
},
{
"active": true,
"name": "png2bmp",
"path": "C-Image-Manip_wasm.so",
"port": 10001,
"relative-deadline-us": 60000,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/png",
"http-req-size": 4096000,
"http-resp-headers": [],
"http-resp-size": 4096000,
"http-resp-content-type": "image/bmp"
},
{
"active": true,
"name": "cifar10",
"path": "cifar10_wasm.so",
"port": 10002,
"relative-deadline-us": 50000,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/bmp",
"http-req-size": 4096000,
"http-resp-headers": [],
"http-resp-size": 1024,
"http-resp-content-type": "text/plain",
"tail-module": true
},
{
"active": true,
"name": "fibonacci",
"path": "fibonacci_wasm.so",
"port": 10003,
"expected-execution-us": 600,
"relative-deadline-us": 2000,
"argsize": 2,
"http-req-headers": [],
"http-req-content-type": "text/plain",
"http-req-size": 1024,
"http-resp-headers": [],
"http-resp-size": 1024,
"http-resp-content-type": "text/plain"
},
{
"active": true,
"name": "fibonacci2",
"path": "fibonacci2_wasm.so",
"port": 10004,
"expected-execution-us": 600,
"relative-deadline-us": 2000,
"argsize": 2,
"http-req-headers": [],
"http-req-content-type": "text/plain",
"http-req-size": 1024,
"http-resp-headers": [],
"http-resp-size": 1024,
"http-resp-content-type": "text/plain"
},
{
"active": true,
"name": "fibonacci3",
"path": "fibonacci3_wasm.so",
"port": 10005,
"expected-execution-us": 600,
"relative-deadline-us": 2000,
"argsize": 2,
"http-req-headers": [],
"http-req-content-type": "text/plain",
"http-req-size": 1024,
"http-resp-headers": [],
"http-resp-size": 1024,
"http-resp-content-type": "text/plain",
"tail-module": true
}
Loading…
Cancel
Save