fix: multi-module JSON has top array

master
Sean McBride 4 years ago
parent 574dd81791
commit bf5f31adad

@ -1,4 +1,5 @@
{
[
{
"name": "ekf_first_iter",
"path": "ekf_wasm.so",
"port": 10000,
@ -7,8 +8,8 @@
"http-req-size": 1024000,
"http-resp-size": 1024000,
"http-resp-content-type": "application/octet-stream"
},
{
},
{
"name": "ekf_second_iter",
"path": "ekf_wasm.so",
"port": 10001,
@ -17,8 +18,8 @@
"http-req-size": 1024000,
"http-resp-size": 1024000,
"http-resp-content-type": "application/octet-stream"
},
{
},
{
"name": "ekf_third_iter",
"path": "ekf_wasm.so",
"port": 10002,
@ -27,4 +28,5 @@
"http-req-size": 1024000,
"http-resp-size": 1024000,
"http-resp-content-type": "application/octet-stream"
}
}
]

@ -1,4 +1,5 @@
{
[
{
"name": "cifar10_rand",
"path": "cifar10_wasm.so",
"port": 10000,
@ -7,8 +8,8 @@
"http-req-size": 4096,
"http-resp-size": 128,
"http-resp-content-type": "text/plain"
},
{
},
{
"name": "cifar10_same",
"path": "cifar10_wasm.so",
"port": 10001,
@ -17,4 +18,5 @@
"http-req-size": 4096,
"http-resp-size": 128,
"http-resp-content-type": "text/plain"
}
}
]

@ -1,4 +1,5 @@
{
[
{
"name": "resize_small",
"path": "resize_wasm.so",
"port": 10000,
@ -7,8 +8,8 @@
"http-req-size": 1024000,
"http-resp-size": 1024000,
"http-resp-content-type": "image/png"
},
{
},
{
"name": "resize_medium",
"path": "resize_wasm.so",
"port": 10001,
@ -17,8 +18,8 @@
"http-req-size": 1024000,
"http-resp-size": 1024000,
"http-resp-content-type": "image/png"
},
{
},
{
"name": "resize_large",
"path": "resize_wasm.so",
"port": 10002,
@ -27,4 +28,5 @@
"http-req-size": 1524000,
"http-resp-size": 1524000,
"http-resp-content-type": "image/png"
}
}
]

@ -1,4 +1,5 @@
{
[
{
"name": "lpd1",
"path": "lpd_wasm.so",
"port": 10000,
@ -7,8 +8,8 @@
"http-req-size": 1002400,
"http-resp-size": 1048576,
"http-resp-content-type": "text/plain"
},
{
},
{
"name": "lpd2",
"path": "lpd_wasm.so",
"port": 10001,
@ -17,8 +18,8 @@
"http-req-size": 1002400,
"http-resp-size": 1048576,
"http-resp-content-type": "text/plain"
},
{
},
{
"name": "lpd4",
"path": "lpd_wasm.so",
"port": 10002,
@ -27,4 +28,5 @@
"http-req-size": 1002400,
"http-resp-size": 1048576,
"http-resp-content-type": "text/plain"
}
}
]

@ -1,4 +1,5 @@
{
[
{
"name": "gocr_72_dpi",
"path": "gocr_wasm.so",
"port": 10000,
@ -7,8 +8,8 @@
"http-req-size": 5335057,
"http-resp-size": 5335057,
"http-resp-content-type": "text/plain"
},
{
},
{
"name": "gocr_108_dpi",
"path": "gocr_wasm.so",
"port": 10001,
@ -17,8 +18,8 @@
"http-req-size": 5335057,
"http-resp-size": 5335057,
"http-resp-content-type": "text/plain"
},
{
},
{
"name": "gocr_144_dpi",
"path": "gocr_wasm.so",
"port": 10002,
@ -27,4 +28,5 @@
"http-req-size": 5335057,
"http-resp-size": 5335057,
"http-resp-content-type": "text/plain"
}
}
]

