Permalink
Browse files
Fixed verification warnings for Slim for single and multi-queries. Re…
- Loading branch information...
Showing
with
22 additions
and
2 deletions.
-
+1
−1
frameworks/PHP/php-slim/benchmark_config
-
+21
−1
frameworks/PHP/php-slim/index.php
|
|
@@ -5,7 +5,7 @@ |
|
|
"setup_file": "setup",
|
|
|
"json_url": "/json",
|
|
|
"db_url": "/db",
|
|
|
"query_url": "/db?queries=",
|
|
|
"query_url": "/dbs?queries=",
|
|
|
"port": 8080,
|
|
|
"approach": "Realistic",
|
|
|
"classification": "Micro",
|
|
|
|
|
|
@@ -43,13 +43,33 @@ |
|
|
});
|
|
|
|
|
|
$app->get('/db', function () use($app) {
|
|
|
$world = R::load('World', mt_rand(1, 10000))->export();
|
|
|
# Cast fields to int so they don't get wrapped with quotes
|
|
|
$world['id'] = (int) $world['id'];
|
|
|
$world['randomNumber'] = (int) $world['randomNumber'];
|
|
|
|
|
|
$app->contentType('application/json');
|
|
|
echo json_encode($world);
|
|
|
});
|
|
|
|
|
|
$app->get('/dbs', function () use($app) {
|
|
|
$queries = ($app->request()->get('queries') !== null)
|
|
|
? $app->request()->get('queries')
|
|
|
: 1;
|
|
|
if ($queries < 1) {
|
|
|
$queries = 1;
|
|
|
}
|
|
|
else if ($queries > 500) {
|
|
|
$queries = 500;
|
|
|
}
|
|
|
$worlds = array();
|
|
|
|
|
|
for ($i = 0; $i < $queries; ++$i) {
|
|
|
$worlds[] = R::load('World', mt_rand(1, 10000))->export();
|
|
|
$world = R::load('World', mt_rand(1, 10000))->export();
|
|
|
# Cast fields to int so they don't get wrapped with quotes
|
|
|
$world['id'] = (int) $world['id'];
|
|
|
$world['randomNumber'] = (int) $world['randomNumber'];
|
|
|
$worlds[] = $world;
|
|
|
}
|
|
|
|
|
|
$app->contentType('application/json');
|
|
|
|
0 comments on commit
104009e