@ -1,4 +1,5 @@
{
[
{
"name": "gocr_mono",
"path": "gocr_wasm.so",
"port": 10000,
@ -7,8 +8,8 @@
"http-req-size": 5335057,
"http-resp-size": 5335057,
"http-resp-content-type": "text/plain"
},
{
},
{
"name": "gocr_urw_gothic",
"path": "gocr_wasm.so",
"port": 10001,
@ -17,8 +18,8 @@
"http-req-size": 5335057,
"http-resp-size": 5335057,
"http-resp-content-type": "text/plain"
},
{
},
{
"name": "gocr_lobster_2",
"path": "gocr_wasm.so",
"port": 10002,
@ -27,4 +28,5 @@
"http-req-size": 5335057,
"http-resp-size": 5335057,
"http-resp-content-type": "text/plain"
}
}
]

@ -1,4 +1,5 @@
{
[
{
"name": "gocr_1_word",
"path": "gocr_wasm.so",
"port": 10000,
@ -7,8 +8,8 @@
"http-req-size": 5335057,
"http-resp-size": 5335057,
"http-resp-content-type": "text/plain"
},
{
},
{
"name": "gocr_10_words",
"path": "gocr_wasm.so",
"port": 10001,
@ -17,8 +18,8 @@
"http-req-size": 5335057,
"http-resp-size": 5335057,
"http-resp-content-type": "text/plain"
},
{
},
{
"name": "gocr_100_words",
"path": "gocr_wasm.so",
"port": 10002,
@ -27,4 +28,5 @@
"http-req-size": 5335057,
"http-resp-size": 5335057,
"http-resp-content-type": "text/plain"
}
}
]

@ -1,4 +1,5 @@
{
[
{
"name": "fibonacci_10",
"path": "fibonacci_wasm.so",
"port": 10010,
@ -8,8 +9,8 @@
"http-req-size": 1024,
"http-resp-size": 1024,
"http-resp-content-type": "text/plain"
},
{
},
{
"name": "fibonacci_40",
"path": "fibonacci_wasm.so",
"port": 10040,
@ -19,4 +20,5 @@
"http-req-size": 1024,
"http-resp-size": 1024,
"http-resp-content-type": "text/plain"
}
}
]

@ -1,4 +1,5 @@
{
[
{
"name": "ekf",
"path": "ekf_wasm.so",
"port": 10000,
@ -7,8 +8,8 @@
"http-req-size": 1024000,
"http-resp-size": 1024000,
"http-resp-content-type": "application/octet-stream"
},
{
},
{
"name": "resize",
"path": "resize_wasm.so",
"port": 10001,
@ -17,8 +18,8 @@
"http-req-size": 1024000,
"http-resp-size": 1024000,
"http-resp-content-type": "image/png"
},
{
},
{
"name": "lpd",
"path": "lpd_wasm.so",
"port": 10002,
@ -27,8 +28,8 @@
"http-req-size": 1002400,
"http-resp-size": 1048576,
"http-resp-content-type": "text/plain"
},
{
},
{
"name": "gocr",
"path": "gocr_wasm.so",
"port": 10003,
@ -37,8 +38,8 @@
"http-req-size": 5335057,
"http-resp-size": 5335057,
"http-resp-content-type": "text/plain"
},
{
},
{
"name": "cifar10",
"path": "cifar10_wasm.so",
"port": 10004,
@ -47,4 +48,5 @@
"http-req-size": 4096,
"http-resp-size": 128,
"http-resp-content-type": "text/plain"
}
}
]

@ -1,4 +1,5 @@
{
[
{
"name": "work1k",
"path": "work1k_wasm.so",
"port": 10000,
@ -7,8 +8,8 @@
"http-req-size": 1548,
"http-resp-size": 1548,
"http-resp-content-type": "text/plain"
},
{
},
{
"name": "work10k",
"path": "work10k_wasm.so",
"port": 10001,
@ -17,8 +18,8 @@
"http-req-size": 10480,
"http-resp-size": 10480,
"http-resp-content-type": "text/plain"
},
{
},
{
"name": "work100k",
"path": "work100k_wasm.so",
"port": 10002,
@ -27,8 +28,8 @@
"http-req-size": 104800,
"http-resp-size": 104800,
"http-resp-content-type": "text/plain"
},
{
},
{
"name": "work1m",
"path": "work1m_wasm.so",
"port": 10003,
@ -37,4 +38,5 @@
"http-req-size": 1048776,
"http-resp-size": 1048776,
"http-resp-content-type": "text/plain"
}
}
]

@ -1,4 +1,5 @@
{
[
{
"name": "fibonacci_10",
"path": "fibonacci_wasm.so",
"port": 10010,
@ -8,8 +9,8 @@
"http-req-size": 1024,
"http-resp-size": 1024,
"http-resp-content-type": "text/plain"
},
{
},
{
"name": "fibonacci_40",
"path": "fibonacci_wasm.so",
"port": 10040,
@ -19,4 +20,5 @@
"http-req-size": 1024,
"http-resp-size": 1024,
"http-resp-content-type": "text/plain"
}
}
]

@ -1,4 +1,5 @@
{
[
{
"name": "cifar10_1.5",
"path": "cifar10_wasm.so",
"port": 10018,
@ -8,8 +9,8 @@
"http-resp-size": 128,
"http-resp-content-type": "text/plain",
"admissions-percentile": 90
},
{
},
{
"name": "cifar10_1.6",
"path": "cifar10_wasm.so",
"port": 10019,
@ -19,8 +20,8 @@
"http-resp-size": 128,
"http-resp-content-type": "text/plain",
"admissions-percentile": 90
},
{
},
{
"name": "cifar10_1.7",
"path": "cifar10_wasm.so",
"port": 10020,
@ -30,8 +31,8 @@
"http-resp-size": 128,
"http-resp-content-type": "text/plain",
"admissions-percentile": 90
},
{
},
{
"name": "cifar10_1.8",
"path": "cifar10_wasm.so",
"port": 10021,
@ -41,8 +42,8 @@
"http-resp-size": 128,
"http-resp-content-type": "text/plain",
"admissions-percentile": 90
},
{
},
{
"name": "cifar10_1.9",
"path": "cifar10_wasm.so",
"port": 10022,
@ -52,8 +53,8 @@
"http-resp-size": 128,
"http-resp-content-type": "text/plain",
"admissions-percentile": 90
},
{
},
{
"name": "cifar10_2.0",
"path": "cifar10_wasm.so",
"port": 10023,
@ -63,8 +64,8 @@
"http-resp-size": 128,
"http-resp-content-type": "text/plain",
"admissions-percentile": 90
},
{
},
{
"name": "ekf_1.5",
"path": "ekf_wasm.so",
"port": 10000,
@ -74,8 +75,8 @@
"http-resp-size": 1024000,
"http-resp-content-type": "application/octet-stream",
"admissions-percentile": 90
},
{
},
{
"name": "ekf_1.6",
"path": "ekf_wasm.so",
"port": 10001,
@ -85,8 +86,8 @@
"http-resp-size": 1024000,
"http-resp-content-type": "application/octet-stream",
"admissions-percentile": 90
},
{
},
{
"name": "ekf_1.7",
"path": "ekf_wasm.so",
"port": 10002,
@ -96,8 +97,8 @@
"http-resp-size": 1024000,
"http-resp-content-type": "application/octet-stream",
"admissions-percentile": 90
},
{
},
{
"name": "ekf_1.8",
"path": "ekf_wasm.so",
"port": 10003,
@ -107,8 +108,8 @@
"http-resp-size": 1024000,
"http-resp-content-type": "application/octet-stream",
"admissions-percentile": 90
},
{
},
{
"name": "ekf_1.9",
"path": "ekf_wasm.so",
"port": 10004,
@ -118,8 +119,8 @@
"http-resp-size": 1024000,
"http-resp-content-type": "application/octet-stream",
"admissions-percentile": 90
},
{
},
{
"name": "ekf_2.0",
"path": "ekf_wasm.so",
"port": 10005,
@ -129,8 +130,8 @@
"http-resp-size": 1024000,
"http-resp-content-type": "application/octet-stream",
"admissions-percentile": 90
},
{
},
{
"name": "gocr_1.5",
"path": "gocr_wasm.so",
"port": 10006,
@ -140,8 +141,8 @@
"http-resp-size": 5335057,
"http-resp-content-type": "text/plain",
"admissions-percentile": 90
},
{
},
{
"name": "gocr_1.6",
"path": "gocr_wasm.so",
"port": 10007,
@ -151,8 +152,8 @@
"http-resp-size": 5335057,
"http-resp-content-type": "text/plain",
"admissions-percentile": 90
},
{
},
{
"name": "gocr_1.7",
"path": "gocr_wasm.so",
"port": 10008,
@ -162,8 +163,8 @@
"http-resp-size": 5335057,
"http-resp-content-type": "text/plain",
"admissions-percentile": 90
},
{
},
{
"name": "gocr_1.8",
"path": "gocr_wasm.so",
"port": 10009,
@ -173,8 +174,8 @@
"http-resp-size": 5335057,
"http-resp-content-type": "text/plain",
"admissions-percentile": 90
},
{
},
{
"name": "gocr_1.9",
"path": "gocr_wasm.so",
"port": 10010,
@ -184,8 +185,8 @@
"http-resp-size": 5335057,
"http-resp-content-type": "text/plain",
"admissions-percentile": 90
},
{
},
{
"name": "gocr_2.0",
"path": "gocr_wasm.so",
"port": 10011,
@ -195,8 +196,8 @@
"http-resp-size": 5335057,
"http-resp-content-type": "text/plain",
"admissions-percentile": 90
},
{
},
{
"name": "lpd_1.5",
"path": "lpd_wasm.so",
"port": 10012,
@ -206,8 +207,8 @@
"http-resp-size": 1048576,
"http-resp-content-type": "text/plain",
"admissions-percentile": 90
},
{
},
{
"name": "lpd_1.6",
"path": "lpd_wasm.so",
"port": 10013,
@ -217,8 +218,8 @@
"http-resp-size": 1048576,
"http-resp-content-type": "text/plain",
"admissions-percentile": 90
},
{
},
{
"name": "lpd_1.7",
"path": "lpd_wasm.so",
"port": 10014,
@ -228,8 +229,8 @@
"http-resp-size": 1048576,
"http-resp-content-type": "text/plain",
"admissions-percentile": 90
},
{
},
{
"name": "lpd_1.8",
"path": "lpd_wasm.so",
"port": 10015,
@ -239,8 +240,8 @@
"http-resp-size": 1048576,
"http-resp-content-type": "text/plain",
"admissions-percentile": 90
},
{
},
{
"name": "lpd_1.9",
"path": "lpd_wasm.so",
"port": 10016,
@ -250,8 +251,8 @@
"http-resp-size": 1048576,
"http-resp-content-type": "text/plain",
"admissions-percentile": 90
},
{
},
{
"name": "lpd_2.0",
"path": "lpd_wasm.so",
"port": 10017,
@ -261,8 +262,8 @@
"http-resp-size": 1048576,
"http-resp-content-type": "text/plain",
"admissions-percentile": 90
},
{
},
{
"name": "resize_1.5",
"path": "resize_wasm.so",
"port": 10018,
@ -272,8 +273,8 @@
"http-resp-size": 1524000,
"http-resp-content-type": "image/png",
"admissions-percentile": 90
},
{
},
{
"name": "resize_1.6",
"path": "resize_wasm.so",
"port": 10019,
@ -283,8 +284,8 @@
"http-resp-size": 1524000,
"http-resp-content-type": "image/png",
"admissions-percentile": 90
},
{
},
{
"name": "resize_1.7",
"path": "resize_wasm.so",
"port": 10020,
@ -294,8 +295,8 @@
"http-resp-size": 1524000,
"http-resp-content-type": "image/png",
"admissions-percentile": 90
},
{
},
{
"name": "resize_1.8",
"path": "resize_wasm.so",
"port": 10021,
@ -305,8 +306,8 @@
"http-resp-size": 1524000,
"http-resp-content-type": "image/png",
"admissions-percentile": 90
},
{
},
{
"name": "resize_1.9",
"path": "resize_wasm.so",
"port": 10022,
@ -316,8 +317,8 @@
"http-resp-size": 1524000,
"http-resp-content-type": "image/png",
"admissions-percentile": 90
},
{
},
{
"name": "resize_2.0",
"path": "resize_wasm.so",
"port": 10023,
@ -327,4 +328,5 @@
"http-resp-size": 1524000,
"http-resp-content-type": "image/png",
"admissions-percentile": 90
}
}
]

@ -305,6 +305,8 @@ module_new_from_json(char *file_name)
int module_count = 0;
for (int i = 0; i < total_tokens; i++) {
/* If we have multiple objects, they should be wrapped in a JSON array */
if (tokens[i].type == JSMN_ARRAY) continue;
assert(tokens[i].type == JSMN_OBJECT);
char module_name[MODULE_MAX_NAME_LENGTH] = { 0 };

Loading…
Cancel
Save